Class MacroParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.velocity.runtime.parser.ParseException
org.apache.velocity.runtime.directive.MacroParseException
- All Implemented Interfaces:
Serializable
,ExtendedParseException
Exception to indicate problem happened while constructing #macro()
For internal use in parser - not to be passed to app level
- Version:
- $Id$
- Author:
- Geir Magnusson Jr., Henning P. Schmiedehausen
- See Also:
-
Field Summary
Fields inherited from class org.apache.velocity.runtime.parser.ParseException
currentToken, eol, expectedTokenSequences, specialConstructor, tokenImage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
int
returns the column number where this exception occured.int
returns the line number where this exception occured.This method has the standard behavior when this object has been created using the standard constructors.returns the Template name where this exception occured.Methods inherited from class org.apache.velocity.runtime.parser.ParseException
add_escapes
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MacroParseException
- Parameters:
msg
-templateName
-currentToken
-
-
-
Method Details
-
getTemplateName
returns the Template name where this exception occured.- Specified by:
getTemplateName
in interfaceExtendedParseException
- Returns:
- The Template name where this exception occured.
- Since:
- 1.5
-
getLineNumber
public int getLineNumber()returns the line number where this exception occured.- Specified by:
getLineNumber
in interfaceExtendedParseException
- Returns:
- The line number where this exception occured.
- Since:
- 1.5
-
getColumnNumber
public int getColumnNumber()returns the column number where this exception occured.- Specified by:
getColumnNumber
in interfaceExtendedParseException
- Returns:
- The column number where this exception occured.
- Since:
- 1.5
-
getMessage
This method has the standard behavior when this object has been created using the standard constructors. Otherwise, it uses "currentToken" and "expectedTokenSequences" to generate a parse error message and returns it. If this object has been created due to a parse error, and you do not catch it (it gets thrown from the parser), then this method is called during the printing of the final stack trace, and hence the correct error message gets displayed.- Overrides:
getMessage
in classParseException
- Returns:
- the current message.
- Since:
- 1.5
-
appendTemplateInfo
- Parameters:
sb
-- Since:
- 1.5
-