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 Details

    • 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