Class IntrospectionSupport


  • @Deprecated
    public final class IntrospectionSupport
    extends Object
    Deprecated.
    use BeanIntrospection
    Helper for introspections of beans.

    Important: Its recommended to call the stop() method when CamelContext is being stopped. This allows to clear the introspection cache.

    This implementation will skip methods from java.lang.Object and java.lang.reflect.Proxy.

    This implementation will use a cache when the getProperties(Object, java.util.Map, String) method is being used. Also the cacheClass(Class) method gives access to the introspect cache.

    • Method Detail

      • stop

        public static void stop()
        Deprecated.
        CamelContext should call this stop method when its stopping.

        This implementation will clear its introspection cache.

      • clearCache

        public static void clearCache()
        Deprecated.
        Clears the introspection cache.
      • getCacheCounter

        public static long getCacheCounter()
        Deprecated.
      • isGetter

        public static boolean isGetter​(Method method)
        Deprecated.
      • getGetterShorthandName

        public static String getGetterShorthandName​(Method method)
        Deprecated.
      • getSetterShorthandName

        public static String getSetterShorthandName​(Method method)
        Deprecated.
      • isSetter

        public static boolean isSetter​(Method method,
                                       boolean allowBuilderPattern)
        Deprecated.
      • isSetter

        public static boolean isSetter​(Method method)
        Deprecated.
      • getNonNullProperties

        public static Map<String,​Object> getNonNullProperties​(Object target)
        Deprecated.
        Will inspect the target for properties.

        Notice a property must have both a getter/setter method to be included. Notice all null values won't be included.

        Parameters:
        target - the target bean
        Returns:
        the map with found properties
      • getProperties

        public static boolean getProperties​(Object target,
                                            Map<String,​Object> properties,
                                            String optionPrefix)
        Deprecated.
        Will inspect the target for properties.

        Notice a property must have both a getter/setter method to be included. Notice all null values will be included.

        Parameters:
        target - the target bean
        properties - the map to fill in found properties
        optionPrefix - an optional prefix to append the property key
        Returns:
        true if any properties was found, false otherwise.
      • getProperties

        public static boolean getProperties​(Object target,
                                            Map<String,​Object> properties,
                                            String optionPrefix,
                                            boolean includeNull)
        Deprecated.
        Will inspect the target for properties.

        Notice a property must have both a getter/setter method to be included.

        Parameters:
        target - the target bean
        properties - the map to fill in found properties
        optionPrefix - an optional prefix to append the property key
        includeNull - whether to include null values
        Returns:
        true if any properties was found, false otherwise.
      • cacheClass

        public static org.apache.camel.spi.BeanIntrospection.ClassInfo cacheClass​(Class<?> clazz)
        Deprecated.
        Introspects the given class.
        Parameters:
        clazz - the class
        Returns:
        the introspection result as a BeanIntrospection.ClassInfo structure.
      • getOrElseProperty

        public static Object getOrElseProperty​(Object target,
                                               String propertyName,
                                               Object defaultValue)
        Deprecated.
      • getOrElseProperty

        public static Object getOrElseProperty​(Object target,
                                               String propertyName,
                                               Object defaultValue,
                                               boolean ignoreCase)
        Deprecated.
      • isPropertyIsGetter

        public static boolean isPropertyIsGetter​(Class<?> type,
                                                 String propertyName)
        Deprecated.
      • setProperty

        public static boolean setProperty​(org.apache.camel.CamelContext context,
                                          org.apache.camel.TypeConverter typeConverter,
                                          Object target,
                                          String name,
                                          Object value,
                                          String refName,
                                          boolean allowBuilderPattern)
                                   throws Exception
        Deprecated.
        This method supports three modes to set a property: 1. Setting a Map property where the property name refers to a map via name[aKey] where aKey is the map key to use. 2. Setting a property that has already been resolved, this is the case when context and refName are NULL and value is non-NULL. 3. Setting a property that has not yet been resolved, the property will be resolved based on the suitable methods found matching the property name on the target bean. For this mode to be triggered the parameters context and refName must NOT be NULL, and value MUST be NULL.
        Throws:
        Exception
      • setProperty

        public static boolean setProperty​(org.apache.camel.CamelContext context,
                                          org.apache.camel.TypeConverter typeConverter,
                                          Object target,
                                          String name,
                                          Object value,
                                          String refName,
                                          boolean allowBuilderPattern,
                                          boolean allowPrivateSetter,
                                          boolean ignoreCase)
                                   throws Exception
        Deprecated.
        This method supports three modes to set a property: 1. Setting a Map property where the property name refers to a map via name[aKey] where aKey is the map key to use. 2. Setting a property that has already been resolved, this is the case when context and refName are NULL and value is non-NULL. 3. Setting a property that has not yet been resolved, the property will be resolved based on the suitable methods found matching the property name on the target bean. For this mode to be triggered the parameters context and refName must NOT be NULL, and value MUST be NULL.
        Throws:
        Exception
      • setProperty

        public static boolean setProperty​(org.apache.camel.CamelContext context,
                                          Object target,
                                          String name,
                                          Object value)
                                   throws Exception
        Deprecated.
        Throws:
        Exception
      • setProperty

        public static boolean setProperty​(org.apache.camel.CamelContext context,
                                          org.apache.camel.TypeConverter typeConverter,
                                          Object target,
                                          String name,
                                          Object value)
                                   throws Exception
        Deprecated.
        Throws:
        Exception
      • setProperty

        public static boolean setProperty​(org.apache.camel.TypeConverter typeConverter,
                                          Object target,
                                          String name,
                                          Object value)
                                   throws Exception
        Deprecated.
        Throws:
        Exception
      • findSetterMethods

        public static Set<Method> findSetterMethods​(Class<?> clazz,
                                                    String name,
                                                    boolean allowBuilderPattern,
                                                    boolean allowPrivateSetter,
                                                    boolean ignoreCase)
        Deprecated.