Class AbstractHierarchicalConfiguration.DefinedKeysVisitor
- java.lang.Object
-
- org.apache.commons.configuration2.tree.ConfigurationNodeVisitorAdapter<T>
-
- org.apache.commons.configuration2.AbstractHierarchicalConfiguration.DefinedKeysVisitor
-
- All Implemented Interfaces:
ConfigurationNodeVisitor<T>
- Enclosing class:
- AbstractHierarchicalConfiguration<T>
private final class AbstractHierarchicalConfiguration.DefinedKeysVisitor extends ConfigurationNodeVisitorAdapter<T>
A specialized visitor that fills a list with keys that are defined in a node hierarchy.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
keyList
Stores the list to be filled.private java.util.Stack<java.lang.String>
parentKeys
A stack with the keys of the already processed nodes.
-
Constructor Summary
Constructors Constructor Description DefinedKeysVisitor()
Default constructor.DefinedKeysVisitor(java.lang.String prefix)
Creates a newDefinedKeysVisitor
instance and sets the prefix for the keys to fetch.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getKeyList()
Gets the list with all defined keys.void
handleAttributeKeys(java.lang.String parentKey, T node, NodeHandler<T> handler)
Appends all attribute keys of the current node.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.-
Methods inherited from class org.apache.commons.configuration2.tree.ConfigurationNodeVisitorAdapter
terminate
-
-
-
-
Method Detail
-
getKeyList
public java.util.Set<java.lang.String> getKeyList()
Gets the list with all defined keys.- Returns:
- the list with the defined keys
-
handleAttributeKeys
public void handleAttributeKeys(java.lang.String parentKey, T node, NodeHandler<T> handler)
Appends all attribute keys of the current node.- Parameters:
parentKey
- the parent keynode
- the current nodehandler
- 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. This implementation removes this node's key from the stack.- Specified by:
visitAfterChildren
in interfaceConfigurationNodeVisitor<T>
- Overrides:
visitAfterChildren
in classConfigurationNodeVisitorAdapter<T>
- Parameters:
node
- the node to be visitedhandler
- theNodeHandler
-
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. If this node has a value, its key is added to the internal list.- Specified by:
visitBeforeChildren
in interfaceConfigurationNodeVisitor<T>
- Overrides:
visitBeforeChildren
in classConfigurationNodeVisitorAdapter<T>
- Parameters:
node
- the node to be visitedhandler
- theNodeHandler
-
-