Class ParseErrorException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PPTXParseErrorException, XLSXParseErrorException

@OpenApiAll public class ParseErrorException extends TemplateException
Application-level exception thrown when a template has a syntax or other error which prevents it from being parsed.
Since:
Jun 11, 2007
See Also:
  • Field Details

    • columnNumber

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

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

      protected Template template
      Contains reference to error template.
    • source

      protected String source
      Contains content to template until error offset.
    • fullMessage

      protected String fullMessage
      Message in detailed.
  • Constructor Details

    • ParseErrorException

      public ParseErrorException()
      Constructs a new exception with null as its detail message.
    • ParseErrorException

      public ParseErrorException(String message)
      Constructs a new exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
    • ParseErrorException

      public ParseErrorException(String message, Template template)
      Constructs a new exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
      template - template
    • ParseErrorException

      public ParseErrorException(String message, Template template, int lineNumber)
      Constructs a new exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
      template - template
      lineNumber - line number
    • ParseErrorException

      public ParseErrorException(String message, Template template, int lineNumber, int columnNumber)
      Constructs a new exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
      template - template
      lineNumber - line number
      columnNumber - column number
    • ParseErrorException

      public ParseErrorException(String message, Template template, int lineNumber, int columnNumber, String source)
      Constructs a new exception with the specified detail message.
      Parameters:
      message - the detail message. The detail message is saved for later retrieval by the getMessage() method.
      template - template
      lineNumber - line number
      columnNumber - column number
      source - template content until offset of error character.
    • ParseErrorException

      public ParseErrorException(String message, Throwable cause)
      Constructs a new exception with the specified detail message and cause.

      Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

      Parameters:
      message - the detail message (which is saved for later retrieval by the getMessage() method).
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
    • ParseErrorException

      public ParseErrorException(Throwable cause)
      Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, PrivilegedActionException).
      Parameters:
      cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
  • Method Details

    • setColumnNumber

      public void setColumnNumber(int columnNumber)
      Set a column number of the parsing error.
      Parameters:
      columnNumber - column number of the parsing error
    • setLineNumber

      public void setLineNumber(int lineNumber)
      Set a line number of the parsing error.
      Parameters:
      lineNumber - the line number of the parsing error
    • setTemplate

      public void setTemplate(Template template)
      Set a template containing the error.
      Parameters:
      template - the template containing the error
    • 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
    • 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
    • getTemplate

      public Template getTemplate()
      Return the template containing the error, or null if not defined.
      Returns:
      the template containing the parsing error, or null if not defined
    • getSource

      public String getSource()
      Return a source.
      Returns:
      the source
    • setSource

      public void setSource(String source)
      Set a source.
      Parameters:
      source - the source to set
    • setFullMessage

      public void setFullMessage(String fullMessage)
      Set a full message.
      Parameters:
      fullMessage - the full message to set
    • getFullMessage

      public String getFullMessage()
      Return a full message.
      Returns:
      a full message.
    • getSourceMessage

      public String getSourceMessage()
      Return a message without customize.
      Returns:
      a message.
    • getMessage

      public String getMessage()
      Return a full message.
      Overrides:
      getMessage in class Throwable
      Returns:
      the full message
    • toString

      public String toString()
      Return string representation of this exception
      Overrides:
      toString in class Throwable
      Returns:
      a string representation of this exception
    • getShortMessage

      public String getShortMessage()
      Return string representation of this exception without velocityMessageToHumanReadable
      Returns:
    • copy

      public ParseErrorException copy(String message)
      Creates and returns a copy of this object.
      Parameters:
      message - a new message
      Returns:
      a copy of this instance.