|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.configuration.tree.NodeCombiner
A base class for node combiner implementations.
A node combiner is an object that knows how two hierarchical node structures can be combined into a single one. Of course, there are many possible ways of implementing such a combination, e.g. constructing a union, an intersection, or an "override" structure (were nodes in the first hierarchy take precedence over nodes in the second hierarchy). This abstract base class only provides some helper methods and defines the common interface for node combiners. Concrete sub classes will implement the diverse combination algorithms.
For some concrete combiner implementations it is important to distinguish
whether a node is a single node or whether it belongs to a list structure.
Alone from the input structures, the combiner will not always be able to make
this decision. So sometimes it may be necessary for the developer to
configure the combiner and tell it, which nodes should be treated as list
nodes. For this purpose the addListNode()
method exists. It
can be passed the name of a node, which should be considered a list node.
Field Summary | |
protected Set |
listNodes
Stores a list with node names that are known to be list nodes. |
Constructor Summary | |
NodeCombiner()
Creates a new instance of NodeCombiner . |
Method Summary | |
void |
addListNode(String nodeName)
Adds the name of a node to the list of known list nodes. |
abstract ConfigurationNode |
combine(ConfigurationNode node1,
ConfigurationNode node2)
Combines the hierarchies represented by the given root nodes. |
protected ViewNode |
createViewNode()
Creates a new view node. |
Set |
getListNodes()
Returns a set with the names of nodes that are known to be list nodes. |
boolean |
isListNode(ConfigurationNode node)
Checks if a node is a list node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Set listNodes
Constructor Detail |
public NodeCombiner()
NodeCombiner
.
Method Detail |
public void addListNode(String nodeName)
nodeName
- the name to be addedpublic Set getListNodes()
public boolean isListNode(ConfigurationNode node)
node
- the node to be tested
public abstract ConfigurationNode combine(ConfigurationNode node1, ConfigurationNode node2)
node1
- the first root nodenode2
- the second root node
protected ViewNode createViewNode()
ViewNode
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |