org.apache.camel.util
Class IntrospectionSupport
java.lang.Object
org.apache.camel.util.IntrospectionSupport
public final class IntrospectionSupport
- extends Object
Helper for introspections of beans.
Method Summary |
static Map<String,Object> |
extractProperties(Map<String,Object> properties,
String optionPrefix)
|
static String |
getGetterShorthandName(Method method)
|
static boolean |
getProperties(Object target,
Map<String,Object> properties,
String optionPrefix)
Will inspect the target for properties. |
static Object |
getProperty(Object target,
String property)
|
static Method |
getPropertyGetter(Class<?> type,
String propertyName)
|
static Method |
getPropertySetter(Class<?> type,
String propertyName)
|
static String |
getSetterShorthandName(Method method)
|
static boolean |
hasProperties(Map<String,Object> properties,
String optionPrefix)
|
static boolean |
hasSetter(Object target,
Method getter)
|
static boolean |
isGetter(Method method)
|
static boolean |
isPropertyIsGetter(Class<?> type,
String propertyName)
|
static boolean |
isSetter(Method method)
|
static boolean |
isSetter(Method method,
boolean allowBuilderPattern)
|
static boolean |
setProperties(Object target,
Map<String,Object> properties)
|
static boolean |
setProperties(Object target,
Map<String,Object> properties,
String optionPrefix)
|
static boolean |
setProperties(Object target,
Map<String,Object> properties,
String optionPrefix,
boolean allowBuilderPattern)
|
static boolean |
setProperties(TypeConverter typeConverter,
Object target,
Map<String,Object> properties)
|
static boolean |
setProperty(Object target,
String name,
Object value)
|
static boolean |
setProperty(Object target,
String name,
Object value,
boolean allowBuilderPattern)
|
static boolean |
setProperty(TypeConverter typeConverter,
Object target,
String name,
Object value)
|
static boolean |
setProperty(TypeConverter typeConverter,
Object target,
String name,
Object value,
boolean allowBuilderPattern)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isGetter
public static boolean isGetter(Method method)
getGetterShorthandName
public static String getGetterShorthandName(Method method)
getSetterShorthandName
public static String getSetterShorthandName(Method method)
isSetter
public static boolean isSetter(Method method,
boolean allowBuilderPattern)
isSetter
public static boolean isSetter(Method method)
getProperties
public static boolean getProperties(Object target,
Map<String,Object> properties,
String optionPrefix)
- 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 key
- Returns:
- true if any properties was found, false otherwise.
hasSetter
public static boolean hasSetter(Object target,
Method getter)
hasProperties
public static boolean hasProperties(Map<String,Object> properties,
String optionPrefix)
getProperty
public static Object getProperty(Object target,
String property)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException
- Throws:
NoSuchMethodException
IllegalAccessException
InvocationTargetException
getPropertyGetter
public static Method getPropertyGetter(Class<?> type,
String propertyName)
throws NoSuchMethodException
- Throws:
NoSuchMethodException
getPropertySetter
public static Method getPropertySetter(Class<?> type,
String propertyName)
throws NoSuchMethodException
- Throws:
NoSuchMethodException
isPropertyIsGetter
public static boolean isPropertyIsGetter(Class<?> type,
String propertyName)
setProperties
public static boolean setProperties(Object target,
Map<String,Object> properties,
String optionPrefix,
boolean allowBuilderPattern)
throws Exception
- Throws:
Exception
setProperties
public static boolean setProperties(Object target,
Map<String,Object> properties,
String optionPrefix)
throws Exception
- Throws:
Exception
extractProperties
public static Map<String,Object> extractProperties(Map<String,Object> properties,
String optionPrefix)
setProperties
public static boolean setProperties(TypeConverter typeConverter,
Object target,
Map<String,Object> properties)
throws Exception
- Throws:
Exception
setProperties
public static boolean setProperties(Object target,
Map<String,Object> properties)
throws Exception
- Throws:
Exception
setProperty
public static boolean setProperty(TypeConverter typeConverter,
Object target,
String name,
Object value,
boolean allowBuilderPattern)
throws Exception
- Throws:
Exception
setProperty
public static boolean setProperty(TypeConverter typeConverter,
Object target,
String name,
Object value)
throws Exception
- Throws:
Exception
setProperty
public static boolean setProperty(Object target,
String name,
Object value,
boolean allowBuilderPattern)
throws Exception
- Throws:
Exception
setProperty
public static boolean setProperty(Object target,
String name,
Object value)
throws Exception
- Throws:
Exception
Apache CAMEL