Class KeepPropertiesBeanFilter

java.lang.Object
com.isomorphic.js.KeepPropertiesBeanFilter
All Implemented Interfaces:
IBeanFilter, com.isomorphic.js.IContextBeanFilter

public class KeepPropertiesBeanFilter extends Object implements com.isomorphic.js.IContextBeanFilter
A simple IBeanFilter for use with the JSONFilter that filters beans based on a simple property list.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    List of properties to keep.
  • Method Summary

    Modifier and Type
    Method
    Description
    This method is called to filter a bean (IBeanFilter Interface).
  • Constructor Details

    • KeepPropertiesBeanFilter

      public KeepPropertiesBeanFilter(Collection propsToKeep)
      List of properties to keep. Any properties occurring in the bean that are not listed here will be discarded by this filter.
  • Method Details

    • filter

      public Map filter(Object obj) throws Exception
      This method is called to filter a bean (IBeanFilter Interface). Returns the bean as filtered through the propsToKeep list.
      Specified by:
      filter in interface IBeanFilter
      Parameters:
      obj - the bean to convert
      Returns:
      the converted bean as a Map
      Throws:
      Exception