Package org.apache.commons.beanutils2
Class SuppressPropertiesBeanIntrospector
java.lang.Object
org.apache.commons.beanutils2.SuppressPropertiesBeanIntrospector
- All Implemented Interfaces:
- BeanIntrospector
 A specialized BeanIntrospector implementation which suppresses some properties.
 
 An instance of this class is passed a set with the names of the properties it should process. During introspection of a bean class it removes all these
 properties from the IntrospectionContext. So effectively, properties added by a different BeanIntrospector are removed again.
 
- Since:
- 1.9.2
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final SuppressPropertiesBeanIntrospectorA specialized instance which is configured to suppress the specialclassproperties of Java beans.static final SuppressPropertiesBeanIntrospectorA specialized instance which is configured to suppress the specialclassproperties of Java beans.
- 
Constructor SummaryConstructorsConstructorDescriptionSuppressPropertiesBeanIntrospector(Collection<String> propertiesToSuppress) Creates a new instance ofSuppressPropertiesBeanIntrospectorand sets the names of the properties to be suppressed.
- 
Method SummaryModifier and TypeMethodDescriptionReturns a (unmodifiable) set with the names of the properties which are suppressed by thisBeanIntrospector.voidintrospect(IntrospectionContext icontext) Performs introspection on a Java class.
- 
Field Details- 
SUPPRESS_CLASSA specialized instance which is configured to suppress the specialclassproperties of Java beans. Unintended access to the propertyclass(which is common to all Java objects) can be a security risk because it also allows access to the class loader. Adding this instance asBeanIntrospectorto an instance ofPropertyUtilsBeansuppresses theclassproperty; it can then no longer be accessed.
- 
SUPPRESS_DECLARING_CLASSA specialized instance which is configured to suppress the specialclassproperties of Java beans. Unintended access to the call fordeclaringClass(which is common to all Javaenum) can be a security risk because it also allows access to the class loader. Adding this instance asBeanIntrospectorto an instance ofPropertyUtilsBeansuppresses theclassproperty; it can then no longer be accessed.- Since:
- 2.0.0-M2
 
 
- 
- 
Constructor Details- 
SuppressPropertiesBeanIntrospectorCreates a new instance ofSuppressPropertiesBeanIntrospectorand sets the names of the properties to be suppressed.- Parameters:
- propertiesToSuppress- the names of the properties to be suppressed (must not be null)
- Throws:
- IllegalArgumentException- if the collection with property names is null
 
 
- 
- 
Method Details- 
getSuppressedPropertiesReturns a (unmodifiable) set with the names of the properties which are suppressed by thisBeanIntrospector.- Returns:
- a set with the names of the suppressed properties
 
- 
introspectPerforms introspection on a Java class. The current class to be inspected can be queried from the passed inIntrospectionContextobject. A typical implementation has to obtain this class, determine its properties according to the rules it implements, and add them to the passed in context object. This implementation removes all properties from the given context it is configured for.- Specified by:
- introspectin interface- BeanIntrospector
- Parameters:
- icontext- the context object for interaction with the initiator of the introspection request
- Throws:
- IntrospectionException- if an error occurs during introspection
 
 
-