java.lang.Object
java.lang.Throwable
java.lang.Exception
org.openstreetmap.josm.tools.template_engine.ParseError
All Implemented Interfaces:
Serializable

public class ParseError extends Exception
Exception thrown in case of an error during template parsing. Usually caused by invalid user input.
See Also:
  • Field Details

  • Constructor Details

    • ParseError

      public ParseError(Tokenizer.Token unexpectedToken)
      Constructs a new ParseError for an unexpected token.
      Parameters:
      unexpectedToken - the unexpected token
    • ParseError

      public ParseError(Tokenizer.Token unexpectedToken, Tokenizer.TokenType expected)
      Constructs a new ParseError for an unexpected token and an expected token.
      Parameters:
      unexpectedToken - the unexpected token
      expected - the expected token
    • ParseError

      public ParseError(int position, SearchParseError e)
      Constructs a new ParseError from a SearchParseError.
      Parameters:
      position - the position
      e - the cause
    • ParseError

      public ParseError(String message)
      Constructs a new ParseError with a generic message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.
  • Method Details

    • getUnexpectedToken

      Returns the unexpected token, if any.
      Returns:
      the unexpected token, or null
    • unexpectedChar

      public static ParseError unexpectedChar(char expected, char found, int position)
      Constructs a new ParseError for an unexpected character.
      Parameters:
      expected - the expected character
      found - the found character
      position - the position
      Returns:
      a new ParseError