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 -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DefinedKeysVisitor
(String prefix) Creates a newDefinedKeysVisitor
instance and sets the prefix for the keys to fetch. -
Method Summary
Modifier and TypeMethodDescriptionGets the list with all defined keys.void
handleAttributeKeys
(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
-
Field Details
-
keyList
Stores the list to be filled. -
parentKeys
A stack with the keys of the already processed nodes.
-
-
Constructor Details
-
DefinedKeysVisitor
public DefinedKeysVisitor()Default constructor. -
DefinedKeysVisitor
Creates a newDefinedKeysVisitor
instance and sets the prefix for the keys to fetch.- Parameters:
prefix
- the prefix
-
-
Method Details
-
getKeyList
Gets the list with all defined keys.- Returns:
- the list with the defined keys
-
visitAfterChildren
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
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
-
handleAttributeKeys
Appends all attribute keys of the current node.- Parameters:
parentKey
- the parent keynode
- the current nodehandler
- theNodeHandler
-