Class IntrospectionUtils


  • public final class IntrospectionUtils
    extends Object
    Utils for introspection and reflection
    • Constructor Detail

      • IntrospectionUtils

        public IntrospectionUtils()
    • Method Detail

      • setProperty

        public static boolean setProperty​(Object o,
                                          String name,
                                          String value)
        Find a method with the right name If found, call the method ( if param is int or boolean we'll convert value to the right type before) - that means you can have setDebug(1).
        Parameters:
        o - The object to set a property on
        name - The property name
        value - The property value
        Returns:
        true if operation was successful
      • setProperty

        public static boolean setProperty​(Object o,
                                          String name,
                                          String value,
                                          boolean invokeSetProperty)
      • replaceProperties

        public static String replaceProperties​(String value,
                                               Hashtable<Object,Object> staticProp,
                                               IntrospectionUtils.PropertySource[] dynamicProp)
        Replace ${NAME} with the property value.
        Parameters:
        value - The value
        staticProp - Replacement properties
        dynamicProp - Replacement properties
        Returns:
        the replacement value
      • capitalize

        public static String capitalize​(String name)
        Reverse of Introspector.decapitalize.
        Parameters:
        name - The name
        Returns:
        the capitalized string
      • clear

        public static void clear()
      • findMethods

        public static Method[] findMethods​(Class<?> c)