Package org.apache.camel.support
Class IntrospectionSupport
- java.lang.Object
-
- org.apache.camel.support.IntrospectionSupport
-
@Deprecated public final class IntrospectionSupport extends Object
Deprecated.useBeanIntrospectionHelper for introspections of beans. Important: Its recommended to call thestop()method whenCamelContextis 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.ClassInfocacheClass(Class<?> clazz)Deprecated.Introspects the given class.static voidclearCache()Deprecated.Clears the introspection cache.static Map<String,Object>extractProperties(Map<String,Object> properties, String optionPrefix)Deprecated.usePropertiesHelperstatic Map<String,Object>extractProperties(Map<String,Object> properties, String optionPrefix, boolean remove)Deprecated.usePropertiesHelperstatic Map<String,String>extractStringProperties(Map<String,Object> properties)Deprecated.usePropertiesHelperstatic Set<Method>findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase)Deprecated.static longgetCacheCounter()Deprecated.static StringgetGetterShorthandName(Method method)Deprecated.static Map<String,Object>getNonNullProperties(Object target)Deprecated.Will inspect the target for properties.static ObjectgetOrElseProperty(Object target, String propertyName, Object defaultValue)Deprecated.static ObjectgetOrElseProperty(Object target, String propertyName, Object defaultValue, boolean ignoreCase)Deprecated.static booleangetProperties(Object target, Map<String,Object> properties, String optionPrefix)Deprecated.Will inspect the target for properties.static booleangetProperties(Object target, Map<String,Object> properties, String optionPrefix, boolean includeNull)Deprecated.Will inspect the target for properties.static ObjectgetProperty(Object target, String propertyName)Deprecated.static MethodgetPropertyGetter(Class<?> type, String propertyName)Deprecated.static MethodgetPropertyGetter(Class<?> type, String propertyName, boolean ignoreCase)Deprecated.static MethodgetPropertySetter(Class<?> type, String propertyName)Deprecated.static StringgetSetterShorthandName(Method method)Deprecated.static booleanhasProperties(Map<String,Object> properties, String optionPrefix)Deprecated.usePropertiesHelperstatic booleanisGetter(Method method)Deprecated.static booleanisPropertyIsGetter(Class<?> type, String propertyName)Deprecated.static booleanisSetter(Method method)Deprecated.static booleanisSetter(Method method, boolean allowBuilderPattern)Deprecated.static booleansetProperties(Object target, Map<String,Object> properties)Deprecated.static booleansetProperties(Object target, Map<String,Object> properties, String optionPrefix)Deprecated.static booleansetProperties(Object target, Map<String,Object> properties, String optionPrefix, boolean allowBuilderPattern)Deprecated.static booleansetProperties(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties)Deprecated.static booleansetProperties(org.apache.camel.TypeConverter typeConverter, Object target, Map<String,Object> properties)Deprecated.static booleansetProperty(Object target, String name, Object value)Deprecated.static booleansetProperty(Object target, String name, Object value, boolean allowBuilderPattern)Deprecated.static booleansetProperty(org.apache.camel.CamelContext context, Object target, String name, Object value)Deprecated.static booleansetProperty(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value)Deprecated.static booleansetProperty(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 booleansetProperty(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 booleansetProperty(org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value)Deprecated.static voidstop()Deprecated.CamelContextshould call this stop method when its stopping.
-
-
-
Method Detail
-
stop
public static void stop()
Deprecated.CamelContextshould 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.ClassInfostructure.
-
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 ExceptionDeprecated.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 whencontextandrefNameare NULL andvalueis 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 thetargetbean. For this mode to be triggered the parameterscontextandrefNamemust NOT be NULL, andvalueMUST 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 ExceptionDeprecated.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 whencontextandrefNameare NULL andvalueis 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 thetargetbean. For this mode to be triggered the parameterscontextandrefNamemust NOT be NULL, andvalueMUST be NULL.- Throws:
Exception
-
setProperty
public static boolean setProperty(org.apache.camel.CamelContext context, Object target, String name, Object value) throws ExceptionDeprecated.- Throws:
Exception
-
setProperty
public static boolean setProperty(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value) throws ExceptionDeprecated.- Throws:
Exception
-
setProperty
public static boolean setProperty(org.apache.camel.TypeConverter typeConverter, Object target, String name, Object value) throws ExceptionDeprecated.- 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
-
-