Class ParseErrorException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ParseErrorException
    extends VelocityException
    Application-level exception thrown when a resource of any type has a syntax or other error which prevents it from being parsed.
    When this resource is thrown, a best effort will be made to have useful information in the exception's message. For complete information, consult the runtime log.
    Version:
    $Id: ParseErrorException.java 736638 2009-01-22 13:42:52Z byron $
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int columnNumber
      The column number of the parsing error, or -1 if not defined.
      private java.lang.String invalidSyntax
      If applicable, contains the invalid syntax or reference that triggered this exception
      private static java.util.regex.Pattern lexError  
      private int lineNumber
      The line number of the parsing error, or -1 if not defined.
      private java.lang.String msg
      If we modify the message, then we set this
      private static long serialVersionUID
      Version Id for serializable
      private java.lang.String templateName
      The name of the template containing the error, or null if not defined.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParseErrorException​(java.lang.String exceptionMessage)
      Create a ParseErrorException with the given message.
      ParseErrorException​(java.lang.String exceptionMessage, Info info)
      Create a ParseErrorRuntimeException with the given message and info
      ParseErrorException​(java.lang.String exceptionMessage, Info info, java.lang.String invalidSyntax)
      Create a ParseErrorRuntimeException with the given message and info
      ParseErrorException​(VelocityException pex, java.lang.String templName)
      Create a ParseErrorException with the given ParseException.
      ParseErrorException​(ParseException pex, java.lang.String templName)
      Create a ParseErrorException with the given ParseException.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColumnNumber()
      Return the column number of the parsing error, or -1 if not defined.
      java.lang.String getInvalidSyntax()
      Return the invalid syntax or reference that triggered this error, or null if not defined.
      int getLineNumber()
      Return the line number of the parsing error, or -1 if not defined.
      java.lang.String getMessage()
      Return our custum message if we have one, else return the default message
      java.lang.String getTemplateName()
      Return the name of the template containing the error, or null if not defined.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, 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
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Version Id for serializable
        See Also:
        Constant Field Values
      • columnNumber

        private int columnNumber
        The column number of the parsing error, or -1 if not defined.
      • lineNumber

        private int lineNumber
        The line number of the parsing error, or -1 if not defined.
      • templateName

        private java.lang.String templateName
        The name of the template containing the error, or null if not defined.
      • invalidSyntax

        private java.lang.String invalidSyntax
        If applicable, contains the invalid syntax or reference that triggered this exception
      • msg

        private java.lang.String msg
        If we modify the message, then we set this
      • lexError

        private static final java.util.regex.Pattern lexError
    • Constructor Detail

      • ParseErrorException

        public ParseErrorException​(java.lang.String exceptionMessage)
        Create a ParseErrorException with the given message.
        Parameters:
        exceptionMessage - the error exception message
      • ParseErrorException

        public ParseErrorException​(ParseException pex,
                                   java.lang.String templName)
        Create a ParseErrorException with the given ParseException.
        Parameters:
        pex - the parsing exception
        Since:
        1.5
      • ParseErrorException

        public ParseErrorException​(VelocityException pex,
                                   java.lang.String templName)
        Create a ParseErrorException with the given ParseException.
        Parameters:
        pex - the parsing exception
        Since:
        1.5
      • ParseErrorException

        public ParseErrorException​(java.lang.String exceptionMessage,
                                   Info info)
        Create a ParseErrorRuntimeException with the given message and info
        Parameters:
        exceptionMessage - the error exception message
        info - an Info object with the current template info
        Since:
        1.5
      • ParseErrorException

        public ParseErrorException​(java.lang.String exceptionMessage,
                                   Info info,
                                   java.lang.String invalidSyntax)
        Create a ParseErrorRuntimeException with the given message and info
        Parameters:
        exceptionMessage - the error exception message
        info - an Info object with the current template info
        invalidSyntax - the invalid syntax or reference triggering this exception
        Since:
        1.5
    • Method Detail

      • getColumnNumber

        public int getColumnNumber()
        Return the column number of the parsing error, or -1 if not defined.
        Returns:
        column number of the parsing error, or -1 if not defined
        Since:
        1.5
      • getLineNumber

        public int getLineNumber()
        Return the line number of the parsing error, or -1 if not defined.
        Returns:
        line number of the parsing error, or -1 if not defined
        Since:
        1.5
      • getTemplateName

        public java.lang.String getTemplateName()
        Return the name of the template containing the error, or null if not defined.
        Returns:
        the name of the template containing the parsing error, or null if not defined
        Since:
        1.5
      • getInvalidSyntax

        public java.lang.String getInvalidSyntax()
        Return the invalid syntax or reference that triggered this error, or null if not defined.
        Returns:
        Return the invalid syntax or reference that triggered this error, or null if not defined
        Since:
        1.5
      • getMessage

        public java.lang.String getMessage()
        Return our custum message if we have one, else return the default message
        Overrides:
        getMessage in class java.lang.Throwable