public final class IntrospectionHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addBeanListener(Object bean,
Class<?> listenerType,
Object listener)
Registers with
bean a listener of a given type. |
static boolean |
beanHasProperty(Object bean,
String property)
Checks if a bean has a particular property.
|
static boolean |
beanHasReadableProperty(Object bean,
String property)
Checks if a bean has a particular property, and it is readable.
|
static boolean |
beanHasWritableProperty(Object bean,
String property)
Checks if a bean has a particular property, and it is writable.
|
static EventListener[] |
getBeanListeners(Object bean,
Class<?> listenerType) |
static Object |
getBeanProperty(Object bean,
PropertyDescriptor pd) |
static Object |
getBeanProperty(Object bean,
String property)
Returns the value of a bean's property.
|
static PropertyEditor |
getEditor(Class<?> clazz) |
static boolean |
isReadableProperty(PropertyDescriptor pd)
Tests if a property is readable.
|
static boolean |
isWritableProperty(PropertyDescriptor pd)
Tests if a property is writable.
|
static boolean |
providesEventSet(Object bean,
Class<?> listener)
Returns true if
bean can register the given type of
listener. |
static void |
rememberBeanInfo(BeanInfo bi) |
static void |
rememberBeanInfo(Class<?> type) |
static boolean |
removeBeanListener(Object bean,
Class<?> listenerType,
Object listener)
Unregisters with
bean a listener of a given type. |
static void |
setBeanProperty(Object bean,
PropertyDescriptor pd,
Object value) |
static void |
setBeanProperty(Object bean,
String property,
Object value)
Sets the value of a bean's property.
|
static String |
translateClassName(Class<?> c) |
static String |
translateClassName(String s) |
public static boolean beanHasProperty(Object bean, String property)
bean - The bean to check.property - The name of the property to check for.true if a bean has a particular property.public static boolean isReadableProperty(PropertyDescriptor pd)
pd - A PropertyDescriptor describing the property.true if it is readable.public static boolean beanHasReadableProperty(Object bean, String property)
bean - The bean to check.property - The name of the property to check for.true if the bean has the given property, and it is
readable.public static boolean isWritableProperty(PropertyDescriptor pd)
pd - A PropertyDescriptor describing the property.true if it is writable.public static boolean beanHasWritableProperty(Object bean, String property)
bean - The bean to check.property - The name of the property to check for.true if the bean has the given property, and it is
readable.public static Object getBeanProperty(Object bean, PropertyDescriptor pd)
public static Object getBeanProperty(Object bean, String property)
bean - The bean to use.property - The name of the property to get.public static void setBeanProperty(Object bean, PropertyDescriptor pd, Object value)
public static void setBeanProperty(Object bean, String property, Object value)
bean - The bean to use.property - The name of the property to set.value - The value to set the property to.public static boolean providesEventSet(Object bean, Class<?> listener)
bean can register the given type of
listener.bean - The bean to register with.listener - The type of listener to check bean for.public static boolean addBeanListener(Object bean, Class<?> listenerType, Object listener)
bean a listener of a given type.bean - The bean to register with.listenerType - The type of listener to be registered with
bean.listener - The listener to register with bean.public static boolean removeBeanListener(Object bean, Class<?> listenerType, Object listener)
bean a listener of a given type.bean - The bean to unregister with.listenerType - The type of listener to be unregistered with
bean.listener - The listener to unregister with bean.public static EventListener[] getBeanListeners(Object bean, Class<?> listenerType)
public static void rememberBeanInfo(BeanInfo bi)
public static void rememberBeanInfo(Class<?> type)
public static PropertyEditor getEditor(Class<?> clazz)
Copyright © 2003–2016 Community Z Tools Project. All rights reserved.