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 ConfigurationNodeVisitor
interface.
Derived classes only need to override the methods they really need.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns a flag whether the current visit process should be aborted.void
visitAfterChildren
(T node, NodeHandler<T> handler) Visits the specified node after after its children - if existing - have been processed.void
visitBeforeChildren
(T node, NodeHandler<T> handler) Visits the specified node before the children of this node - if existing - are processed.
-
Constructor Details
-
ConfigurationNodeVisitorAdapter
public ConfigurationNodeVisitorAdapter()
-
-
Method Details
-
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:
terminate
in interfaceConfigurationNodeVisitor<T>
- Returns:
- a flag if the visit process should be stopped
-
visitAfterChildren
Visits the specified node after after its children - if existing - have been processed. Empty dummy implementation of this interface method.- Specified by:
visitAfterChildren
in interfaceConfigurationNodeVisitor<T>
- Parameters:
node
- the node to be visitedhandler
- theNodeHandler
-
visitBeforeChildren
Visits the specified node before the children of this node - if existing - are processed. Empty dummy implementation of this interface method.- Specified by:
visitBeforeChildren
in interfaceConfigurationNodeVisitor<T>
- Parameters:
node
- the node to be visitedhandler
- theNodeHandler
-