Package org.apache.velocity.exception
Class MethodInvocationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.velocity.exception.VelocityException
org.apache.velocity.exception.MethodInvocationException
- All Implemented Interfaces:
Serializable
,ExtendedParseException
Application-level exception thrown when a reference method is
invoked and an exception is thrown.
When this exception 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 exception 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.
- See Also:
-
Constructor Summary
ConstructorDescriptionMethodInvocationException
(String message, Throwable e, String[] stacktrace, String methodName, String templateName, int lineNumber, int columnNumber) CTOR - wraps the passed in exception for examination laterMethodInvocationException
(String message, Throwable e, String methodName, String templateName, int lineNumber, int columnNumber) CTOR - wraps the passed in exception for examination later -
Method Summary
Modifier and TypeMethodDescriptionint
returns the column number where this exception occurred.int
returns the line number where this exception occurred.Returns the name of the method that threw the exception.Retrieves the name of the reference that caused the exception.returns the Template name where this exception occurred.void
setReferenceName
(String ref) Sets the reference name that threw this exception.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
-
MethodInvocationException
public MethodInvocationException(String message, Throwable e, String methodName, String templateName, int lineNumber, int columnNumber) CTOR - wraps the passed in exception for examination later- Parameters:
message
-e
- Throwable that we are wrappingmethodName
- name of method that threw the exceptiontemplateName
- The name of the template where the exception occurredlineNumber
- line numbercolumnNumber
- column number
-
MethodInvocationException
public MethodInvocationException(String message, Throwable e, String[] stacktrace, String methodName, String templateName, int lineNumber, int columnNumber) CTOR - wraps the passed in exception for examination later- Parameters:
message
-e
- Throwable that we are wrappingstacktrace
- VTL stacktracemethodName
- name of method that threw the exceptiontemplateName
- The name of the template where the exception occurredlineNumber
- line numbercolumnNumber
- column number
-
-
Method Details
-
getMethodName
Returns the name of the method that threw the exception.- Returns:
- String name of method
-
setReferenceName
Sets the reference name that threw this exception.- Parameters:
ref
- name of reference
-
getReferenceName
Retrieves the name of the reference that caused the exception.- Returns:
- name of reference.
-
getColumnNumber
public int getColumnNumber()Description copied from interface:ExtendedParseException
returns the column number where this exception occurred.- Specified by:
getColumnNumber
in interfaceExtendedParseException
- Returns:
- The column number where this exception occurred.
- Since:
- 1.5
- See Also:
-
getLineNumber
public int getLineNumber()Description copied from interface:ExtendedParseException
returns the line number where this exception occurred.- Specified by:
getLineNumber
in interfaceExtendedParseException
- Returns:
- The line number where this exception occurred.
- Since:
- 1.5
- See Also:
-
getTemplateName
Description copied from interface:ExtendedParseException
returns the Template name where this exception occurred.- Specified by:
getTemplateName
in interfaceExtendedParseException
- Returns:
- The Template name where this exception occurred.
- Since:
- 1.5
- See Also:
-
getMessage
- Overrides:
getMessage
in classThrowable
- Since:
- 1.5
- See Also:
-