org.apache.commons.configuration
Class HierarchicalConfiguration.DefinedKeysVisitor

java.lang.Object
  extended byorg.apache.commons.configuration.HierarchicalConfiguration.NodeVisitor
      extended byorg.apache.commons.configuration.HierarchicalConfiguration.DefinedKeysVisitor
Enclosing class:
HierarchicalConfiguration

static class HierarchicalConfiguration.DefinedKeysVisitor
extends HierarchicalConfiguration.NodeVisitor

A specialized visitor that fills a list with keys that are defined in a node hierarchy.


Constructor Summary
HierarchicalConfiguration.DefinedKeysVisitor()
          Default constructor.
HierarchicalConfiguration.DefinedKeysVisitor(String prefix)
          Creates a new DefinedKeysVisitor instance and sets the prefix for the keys to fetch.
 
Method Summary
protected  void addKey(ConfigurationKey key)
          Adds the specified key to the internal list.
 Set getKeyList()
          Returns the list with all defined keys.
 void visitBeforeChildren(HierarchicalConfiguration.Node node, ConfigurationKey key)
          Visits the specified node.
 
Methods inherited from class org.apache.commons.configuration.HierarchicalConfiguration.NodeVisitor
terminate, visitAfterChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalConfiguration.DefinedKeysVisitor

public HierarchicalConfiguration.DefinedKeysVisitor()
Default constructor.


HierarchicalConfiguration.DefinedKeysVisitor

public HierarchicalConfiguration.DefinedKeysVisitor(String prefix)
Creates a new DefinedKeysVisitor instance and sets the prefix for the keys to fetch.

Parameters:
prefix - the prefix
Method Detail

getKeyList

public Set getKeyList()
Returns the list with all defined keys.

Returns:
the list with the defined keys

visitBeforeChildren

public void visitBeforeChildren(HierarchicalConfiguration.Node node,
                                ConfigurationKey key)
Visits the specified node. If this node has a value, its key is added to the internal list.

Overrides:
visitBeforeChildren in class HierarchicalConfiguration.NodeVisitor
Parameters:
node - the node to be visited
key - the key of this node

addKey

protected void addKey(ConfigurationKey key)
Adds the specified key to the internal list.

Parameters:
key - the key to add


Copyright © 2001-2005 The Apache Software Foundation. All Rights Reserved.