com.datumbox.framework.common.utilities
Class ReflectionMethods
- java.lang.Object
-
- com.datumbox.framework.common.utilities.ReflectionMethods
-
public class ReflectionMethods extends java.lang.ObjectThe ReflectionMethods class contains a list of utility methods related to Reflection.
-
-
Constructor Summary
Constructors Constructor and Description ReflectionMethods()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.reflect.MethodfindMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object... params)Finds the public, protected, default or private method of the object with the provided name and parameters.static java.util.List<java.lang.reflect.Field>getAllFields(java.util.List<java.lang.reflect.Field> fields, java.lang.Class<?> type)Gets all the fields recursively from all the parent classes.static java.lang.ObjectinvokeMethod(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object... params)Invokes a method on the object using reflection.static java.lang.ObjectinvokeMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object... params)Invokes a method on the object using reflection.
-
-
-
Method Detail
-
getAllFields
public static java.util.List<java.lang.reflect.Field> getAllFields(java.util.List<java.lang.reflect.Field> fields, java.lang.Class<?> type)Gets all the fields recursively from all the parent classes.- Parameters:
fields-type-- Returns:
-
findMethod
public static java.lang.reflect.Method findMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object... params)Finds the public, protected, default or private method of the object with the provided name and parameters.- Parameters:
obj-methodName-params-- Returns:
-
invokeMethod
public static java.lang.Object invokeMethod(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object... params)Invokes a method on the object using reflection.- Parameters:
obj-method-params-- Returns:
-
invokeMethod
public static java.lang.Object invokeMethod(java.lang.Object obj, java.lang.String methodName, java.lang.Object... params)Invokes a method on the object using reflection.- Parameters:
obj-methodName-params-- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG