Package org.apache.camel.support
Class IntrospectionSupport
java.lang.Object
org.apache.camel.support.IntrospectionSupport
Deprecated.
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 Summary
Modifier and TypeMethodDescriptionstatic org.apache.camel.spi.BeanIntrospection.ClassInfocacheClass(Class<?> clazz) Deprecated.Introspects the given class.static voidDeprecated.Clears the introspection cache.extractProperties(Map<String, Object> properties, String optionPrefix) Deprecated.usePropertiesHelperextractProperties(Map<String, Object> properties, String optionPrefix, boolean remove) Deprecated.usePropertiesHelperextractStringProperties(Map<String, Object> properties) Deprecated.usePropertiesHelperfindSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) Deprecated.static longDeprecated.static StringgetGetterShorthandName(Method method) Deprecated.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 booleanDeprecated.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 booleanDeprecated.static booleanisPropertyIsGetter(Class<?> type, String propertyName) Deprecated.static booleanDeprecated.static booleanDeprecated.static booleansetProperties(Object target, Map<String, Object> properties) Deprecated.static booleanDeprecated.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 Details
-
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
Deprecated. -
getGetterShorthandName
Deprecated. -
getSetterShorthandName
Deprecated. -
isSetter
Deprecated. -
isSetter
Deprecated. -
getNonNullProperties
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
Deprecated.Introspects the given class.- Parameters:
clazz- the class- Returns:
- the introspection result as a
BeanIntrospection.ClassInfostructure.
-
hasProperties
Deprecated.usePropertiesHelper -
getProperty
public static Object getProperty(Object target, String propertyName) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException Deprecated. -
getOrElseProperty
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
Deprecated. -
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix, boolean allowBuilderPattern) throws ExceptionDeprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String, Object> properties, String optionPrefix) throws ExceptionDeprecated.- 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.usePropertiesHelper -
setProperties
@Deprecated public static boolean setProperties(org.apache.camel.CamelContext context, org.apache.camel.TypeConverter typeConverter, Object target, Map<String, Object> properties) throws ExceptionDeprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(org.apache.camel.TypeConverter typeConverter, Object target, Map<String, Object> properties) throws ExceptionDeprecated.- Throws:
Exception
-
setProperties
@Deprecated public static boolean setProperties(Object target, Map<String, Object> properties) 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, 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 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 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 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 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
-
findSetterMethods
public static Set<Method> findSetterMethods(Class<?> clazz, String name, boolean allowBuilderPattern, boolean allowPrivateSetter, boolean ignoreCase) Deprecated.
-
BeanIntrospection