|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MethodInvocation
A representation of the invocation of a method that allows the behavior of the method to be advised: either by changing parameter values, or by changing the return value, or by catch or throwing different exceptions. Provides access to annotations on the advised method.
MethodAdvice
Method Summary | |
---|---|
java.lang.Object |
getInstance()
The instance on which the method was originally invoked. |
InstanceContext |
getInstanceContext()
|
java.lang.reflect.Method |
getMethod()
Returns the method being invoked. |
java.lang.Object |
getParameter(int index)
Returns the parameter at the given index. |
MethodInvocation |
proceed()
Proceed with the method invocation, either chaining into the next MethodAdvice added to the method, or
ultimately into the actual method implementation. |
MethodInvocation |
setCheckedException(java.lang.Exception exception)
Sets the checked exception; this can be used to indicate failure for the method, or to cancel the thrown exception (by setting the exception to null). |
MethodInvocation |
setParameter(int index,
java.lang.Object newValue)
Changes a parameter value. |
MethodInvocation |
setReturnValue(java.lang.Object returnValue)
Overrides the return value of the method. |
Methods inherited from interface org.apache.tapestry5.plastic.MethodInvocationResult |
---|
didThrowCheckedException, getCheckedException, getReturnValue, rethrow |
Methods inherited from interface org.apache.tapestry5.plastic.AnnotationAccess |
---|
getAnnotation, hasAnnotation |
Method Detail |
---|
java.lang.Object getInstance()
InstanceContext getInstanceContext()
MethodInvocation proceed()
MethodAdvice
added to the method, or
ultimately into the actual method implementation. The method may throw a checked exception, which will be caught
and be reported as MethodInvocationResult.didThrowCheckedException()
.
MethodInvocation setReturnValue(java.lang.Object returnValue)
Overriding the return value clears any checked exception.
returnValue
-
java.lang.NullPointerException
- if the method's return type is a primitive and null is providedjava.lang.Object getParameter(int index)
index
- of parameter to access
MethodInvocation setParameter(int index, java.lang.Object newValue)
index
- index of parameter to modifynewValue
- new value for parameter
MethodInvocation setCheckedException(java.lang.Exception exception)
exception
- new checked exception, or null
java.lang.reflect.Method getMethod()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |