org.dbunit.util.search
Class AbstractNodesFilterSearchCallback

java.lang.Object
  extended by 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:

Since:
Aug 25, 2005
Version:
$Revision: 769 $
Author:
Felipe Leme (dbunit@felipeal.net)

Field Summary
protected static int ALLOW_MODE
           
protected static int DENY_MODE
           
protected  org.slf4j.Logger logger
           
protected static int NO_MODE
           
 
Constructor Summary
AbstractNodesFilterSearchCallback()
          Default constructor.
 
Method Summary
protected  Set getFilteredNodes()
          Get which modes are allowed/denied, depending on the operation mode.
protected  int getFilteringMode()
          Get the operation mode
 void nodeAdded(Object fromNode)
          Do nothing...
 boolean searchNode(Object node)
          Decides if a node should be searched or not
protected  void setAllowedNodes(Object[] filteredNodes)
          Set which modes are allowed on the search.
protected  void setAllowedNodes(Set filteredNodes)
          Set which modes are allowed on the search.
protected  void setDeniedNodes(Object[] filteredNodes)
          Set which modes are not allowed on the search.
protected  void setDeniedNodes(Set filteredNodes)
          Set which modes are not allowed on the search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dbunit.util.search.ISearchCallback
getEdges
 

Field Detail

logger

protected final org.slf4j.Logger logger

NO_MODE

protected static final int NO_MODE
See Also:
Constant Field Values

ALLOW_MODE

protected static final int ALLOW_MODE
See Also:
Constant Field Values

DENY_MODE

protected static final int DENY_MODE
See Also:
Constant Field Values
Constructor Detail

AbstractNodesFilterSearchCallback

public AbstractNodesFilterSearchCallback()
Default constructor.

Method Detail

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


Copyright © 2002-2012. All Rights Reserved.