org.apache.velocity.exception
Class MethodInvocationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.velocity.exception.VelocityException
                  extended by org.apache.velocity.exception.MethodInvocationException
All Implemented Interfaces:
Serializable, ExtendedParseException

public class MethodInvocationException
extends VelocityException
implements 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.

Version:
$Id: MethodInvocationException.java 898032 2010-01-11 19:51:03Z nbubna $
Author:
Geir Magnusson Jr.
See Also:
Serialized Form

Constructor Summary
MethodInvocationException(String message, Throwable e, String methodName, String templateName, int lineNumber, int columnNumber)
          CTOR - wraps the passed in exception for examination later
 
Method Summary
 int getColumnNumber()
          returns the column number where this exception occured.
 int getLineNumber()
          returns the line number where this exception occured.
 String getMessage()
           
 String getMethodName()
          Returns the name of the method that threw the exception.
 String getReferenceName()
          Retrieves the name of the reference that caused the exception.
 String getTemplateName()
          returns the Template name where this exception occured.
 void setReferenceName(String ref)
          Sets the reference name that threw this exception.
 
Methods inherited from class org.apache.velocity.exception.VelocityException
getWrappedThrowable
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 wrapping
methodName - name of method that threw the exception
templateName - The name of the template where the exception occured.
Method Detail

getMethodName

public String getMethodName()
Returns the name of the method that threw the exception.

Returns:
String name of method

setReferenceName

public void setReferenceName(String ref)
Sets the reference name that threw this exception.

Parameters:
ref - name of reference

getReferenceName

public String 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 occured.

Specified by:
getColumnNumber in interface ExtendedParseException
Returns:
The column number where this exception occured.
Since:
1.5
See Also:
ExtendedParseException.getColumnNumber()

getLineNumber

public int getLineNumber()
Description copied from interface: ExtendedParseException
returns the line number where this exception occured.

Specified by:
getLineNumber in interface ExtendedParseException
Returns:
The line number where this exception occured.
Since:
1.5
See Also:
ExtendedParseException.getLineNumber()

getTemplateName

public String getTemplateName()
Description copied from interface: ExtendedParseException
returns the Template name where this exception occured.

Specified by:
getTemplateName in interface ExtendedParseException
Returns:
The Template name where this exception occured.
Since:
1.5
See Also:
ExtendedParseException.getTemplateName()

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable
Since:
1.5
See Also:
Throwable.getMessage()


Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.