public class Methods
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName)
Invokes the specified accessible parameterless method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
boolean newValue)
Invokes the specified setter method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class[] clazz,
java.lang.Object... newValue)
Invokes the specified setter method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class clazz,
java.lang.Object newValue)
Invokes the specified setter method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
float newValue)
Invokes the specified setter method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
int newValue)
Invokes the specified method if it exists.
|
static java.lang.Object |
invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.String stringParameter)
Invokes the specified accessible method with a string parameter if it exists.
|
static boolean |
invokeGetter(java.lang.Object obj,
java.lang.String methodName,
boolean defaultValue)
Invokes the specified getter method if it exists.
|
static int |
invokeGetter(java.lang.Object obj,
java.lang.String methodName,
int defaultValue)
Invokes the specified getter method if it exists.
|
static long |
invokeGetter(java.lang.Object obj,
java.lang.String methodName,
long defaultValue)
Invokes the specified getter method if it exists.
|
static java.lang.Object |
invokeGetter(java.lang.Object obj,
java.lang.String methodName,
java.lang.Object defaultValue)
Invokes the specified getter method if it exists.
|
static void |
invokeIfExists(java.lang.Object obj,
java.lang.String methodName)
Invokes the specified setter method if it exists.
|
static void |
invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
boolean newValue)
Invokes the specified method if it exists.
|
static void |
invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class clazz,
java.lang.Object newValue)
Invokes the specified setter method if it exists.
|
static void |
invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
float newValue)
Invokes the specified setter method if it exists.
|
static void |
invokeIfExistsWithEnum(java.lang.Object obj,
java.lang.String methodName,
java.lang.String enumClassName,
java.lang.String enumValueName)
Invokes the specified setter method if it exists.
|
static java.lang.Object |
invokeStatic(java.lang.Class clazz,
java.lang.String methodName)
Invokes the specified accessible parameterless method if it exists.
|
static java.lang.Object |
invokeStatic(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values)
Invokes the specified parameterless method if it exists.
|
static java.lang.Object |
invokeStatic(java.lang.String clazz,
java.lang.String methodName)
Invokes the specified accessible parameterless method if it exists.
|
static java.lang.Object |
invokeStatic(java.lang.String clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values)
Invokes the specified parameterless method if it exists.
|
static java.lang.Object |
invokeStatic(java.lang.String clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values,
java.lang.Object defaultValue)
Invokes the specified parameterless method if it exists.
|
static boolean |
invokeStaticGetter(java.lang.Class clazz,
java.lang.String methodName,
boolean defaultValue)
Invokes the specified getter method if it exists.
|
public static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.String stringParameter)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.stringParameter - The String parameterjava.lang.NoSuchMethodExceptionpublic static java.lang.Object invokeStatic(java.lang.Class clazz,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
clazz - The class on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invokeStatic(java.lang.String clazz,
java.lang.String methodName)
throws java.lang.NoSuchMethodException
clazz - The class on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invokeStatic(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values)
throws java.lang.NoSuchMethodException
clazz - The class on which to invoke the method.methodName - The name of the method.types - The parameter types.values - The parameter values.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invokeStatic(java.lang.String clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values)
throws java.lang.NoSuchMethodException
clazz - The class on which to invoke the method.methodName - The name of the method.types - The parameter types.values - The parameter values.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invokeStatic(java.lang.String clazz,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object[] values,
java.lang.Object defaultValue)
clazz - The class on which to invoke the method.methodName - The name of the method.types - The parameter types.values - The parameter values.defaultValue - The default value.public static int invokeGetter(java.lang.Object obj,
java.lang.String methodName,
int defaultValue)
obj - The object on which to invoke the method.methodName - The name of the method.defaultValue - This value is returned, if the method does not exist.public static long invokeGetter(java.lang.Object obj,
java.lang.String methodName,
long defaultValue)
obj - The object on which to invoke the method.methodName - The name of the method.defaultValue - This value is returned, if the method does not exist.public static boolean invokeGetter(java.lang.Object obj,
java.lang.String methodName,
boolean defaultValue)
obj - The object on which to invoke the method.methodName - The name of the method.defaultValue - This value is returned, if the method does not exist.public static java.lang.Object invokeGetter(java.lang.Object obj,
java.lang.String methodName,
java.lang.Object defaultValue)
obj - The object on which to invoke the method.methodName - The name of the method.defaultValue - This value is returned, if the method does not exist.public static boolean invokeStaticGetter(java.lang.Class clazz,
java.lang.String methodName,
boolean defaultValue)
clazz - The object on which to invoke the method.methodName - The name of the method.defaultValue - This value is returned, if the method does not exist.public static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
boolean newValue)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
int newValue)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
float newValue)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class clazz,
java.lang.Object newValue)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static java.lang.Object invoke(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class[] clazz,
java.lang.Object... newValue)
throws java.lang.NoSuchMethodException
obj - The object on which to invoke the method.methodName - The name of the method.java.lang.NoSuchMethodExceptionpublic static void invokeIfExists(java.lang.Object obj,
java.lang.String methodName)
obj - The object on which to invoke the method.methodName - The name of the method.public static void invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
float newValue)
obj - The object on which to invoke the method.methodName - The name of the method.public static void invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
boolean newValue)
obj - The object on which to invoke the method.methodName - The name of the method.public static void invokeIfExists(java.lang.Object obj,
java.lang.String methodName,
java.lang.Class clazz,
java.lang.Object newValue)
obj - The object on which to invoke the method.methodName - The name of the method.public static void invokeIfExistsWithEnum(java.lang.Object obj,
java.lang.String methodName,
java.lang.String enumClassName,
java.lang.String enumValueName)
obj - The object on which to invoke the method.methodName - The name of the method.