Package org.apache.velocity.exception
Class ParseErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.velocity.exception.VelocityException
org.apache.velocity.exception.ParseErrorException
- All Implemented Interfaces:
Serializable
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.
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$
- Author:
- Geir Magnusson Jr., Henning P. Schmiedehausen
- See Also:
-
Constructor Summary
ConstructorDescriptionParseErrorException
(String exceptionMessage) Create a ParseErrorException with the given message.ParseErrorException
(String exceptionMessage, Info info) Create a ParseErrorRuntimeException with the given message and infoParseErrorException
(String exceptionMessage, Info info, String invalidSyntax) Create a ParseErrorRuntimeException with the given message and infoParseErrorException
(String exceptionMessage, Info info, String[] stacktrace) Create a ParseErrorRuntimeException with the given message and infoParseErrorException
(VelocityException pex, String templName) Create a ParseErrorException with the given ParseException.ParseErrorException
(ParseException pex, String templName) Create a ParseErrorException with the given ParseException. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the column number of the parsing error, or -1 if not defined.Return the invalid syntax or reference that triggered this error, or null if not defined.int
Return the line number of the parsing error, or -1 if not defined.Return our custom message if we have one, else return the default messageReturn the name of the template containing the error, or null if not defined.Methods inherited from class org.apache.velocity.exception.VelocityException
getVtlStackTrace, getWrappedThrowable
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParseErrorException
Create a ParseErrorException with the given message.- Parameters:
exceptionMessage
- the error exception message
-
ParseErrorException
Create a ParseErrorException with the given ParseException.- Parameters:
pex
- the parsing exceptiontemplName
-- Since:
- 1.5
-
ParseErrorException
Create a ParseErrorException with the given ParseException.- Parameters:
pex
- the parsing exceptiontemplName
-- Since:
- 1.5
-
ParseErrorException
Create a ParseErrorRuntimeException with the given message and info- Parameters:
exceptionMessage
- the error exception messageinfo
- an Info object with the current template info- Since:
- 1.5
-
ParseErrorException
Create a ParseErrorRuntimeException with the given message and info- Parameters:
exceptionMessage
- the error exception messageinfo
- an Info object with the current template info- Since:
- 2.2
-
ParseErrorException
Create a ParseErrorRuntimeException with the given message and info- Parameters:
exceptionMessage
- the error exception messageinfo
- an Info object with the current template infoinvalidSyntax
- the invalid syntax or reference triggering this exception- Since:
- 1.5
-
-
Method Details
-
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
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
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
Return our custom message if we have one, else return the default message- Overrides:
getMessage
in classThrowable
-