|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--org.apache.commons.beanutils.MethodUtils
Utility reflection methods focussed on methods in general rather than properties in particular.
コンストラクタの概要 | |
MethodUtils()
|
メソッドの概要 | |
static java.lang.reflect.Method |
getAccessibleMethod(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class parameterType)
Return an accessible method (that is, one that can be invoked via reflection) with given name and a single parameter. |
static java.lang.reflect.Method |
getAccessibleMethod(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class[] parameterTypes)
Return an accessible method (that is, one that can be invoked via reflection) with given name and parameters. |
static java.lang.reflect.Method |
getAccessibleMethod(java.lang.reflect.Method method)
Return an accessible method (that is, one that can be invoked via reflection) that implements the specified Method. |
private static java.lang.reflect.Method |
getAccessibleMethodFromInterfaceNest(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class[] parameterTypes)
Return an accessible method (that is, one that can be invoked via reflection) that implements the specified method, by scanning through all implemented interfaces and subinterfaces. |
static java.lang.Object |
invokeExactMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object arg)
Invoke a method whose parameter type matches exactly the object type. This is a convenient wrapper for invokeExactMethod(Object object,String methodName,Object [] args) .
|
static java.lang.Object |
invokeExactMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] args)
Invoke a method whose parameter types match exactly the object types. This uses reflection to invoke the method obtained from a call to getAccessibleMethod(java.lang.Class, java.lang.String, java.lang.Class) . |
static java.lang.Object |
invokeExactMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] parameterTypes)
Invoke a method whose parameter types match exactly the parameter types given. This uses reflection to invoke the method obtained from a call to getAccessibleMethod(java.lang.Class, java.lang.String, java.lang.Class) . |
クラス java.lang.Object から継承したメソッド |
|
コンストラクタの詳細 |
public MethodUtils()
メソッドの詳細 |
public static java.lang.Object invokeExactMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object arg) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Invoke a method whose parameter type matches exactly the object type.
This is a convenient wrapper for
invokeExactMethod(Object object,String methodName,Object [] args)
.
object
- invoke method on this objectmethodName
- get method with this namearg
- use this argumentpublic static java.lang.Object invokeExactMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Invoke a method whose parameter types match exactly the object types.
This uses reflection to invoke the method obtained from a call to
getAccessibleMethod(java.lang.Class, java.lang.String, java.lang.Class)
.
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these argumentspublic static java.lang.Object invokeExactMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] parameterTypes) throws java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
Invoke a method whose parameter types match exactly the parameter types given.
This uses reflection to invoke the method obtained from a call to
getAccessibleMethod(java.lang.Class, java.lang.String, java.lang.Class)
.
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these argumentsparameterTypes
- match these parameterspublic static java.lang.reflect.Method getAccessibleMethod(java.lang.Class clazz, java.lang.String methodName, java.lang.Class parameterType)
Return an accessible method (that is, one that can be invoked via
reflection) with given name and a single parameter. If no such method
can be found, return null
.
Basically, a convenience wrapper that constructs a Class
array for you.
clazz
- get method from this classmethodName
- get method with this nameparameterType
- taking this type of parameterpublic static java.lang.reflect.Method getAccessibleMethod(java.lang.Class clazz, java.lang.String methodName, java.lang.Class[] parameterTypes)
Return an accessible method (that is, one that can be invoked via
reflection) with given name and parameters. If no such method
can be found, return null
.
This is just a convenient wrapper for
getAccessibleMethod(Method method)
.
clazz
- get method from this classmethodName
- get method with this nameparameterTypes
- with these parameters typespublic static java.lang.reflect.Method getAccessibleMethod(java.lang.reflect.Method method)
Return an accessible method (that is, one that can be invoked via
reflection) that implements the specified Method. If no such method
can be found, return null
.
method
- The method that we wish to callprivate static java.lang.reflect.Method getAccessibleMethodFromInterfaceNest(java.lang.Class clazz, java.lang.String methodName, java.lang.Class[] parameterTypes)
Return an accessible method (that is, one that can be invoked via
reflection) that implements the specified method, by scanning through
all implemented interfaces and subinterfaces. If no such method
can be found, return null
.
There isn't any good reason why this method must be private. It is because there doesn't seem any reason why other classes should call this rather than the higher level methods.
clazz
- Parent class for the interfaces to be checkedmethodName
- Method name of the method we wish to callparameterTypes
- The parameter type signatures
|
||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |