Package org.dbunit.util.search
Class AbstractNodesFilterSearchCallback
java.lang.Object
org.dbunit.util.search.AbstractNodesFilterSearchCallback
- All Implemented Interfaces:
ISearchCallback
- Direct Known Subclasses:
AbstractExcludeNodesSearchCallback,AbstractIncludeNodesSearchCallback,AbstractMetaDataBasedSearchCallback
Super-class for ISearchCallback implementations that needs to filter which
nodes should be included or excluded from the search.
This class implements the
This class implements the
searchNode() based on its internal
mode, which could be ALLOW_MODE, DENY_MODE or
NO_MODE:
NO_MODEis the default mode and meanssearchNode()always return trueALLOW_MODEis set whensetAllowedNodes()is called and it meanssearchNode()will return true only if the node is contained on the Set (or array) passed tosetAllowedNodes()DENY_MODEis set whensetDeniedNodes()is called and it meanssearchNode()will return true only if the node is not contained on the Set (or array) passed tosetDeniedNodes()
- Since:
- Aug 25, 2005
- Version:
- $Revision$
- Author:
- Felipe Leme (dbunit@felipeal.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intOnly nodes set viasetAllowedNodes(Set)are allowed.protected static final intOnly nodes set viasetDeniedNodes(Set)are denied.protected final org.slf4j.LoggerLogger for this class.protected static final intNo nodes are allowed or denied;searchNode(Object)always returnstrue. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SetGet which modes are allowed/denied, depending on the operation mode.protected intGet the operation modevoidDo nothing...booleansearchNode(Object node) Decides if a node should be searched or notprotected voidsetAllowedNodes(Object[] filteredNodes) Set which modes are allowed on the search.protected voidsetAllowedNodes(Set filteredNodes) Set which modes are allowed on the search.protected voidsetDeniedNodes(Object[] filteredNodes) Set which modes are not allowed on the search.protected voidsetDeniedNodes(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, waitMethods inherited from interface org.dbunit.util.search.ISearchCallback
getEdges
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
NO_MODE
protected static final int NO_MODENo nodes are allowed or denied;searchNode(Object)always returnstrue.- See Also:
-
ALLOW_MODE
protected static final int ALLOW_MODEOnly nodes set viasetAllowedNodes(Set)are allowed.- See Also:
-
DENY_MODE
protected static final int DENY_MODEOnly nodes set viasetDeniedNodes(Set)are denied.- See Also:
-
-
Constructor Details
-
AbstractNodesFilterSearchCallback
public AbstractNodesFilterSearchCallback()Default constructor.
-
-
Method Details
-
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
Set which modes are allowed on the search.- Parameters:
filteredNodes- which modes are allowed on the search.
-
setAllowedNodes
Set which modes are allowed on the search.- Parameters:
filteredNodes- which modes are allowed on the search.
-
setDeniedNodes
Set which modes are not allowed on the search.- Parameters:
filteredNodes- which modes are not allowed on the search.
-
setDeniedNodes
Set which modes are not allowed on the search.- Parameters:
filteredNodes- which modes are not allowed on the search.
-
nodeAdded
Do nothing...- Specified by:
nodeAddedin interfaceISearchCallback- Parameters:
fromNode- node that has been added.- Throws:
SearchException- if the callback cannot process the added node.
-
searchNode
Description copied from interface:ISearchCallbackDecides if a node should be searched or not- Specified by:
searchNodein interfaceISearchCallback- Parameters:
node- node to be filtered- Returns:
- true if the node should be searched
- Throws:
SearchException- if the callback cannot decide whether the node should be searched.
-