Package com.adobe.acs.commons.mcp.util
Class AccessibleObjectUtil
java.lang.Object
com.adobe.acs.commons.mcp.util.AccessibleObjectUtil
Methods to handle AccessibleObjects (field and methods) in a similar manner
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturn 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 Details
-
processDualFunction
public static <T> T processDualFunction(AccessibleObject o, Function<Method, T> methodFunction, Function<Field, T> fieldFunction) -
getType
Get the property type (assuming it's either a field or a getter method)- Parameters:
accessibleObject-- Returns:
-
getGenericType
Get the genericproperty type (assuming it's either a field or a getter method)- Parameters:
accessibleObject-- Returns:
-
getFieldName
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
-