Java BeanUtils - Suppressing Properties


You can suppress the specific properties by using the bean introspection mechanism. The specialized BeanIntrospector interface is implemented by the type called SuppressPropertiesBeanIntrospector which suppresses the special class properties of Java beans. The collection of property names need to be provided which are not accessible on the beans while creating an instance. If these properties are identified by the other BeanIntrospector, then they will be removed while bean class processing.

You can use a special class property for suppressing the properties for all beans which is genearted from getClass() method and inherited from Object and uses naming pattern for property get methods. In most of situations, an instance of SuppressPropertiesBeanIntrospector can be used to suppress the specific properties and can be achieved by using the SUPPRESS_CLASS constant of SuppressPropertiesBeanIntrospector.

Kickstart Your Career

Get certified by completing the course

Get Started