|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.util.reflection.plain.PlainReflectionMethod<T>
public class PlainReflectionMethod<T>
A plain implemenation of ReflectionMethod
that simply delegates operations to Method.
| Constructor Summary | |
|---|---|
PlainReflectionMethod(Method method)
|
|
| Method Summary | ||
|---|---|---|
|
getAnnotation(Class<A> annotationType)
Returns this element's annotation for the specified type if such an annotation is present, else null. |
|
Class<?> |
getDeclaringClass()
Returns the Class object representing the class or interface that declares the member or constructor represented by this Member. |
|
Class[] |
getExceptionTypes()
Returns an array of Class objects that represent
the types of the exceptions declared to be thrown
by the underlying method
represented by this IMethod object. |
|
Type |
getGenericReturnType()
Returns a Type object that represents the formal return type of the method represented by this Method object. |
|
Method |
getMethod()
Return a reference to the Method that this ReflectionMethod
represent. |
|
int |
getModifiers()
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer. |
|
String |
getName()
Returns the simple name of the underlying member or constructor represented by this Member. |
|
Class<?>[] |
getParameterTypes()
Returns an array of Class objects that represent the formal
parameter types, in declaration order, of the method
represented by this Method object. |
|
Class<?> |
getReturnType()
Returns a Class object that represents the formal return type
of the method represented by this IMethod object. |
|
Object |
invoke(Object obj,
Object... args)
Invokes the underlying method represented by this IMethod
object, on the specified object with the specified parameters. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PlainReflectionMethod(Method method)
| Method Detail |
|---|
public Class<?> getDeclaringClass()
ReflectionMethod
getDeclaringClass in interface ReflectionMethodpublic String getName()
ReflectionMethod
getName in interface ReflectionMethodpublic int getModifiers()
ReflectionMethod
getModifiers in interface ReflectionMethodModifierpublic Class<?> getReturnType()
ReflectionMethodClass object that represents the formal return type
of the method represented by this IMethod object.
getReturnType in interface ReflectionMethodpublic Class<?>[] getParameterTypes()
ReflectionMethodClass objects that represent the formal
parameter types, in declaration order, of the method
represented by this Method object. Returns an array of length
0 if the underlying method takes no parameters.
getParameterTypes in interface ReflectionMethodpublic Class[] getExceptionTypes()
ReflectionMethodClass objects that represent
the types of the exceptions declared to be thrown
by the underlying method
represented by this IMethod object. Returns an array of length
0 if the method declares no exceptions in its throws clause.
getExceptionTypes in interface ReflectionMethodpublic <A extends Annotation> A getAnnotation(Class<A> annotationType)
ReflectionMethod
getAnnotation in interface ReflectionMethodannotationType - the Class object corresponding to the
annotation type
public Type getGenericReturnType()
ReflectionMethodIf the return type is a parameterized type, the Type object returned must accurately reflect the actual type parameters used in the source code.
If the return type is a type variable or a parameterized type, it is created. Otherwise, it is resolved.
getGenericReturnType in interface ReflectionMethod
public Object invoke(Object obj,
Object... args)
throws IllegalAccessException,
IllegalArgumentException,
InvocationTargetException
ReflectionMethodIMethod
object, on the specified object with the specified parameters.
Individual parameters are automatically unwrapped to match
primitive formal parameters, and both primitive and reference
parameters are subject to method invocation conversions as
necessary.
invoke in interface ReflectionMethodobj - the object the underlying method is invoked fromargs - the arguments used for the method call
obj with parameters
args
IllegalAccessException - if this Method object
enforces Java language access control and the underlying
method is inaccessible.
IllegalArgumentException - if the method is an
instance method and the specified object argument
is not an instance of the class or interface
declaring the underlying method (or of a subclass
or implementor thereof); if the number of actual
and formal parameters differ; if an unwrapping
conversion for primitive arguments fails; or if,
after possible unwrapping, a parameter value
cannot be converted to the corresponding formal
parameter type by a method invocation conversion.
InvocationTargetException - if the underlying method
throws an exception.public Method getMethod()
ReflectionMethodMethod that this ReflectionMethod
represent.
getMethod in interface ReflectionMethod
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||