Class ParseError

  • All Implemented Interfaces:
    java.io.Serializable

    public class ParseError
    extends java.lang.Exception
    Exception thrown in case of an error during template parsing. Usually caused by invalid user input.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Tokenizer.Token getUnexpectedToken()
      Returns the unexpected token, if any.
      static ParseError unexpectedChar​(char expected, char found, int position)
      Constructs a new ParseError for an unexpected character.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • 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​(java.lang.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 Detail

      • 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