Package org.apache.camel.support
Class IntrospectionSupport
- java.lang.Object
-
- org.apache.camel.support.IntrospectionSupport
-
@Deprecated public final class IntrospectionSupport extends Object
Deprecated.useBeanIntrospection
Helper for introspections of beans. Important: Its recommended to call thestop()
method whenCamelContext
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 thegetProperties(Object, java.util.Map, String)
method is being used. Also thecacheClass(Class)
method gives access to the introspect cache.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static org.apache.camel.spi.BeanIntrospection.ClassInfo
cacheClass(Class<?> clazz)
Deprecated.Introspects the given class.static void
clearCache()
Deprecated.Clears the introspection cache.static Map<String,Object>
extractProperties(Map<String,Object> properties, String optionPrefix)
Deprecated.usePropertiesHelper
static Map<String,Object>
extractProperties(Map<String,Object> properties, String optionPrefix, boolean remove)
Deprecated.usePropertiesHelper
static Map<String,String>
extractStringProperties(Map<String,Object> properties)
Deprecated.usePropertiesHelper
static Set<Method>
findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase)
Deprecated.static long
getCacheCounter()
Deprecated.static String
getGetterShorthandName(Method method)
Deprecated.static Map<String,Object>
getNonNullProperties(Object target)
Deprecated.Will inspect the target for properties.static Object
getOrElseProperty(Object target, String propertyName, Object defaultValue)
Deprecated.static Object
getOrElseProperty(Object target, String propertyName, Object defaultValue, boolean ignoreCase)
Deprecated.static boolean
getProperties(Object target, Map<String,Object> properties, String optionPrefix)
Deprecated.Will inspect the target for properties.static boolean
getProperties(Object target, Map<String,Object> properties, String optionPrefix, boolean includeNull)
Deprecated.Will inspect the target for properties.static Object
getProperty(Object target, String propertyName)
Deprecated.static Method
getPropertyGetter(Class<?> type, String propertyName)
Deprecated.static Method
getPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase)
Deprecated.static Method
getPropertySetter(Class<?> type, String propertyName)
Deprecated.static String
getSetterShorthandName(Method method)
Deprecated.static boolean
hasProperties(Map<String,Object> properties, String optionPrefix)
Deprecated.usePropertiesHelper
static boolean
isGetter(Method method)
Deprecated.static boolean
isPropertyIsGetter(Class<?> type, String propertyName)
Deprecated.static boolean
isSetter(Method method)
Deprecated.static boolean
isSetter(Method method, boolean allowBuilderPattern)
Deprecated.static boolean
setProperties(Object target, Map<String,Object> properties)
Deprecated.static boolean
setProperties(Object target, Map<String,Object> properties, String optionPrefix)
Deprecated.static boolean
setProperties(Object target, Map<String,Object> properties, String optionPrefix, boolean allowBuilderPattern)
Deprecated.static boolean
setProperties(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties)
Deprecated.static boolean
setProperties(org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties)
Deprecated.static boolean
setProperty(Object target, String name, Object value)
Deprecated.static boolean
setProperty(Object target, String name, Object value, boolean allowBuilderPattern)
Deprecated.static boolean
setProperty(org.apache.camel.CamelContext context, Object target, String name, Object value)
Deprecated.static boolean
setProperty(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value)
Deprecated.static boolean
setProperty(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value, String refName, boolean allowBuilderPattern)
Deprecated.This method supports three modes to set a property: 1.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)
Deprecated.This method supports three modes to set a property: 1.static boolean
setProperty(org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value)
Deprecated.static void
stop()
Deprecated.CamelContext
should call this stop method when its stopping.
-
-
-
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.
-
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 beanproperties
- the map to fill in found propertiesoptionPrefix
- 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 beanproperties
- the map to fill in found propertiesoptionPrefix
- an optional prefix to append the property keyincludeNull
- 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.
-
hasProperties
@Deprecated public static boolean hasProperties(Map<String,Object> properties, String optionPrefix)
Deprecated.usePropertiesHelper
-
getProperty
public static Object getProperty(Object target, String propertyName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
Deprecated.
-
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.
-
getPropertyGetter
public static Method getPropertyGetter(Class<?> type, String propertyName) throws NoSuchMethodException
Deprecated.- Throws:
NoSuchMethodException
-
getPropertyGetter
public static Method getPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase) throws NoSuchMethodException
Deprecated.- Throws:
NoSuchMethodException
-
getPropertySetter
public static Method getPropertySetter(Class<?> type, String propertyName) throws NoSuchMethodException
Deprecated.- Throws:
NoSuchMethodException
-
isPropertyIsGetter
public static boolean isPropertyIsGetter(Class<?> type, String propertyName)
Deprecated.
-
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String,Object> properties, String optionPrefix, boolean allowBuilderPattern) throws Exception
Deprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String,Object> properties, String optionPrefix) throws Exception
Deprecated.- Throws:
Exception
-
extractProperties
@Deprecated public static Map<String,Object> extractProperties(Map<String,Object> properties, String optionPrefix)
Deprecated.usePropertiesHelper
-
extractProperties
@Deprecated public static Map<String,Object> extractProperties(Map<String,Object> properties, String optionPrefix, boolean remove)
Deprecated.usePropertiesHelper
-
extractStringProperties
@Deprecated public static Map<String,String> extractStringProperties(Map<String,Object> properties)
Deprecated.usePropertiesHelper
-
setProperties
@Deprecated public static boolean setProperties(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties) throws Exception
Deprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties) throws Exception
Deprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String,Object> properties) 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, 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 whencontext
andrefName
are NULL andvalue
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 thetarget
bean. For this mode to be triggered the parameterscontext
andrefName
must NOT be NULL, andvalue
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 whencontext
andrefName
are NULL andvalue
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 thetarget
bean. For this mode to be triggered the parameterscontext
andrefName
must NOT be NULL, andvalue
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
-
setProperty
@Deprecated public static boolean setProperty(Object target, String name, Object value, boolean allowBuilderPattern) throws Exception
Deprecated.- Throws:
Exception
-
setProperty
@Deprecated public static boolean setProperty(Object target, String name, Object value) throws Exception
Deprecated.- Throws:
Exception
-
-