Class ParseError
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.openstreetmap.josm.tools.template_engine.ParseError
- All Implemented Interfaces:
Serializable
Exception thrown in case of an error during template parsing.
Usually caused by invalid user input.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParseError(int position, SearchParseError e) Constructs a newParseErrorfrom aSearchParseError.ParseError(String message) Constructs a newParseErrorwith a generic message.ParseError(Tokenizer.Token unexpectedToken) Constructs a newParseErrorfor an unexpected token.ParseError(Tokenizer.Token unexpectedToken, Tokenizer.TokenType expected) Constructs a newParseErrorfor an unexpected token and an expected token. -
Method Summary
Modifier and TypeMethodDescriptionReturns the unexpected token, if any.static ParseErrorunexpectedChar(char expected, char found, int position) Constructs a newParseErrorfor an unexpected character.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
unexpectedToken
-
-
Constructor Details
-
ParseError
Constructs a newParseErrorfor an unexpected token.- Parameters:
unexpectedToken- the unexpected token
-
ParseError
Constructs a newParseErrorfor an unexpected token and an expected token.- Parameters:
unexpectedToken- the unexpected tokenexpected- the expected token
-
ParseError
Constructs a newParseErrorfrom aSearchParseError.- Parameters:
position- the positione- the cause
-
ParseError
Constructs a newParseErrorwith a generic message.- Parameters:
message- the detail message. The detail message is saved for later retrieval by theThrowable.getMessage()method.
-
-
Method Details
-
getUnexpectedToken
Returns the unexpected token, if any.- Returns:
- the unexpected token, or null
-
unexpectedChar
Constructs a newParseErrorfor an unexpected character.- Parameters:
expected- the expected characterfound- the found characterposition- the position- Returns:
- a new
ParseError
-