Class AbstractNodesFilterSearchCallback

java.lang.Object
org.dbunit.util.search.AbstractNodesFilterSearchCallback
All Implemented Interfaces:
ISearchCallback
Direct Known Subclasses:
AbstractExcludeNodesSearchCallback, AbstractIncludeNodesSearchCallback, AbstractMetaDataBasedSearchCallback

public abstract class AbstractNodesFilterSearchCallback extends Object implements ISearchCallback
Super-class for ISearchCallback implementations that needs to filter which nodes should be included or excluded from the search.
This class implements the searchNode() based on its internal mode, which could be ALLOW_MODE, DENY_MODE or NO_MODE:
  • NO_MODE is the default mode and means searchNode() always return true
  • ALLOW_MODE is set when setAllowedNodes() is called and it means searchNode() will return true only if the node is contained on the Set (or array) passed to setAllowedNodes()
  • DENY_MODE is set when setDeniedNodes() is called and it means searchNode() will return true only if the node is not contained on the Set (or array) passed to setDeniedNodes()
Since:
Aug 25, 2005
Version:
$Revision$
Author:
Felipe Leme (dbunit@felipeal.net)
  • Field Details

  • Constructor Details

    • AbstractNodesFilterSearchCallback

      public AbstractNodesFilterSearchCallback()
      Default constructor.
  • Method Details

    • getFilteredNodes

      protected Set getFilteredNodes()
      Get which modes are allowed/denied, depending on the operation mode.
      Returns:
      which modes are allowed/denied, depending on the operation mode.
    • getFilteringMode

      protected int getFilteringMode()
      Get the operation mode
      Returns:
      operation mode
    • setAllowedNodes

      protected void setAllowedNodes(Set filteredNodes)
      Set which modes are allowed on the search.
      Parameters:
      filteredNodes - which modes are allowed on the search.
    • setAllowedNodes

      protected void setAllowedNodes(Object[] filteredNodes)
      Set which modes are allowed on the search.
      Parameters:
      filteredNodes - which modes are allowed on the search.
    • setDeniedNodes

      protected void setDeniedNodes(Set filteredNodes)
      Set which modes are not allowed on the search.
      Parameters:
      filteredNodes - which modes are not allowed on the search.
    • setDeniedNodes

      protected void setDeniedNodes(Object[] filteredNodes)
      Set which modes are not allowed on the search.
      Parameters:
      filteredNodes - which modes are not allowed on the search.
    • nodeAdded

      public void nodeAdded(Object fromNode) throws SearchException
      Do nothing...
      Specified by:
      nodeAdded in interface ISearchCallback
      Parameters:
      fromNode - node that has been added.
      Throws:
      SearchException
    • searchNode

      public boolean searchNode(Object node) throws SearchException
      Description copied from interface: ISearchCallback
      Decides if a node should be searched or not
      Specified by:
      searchNode in interface ISearchCallback
      Parameters:
      node - node to be filtered
      Returns:
      true if the node should be searched
      Throws:
      SearchException