Package com.adobe.acs.commons.mcp.util
Class AccessibleObjectUtil
- java.lang.Object
-
- com.adobe.acs.commons.mcp.util.AccessibleObjectUtil
-
public class AccessibleObjectUtil extends Object
Methods to handle AccessibleObjects (field and methods) in a similar manner
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFieldName(AccessibleObject o)Return field name or extract property name from getter method name if neededstatic TypegetGenericType(AccessibleObject accessibleObject)Get the genericproperty type (assuming it's either a field or a getter method)static Class<?>getType(AccessibleObject accessibleObject)Get the property type (assuming it's either a field or a getter method)static <T> TprocessDualFunction(AccessibleObject o, Function<Method,T> methodFunction, Function<Field,T> fieldFunction)
-
-
-
Method Detail
-
processDualFunction
public static <T> T processDualFunction(AccessibleObject o, Function<Method,T> methodFunction, Function<Field,T> fieldFunction)
-
getType
public static Class<?> getType(AccessibleObject accessibleObject)
Get the property type (assuming it's either a field or a getter method)- Parameters:
accessibleObject-- Returns:
-
getGenericType
public static Type getGenericType(AccessibleObject accessibleObject)
Get the genericproperty type (assuming it's either a field or a getter method)- Parameters:
accessibleObject-- Returns:
-
getFieldName
public static String getFieldName(AccessibleObject o)
Return field name or extract property name from getter method name if needed- Parameters:
o- Field or Method- Returns:
- String of extracted name, or null if not able to convert
-
-