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 newDefinedKeysVisitorinstance and sets the prefix for the keys to fetch. -
Method Summary
Modifier and TypeMethodDescriptionGets the list with all defined keys.voidhandleAttributeKeys(String parentKey, T node, NodeHandler<T> handler) Appends all attribute keys of the current node.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.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 newDefinedKeysVisitorinstance 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
-
handleAttributeKeys
Appends all attribute keys of the current node.- Parameters:
parentKey- the parent keynode- the current nodehandler- theNodeHandler
-
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:
visitAfterChildrenin interfaceConfigurationNodeVisitor<T>- Overrides:
visitAfterChildrenin 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:
visitBeforeChildrenin interfaceConfigurationNodeVisitor<T>- Overrides:
visitBeforeChildrenin classConfigurationNodeVisitorAdapter<T>- Parameters:
node- the node to be visitedhandler- theNodeHandler
-