@SuppressWarnings("rawtypes") public class ClassPropertyFetcher extends Object
Reads the properties of a class in an optimized manner avoiding exceptions.
| Modifiers | Name | Description |
|---|---|---|
static Set<String> |
EXCLUDED_PROPERTIES |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected void |
addBeanProperty(List<PropertyDescriptor> propertyDescriptors, MetaProperty property) |
|
public static void |
clearCache()
|
|
public static PropertyDescriptor |
createPropertyDescriptor(Class declaringClass, MetaProperty property)Creates a PropertyDescriptor from a MetaBeanProperty |
|
public static ClassPropertyFetcher |
forClass(Class c) |
|
public Field |
getDeclaredField(String name) |
|
public static Object |
getInstancePropertyValue(Object instance, String name) |
|
public Class |
getJavaClass()
|
|
public List<MetaProperty> |
getMetaProperties()
|
|
public List<PropertyDescriptor> |
getPropertiesAssignableFromType(Class assignableType) |
|
public List<PropertyDescriptor> |
getPropertiesAssignableToType(Class assignableType) |
|
public List<PropertyDescriptor> |
getPropertiesOfType(Class javaClass) |
|
public PropertyDescriptor |
getPropertyDescriptor(String name) |
|
public PropertyDescriptor[] |
getPropertyDescriptors()
|
|
public Class |
getPropertyType(String name) |
|
public Class |
getPropertyType(String name, boolean onlyInstanceProperties) |
|
public static Class<?> |
getPropertyType(Class<?> cls, String propertyName) |
|
public Object |
getPropertyValue(String name) |
|
public Object |
getPropertyValue(Object instance, String name) |
<T> |
public T |
getPropertyValue(String name, Class<T> c) |
|
public Object |
getReference()
|
<T> |
public T |
getStaticPropertyValue(String name, Class<T> c) |
<T> |
public static T |
getStaticPropertyValue(Class clazz, String name, Class<T> requiredType) |
<T> |
public List<T> |
getStaticPropertyValuesFromInheritanceHierarchy(String name, Class<T> c)Get the list of property values for this static property from the whole inheritance hierarchy, starting from the most derived version of the property ending with the base class. |
<T> |
public static List<T> |
getStaticPropertyValuesFromInheritanceHierarchy(Class theClass, String name, Class<T> requiredTyped)Get the list of property values for this static property from the whole inheritance hierarchy, starting from the most derived version of the property ending with the base class. |
|
public boolean |
isReadableProperty(String name) |
Creates a PropertyDescriptor from a MetaBeanProperty
property - The bean property
Get the list of property values for this static property from the whole inheritance hierarchy, starting from the most derived version of the property ending with the base class. There are entries for each extant version of the property in turn, so if you have a 10-deep inheritance hierarchy, you may get 0+ values returned, one per class in the hierarchy that has the property declared (and of the correct type).
name - Name of the property.c - Required type of the property (including derived types)T - Required type of the property.Get the list of property values for this static property from the whole inheritance hierarchy, starting from the most derived version of the property ending with the base class. There are entries for each extant version of the property in turn, so if you have a 10-deep inheritance hierarchy, you may get 0+ values returned, one per class in the hierarchy that has the property declared (and of the correct type).
name - Name of the property.requiredTyped - Required type of the property (including derived types)T - Required type of the property.