Class Inspector


  • public class Inspector
    extends Object
    The Inspector provides a unified access to an object's information that can be determined by introspection.
    • Constructor Detail

      • Inspector

        public Inspector​(Object objectUnderInspection)
        Parameters:
        objectUnderInspection - must not be null
    • Method Detail

      • getClassProps

        public String[] getClassProps()
        Get the Class Properties of the object under inspection.
        Returns:
        String array to be indexed by the CLASS_xxx_IDX constants
      • isGroovy

        public boolean isGroovy()
      • getObject

        public Object getObject()
        Gets the object being inspected.
        Returns:
        the object
      • getMethods

        public Object[] getMethods()
        Get info about usual Java instance and class Methods as well as Constructors.
        Returns:
        Array of StringArrays that can be indexed with the MEMBER_xxx_IDX constants
      • getMetaMethods

        public Object[] getMetaMethods()
        Get info about instance and class Methods that are dynamically added through Groovy.
        Returns:
        Array of StringArrays that can be indexed with the MEMBER_xxx_IDX constants
      • getPublicFields

        public Object[] getPublicFields()
        Get info about usual Java public fields incl. constants.
        Returns:
        Array of StringArrays that can be indexed with the MEMBER_xxx_IDX constants
      • getPropertyInfo

        public Object[] getPropertyInfo()
        Get info about Properties (Java and Groovy alike).
        Returns:
        Array of StringArrays that can be indexed with the MEMBER_xxx_IDX constants
      • fieldInfo

        protected String[] fieldInfo​(Field field)
      • getClassUnderInspection

        protected Class getClassUnderInspection()
      • shortName

        public static String shortName​(Class clazz)
      • methodInfo

        protected String[] methodInfo​(Method method)
      • withoutNulls

        protected String[] withoutNulls​(String[] toNormalize)
      • print

        public static void print​(Object[] memberInfo)