final class PropertyUtils extends Object implements AutoCloseable
Delegates to PropertyUtilsBean from Apache Commons Beanutils; must be closed to release any internal caches.
This is inspired by org.apache.commons.beanutils.PropertyUtils, but only exposing the selected methods we use and to avoid allocating some objects which aren't necessary in our limited use cases; also bypasses the classloader scoped cache in favour of an explicit cache control on close, to keep things a bit lighter.
PropertyUtils,
PropertyUtilsBean| Constructor and Description |
|---|
PropertyUtils() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Clears all caches of PropertyUtilsBean and Introspector
|
Object |
getProperty(Object bean,
String name)
Return the value of the specified property of the specified bean,
no matter which property reference format is used, with no
type conversions.
|
PropertyDescriptor[] |
getPropertyDescriptors(Object bean)
Retrieve the property descriptors for the specified bean,
introspecting and caching them the first time a particular bean class
is encountered.
|
public Object getProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
Return the value of the specified property of the specified bean, no matter which property reference format is used, with no type conversions.
For more details see PropertyUtilsBean.
bean - Bean whose property is to be extractedname - Possibly indexed and/or nested name of the property
to be extractedIllegalAccessException - if the caller does not have
access to the property accessor methodIllegalArgumentException - if bean or
name is nullInvocationTargetException - if the property accessor method
throws an exceptionNoSuchMethodException - if an accessor method for this
property cannot be foundpublic PropertyDescriptor[] getPropertyDescriptors(Object bean)
Retrieve the property descriptors for the specified bean, introspecting and caching them the first time a particular bean class is encountered.
For more details see PropertyUtilsBean.
bean - Bean for which property descriptors are requestedIllegalArgumentException - if bean is nullpublic void close()
close in interface AutoCloseableIntrospector,
PropertyUtilsBeanCopyright © 2019 JBoss by Red Hat. All rights reserved.