|
||||||||||
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 | |
---|---|
Object |
getInstance()
The instance on which the method was originally invoked. |
InstanceContext |
getInstanceContext()
|
Method |
getMethod()
Returns the method being invoked. |
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(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,
Object newValue)
Changes a parameter value. |
MethodInvocation |
setReturnValue(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 |
---|
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(Object returnValue)
Overriding the return value clears any checked exception.
returnValue
-
NullPointerException
- if the method's return type is a primitive and null is providedObject getParameter(int index)
index
- of parameter to access
MethodInvocation setParameter(int index, Object newValue)
index
- index of parameter to modifynewValue
- new value for parameter
MethodInvocation setCheckedException(Exception exception)
exception
- new checked exception, or null
Method getMethod()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |