public final class BeanFilter extends Object
Bean filters are used to control aspects of how beans are handled during serialization and parsing.
Bean filters are created by BeanFilterBuilder
which is the programmatic equivalent to the @Bean
annotation.
Modifier and Type | Method and Description |
---|---|
static <T> BeanFilterBuilder<T> |
create(Class<T> c)
Static creator.
|
Class<?> |
getBeanClass()
Returns the bean class that this filter applies to.
|
Class<?>[] |
getBeanDictionary()
Returns the bean dictionary defined on this bean.
|
Set<String> |
getBpi()
Returns the set and order of names of properties associated with a bean class.
|
Set<String> |
getBpro()
Returns the list of read-only properties on a bean.
|
Set<String> |
getBpwo()
Returns the list of write-only properties on a bean.
|
Set<String> |
getBpx()
Returns the list of properties to ignore on a bean.
|
Class<?> |
getInterfaceClass()
Returns the interface class associated with this class.
|
PropertyNamer |
getPropertyNamer()
Returns the
PropertyNamer associated with the bean to tailor the names of bean properties. |
Class<?> |
getStopClass()
Returns the stop class associated with this class.
|
String |
getTypeName()
Returns the dictionary name associated with this bean.
|
boolean |
isFluentSetters()
Returns
|
boolean |
isSortProperties()
Returns
|
Object |
readProperty(Object bean,
String name,
Object value)
Calls the
BeanInterceptor.readProperty(Object, String, Object) method on the registered property filters. |
Object |
writeProperty(Object bean,
String name,
Object value)
Calls the
BeanInterceptor.writeProperty(Object, String, Object) method on the registered property filters. |
public static <T> BeanFilterBuilder<T> create(Class<T> c)
T
- The class being filtered.c
- The class being filtered.public Class<?> getBeanClass()
public String getTypeName()
public Class<?>[] getBeanDictionary()
public Set<String> getBpi()
public Set<String> getBpx()
public Set<String> getBpro()
public Set<String> getBpwo()
public boolean isSortProperties()
This method is only used when the getBpi()
method returns
public boolean isFluentSetters()
public PropertyNamer getPropertyNamer()
PropertyNamer
associated with the bean to tailor the names of bean properties.public Class<?> getInterfaceClass()
public Class<?> getStopClass()
public Object readProperty(Object bean, String name, Object value)
BeanInterceptor.readProperty(Object, String, Object)
method on the registered property filters.bean
- The bean from which the property was read.name
- The property name.value
- The value just extracted from calling the bean getter.public Object writeProperty(Object bean, String name, Object value)
BeanInterceptor.writeProperty(Object, String, Object)
method on the registered property filters.bean
- The bean from which the property was read.name
- The property name.value
- The value just parsed.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.