MethodInvocation
.public interface Invocation
MethodAdvice
.Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getMethodAnnotation(Class<T> annotationClass)
Deprecated.
Returns the annotation, placed on the method being invoked, for the specified type.
|
String |
getMethodName()
Deprecated.
Returns the name of the method being invoked.
|
Object |
getParameter(int index)
Deprecated.
Returns the indicated parameter (may return null if the parameter is null).
|
int |
getParameterCount()
Deprecated.
Returns the number of parameters passed to the method.
|
Class |
getParameterType(int index)
Deprecated.
Returns the type of the parameter at the index.
|
Object |
getResult()
Deprecated.
The return value after
proceed() , which may be null. |
Class |
getResultType()
Deprecated.
Returns the type of the method result, which may be a primitive type (i.e., int.class) or even void
(void.class).
|
<T extends Throwable> |
getThrown(Class<T> throwableClass)
Deprecated.
After invoking
proceed() , used to obtain the thrown (checked) exception, if assignable to the provided
type. |
boolean |
isFail()
Deprecated.
If true, then the proceeded invocation threw a checked exception.
|
void |
override(int index,
Object newParameter)
Deprecated.
Replaces a parameter in the invocation.
|
void |
overrideResult(Object newResult)
Deprecated.
Overrides the result.
|
void |
overrideThrown(Exception thrown)
Deprecated.
Overrides the thrown exception.
|
void |
proceed()
Deprecated.
Proceed with the invocation of the advised method.
|
void |
rethrow()
Deprecated.
If the invocation failed (with a checked exception), then rethrow the exception wrapped in a
RuntimeException.
|
String getMethodName()
Class getResultType()
int getParameterCount()
Class getParameterType(int index)
Object getParameter(int index)
void override(int index, Object newParameter)
index
- of parameter to updatenewParameter
- new parameter value (may be null)void proceed()
isFail()
.boolean isFail()
void rethrow()
<T extends Throwable> T getThrown(Class<T> throwableClass)
proceed()
, used to obtain the thrown (checked) exception, if assignable to the provided
type.throwableClass
- the type of exception to matchvoid overrideThrown(Exception thrown)
Error
s, those can just be thrown. Sets the fail flag.thrown
- IllegalArgumentException
- if thrown is null, or not a declared exception of the methodvoid overrideResult(Object newResult)
<T extends Annotation> T getMethodAnnotation(Class<T> annotationClass)
annotationClass
- the Class object corresponding to the
annotation typeCopyright © 2003-2012 The Apache Software Foundation.