org.apache.commons.configuration

Class HierarchicalConfiguration.CloneVisitor

static class HierarchicalConfiguration.CloneVisitor extends ConfigurationNodeVisitorAdapter

A specialized visitor that is able to create a deep copy of a node hierarchy.
Field Summary
StackcopyStack
A stack with the actual object to be copied.
ConfigurationNoderesult
Stores the result of the clone process.
Constructor Summary
CloneVisitor()
Creates a new instance of CloneVisitor.
Method Summary
ConfigurationNodegetClone()
Returns the result of the clone process.
voidvisitAfterChildren(ConfigurationNode node)
Visits the specified node after its children have been processed.
voidvisitBeforeChildren(ConfigurationNode node)
Visits and copies the specified node.

Field Detail

copyStack

private Stack copyStack
A stack with the actual object to be copied.

result

private ConfigurationNode result
Stores the result of the clone process.

Constructor Detail

CloneVisitor

public CloneVisitor()
Creates a new instance of CloneVisitor.

Method Detail

getClone

public ConfigurationNode getClone()
Returns the result of the clone process. This is the root node of the cloned node hierarchy.

Returns: the cloned root node

visitAfterChildren

public void visitAfterChildren(ConfigurationNode node)
Visits the specified node after its children have been processed.

Parameters: node the node

visitBeforeChildren

public void visitBeforeChildren(ConfigurationNode node)
Visits and copies the specified node.

Parameters: node the node