Class ConfigurationNodeVisitorAdapter<T>
- java.lang.Object
-
- org.apache.commons.configuration2.tree.ConfigurationNodeVisitorAdapter<T>
-
- Type Parameters:
T- the type of the nodes processed by this visitor
- All Implemented Interfaces:
ConfigurationNodeVisitor<T>
- Direct Known Subclasses:
BaseHierarchicalConfiguration.BuilderVisitor
public class ConfigurationNodeVisitorAdapter<T> extends Object implements ConfigurationNodeVisitor<T>
A simple adapter class that simplifies writing custom node visitor implementations.
This class provides dummy implementations for the methods defined in the
ConfigurationNodeVisitorinterface. Derived classes only need to override the methods they really need.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationNodeVisitorAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanterminate()Returns a flag whether the current visit process should be aborted.voidvisitAfterChildren(T node, NodeHandler<T> handler)Visits the specified node after after its children - if existing - have been processed.voidvisitBeforeChildren(T node, NodeHandler<T> handler)Visits the specified node before the children of this node - if existing - are processed.
-
-
-
Constructor Detail
-
ConfigurationNodeVisitorAdapter
public ConfigurationNodeVisitorAdapter()
-
-
Method Detail
-
visitBeforeChildren
public void visitBeforeChildren(T node, NodeHandler<T> handler)
Visits the specified node before the children of this node - if existing - are processed. Empty dummy implementation of this interface method.- Specified by:
visitBeforeChildrenin interfaceConfigurationNodeVisitor<T>- Parameters:
node- the node to be visitedhandler- theNodeHandler
-
visitAfterChildren
public void visitAfterChildren(T node, NodeHandler<T> handler)
Visits the specified node after after its children - if existing - have been processed. Empty dummy implementation of this interface method.- Specified by:
visitAfterChildrenin interfaceConfigurationNodeVisitor<T>- Parameters:
node- the node to be visitedhandler- theNodeHandler
-
terminate
public boolean terminate()
Returns a flag whether the current visit process should be aborted. This method allows a visitor implementation to state that it does not need any further data. It may be used e.g. by visitors that search for a certain node in the hierarchy. After that node was found, there is no need to process the remaining nodes, too. This method is called after each visited node. A result of true indicates that the current iteration is to be aborted. This implementation returns always false; this means that all nodes in the current hierarchy are traversed.- Specified by:
terminatein interfaceConfigurationNodeVisitor<T>- Returns:
- a flag if the visit process should be stopped
-
-