|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.configuration.tree.NodeAddData
public class NodeAddData
A simple data class used by
to store
the results of the ExpressionEngine
prepareAdd()
operation.
If a new property is to be added to a configuration, the affected
Configuration
object must know, where in its hierarchy of
configuration nodes new elements have to be added. This information is
obtained by an ExpressionEngine
object that interprets the key
of the new property. This expression engine will pack all information
necessary for the configuration to perform the add operation in an instance
of this class.
Information managed by this class contains:
Field Summary | |
---|---|
private boolean |
attribute
Stores the attribute flag. |
private java.lang.String |
newNodeName
Stores the name of the new node. |
private ConfigurationNode |
parent
Stores the parent node of the add operation. |
private java.util.List |
pathNodes
Stores a list with nodes that are on the path between the parent node and the new node. |
Constructor Summary | |
---|---|
NodeAddData()
Creates a new, uninitialized instance of NodeAddData . |
|
NodeAddData(ConfigurationNode parent,
java.lang.String nodeName)
Creates a new instance of NodeAddData and sets the most
important data fields. |
Method Summary | |
---|---|
void |
addPathNode(java.lang.String nodeName)
Adds the name of a path node. |
java.lang.String |
getNewNodeName()
Returns the name of the new node. |
ConfigurationNode |
getParent()
Returns the parent node. |
java.util.List |
getPathNodes()
Returns a list with further nodes that must be added. |
boolean |
isAttribute()
Returns a flag if the new node to be added is an attribute. |
void |
setAttribute(boolean attribute)
Sets the attribute flag. |
void |
setNewNodeName(java.lang.String newNodeName)
Sets the name of the new node. |
void |
setParent(ConfigurationNode parent)
Sets the parent node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ConfigurationNode parent
private java.util.List pathNodes
private java.lang.String newNodeName
private boolean attribute
Constructor Detail |
---|
public NodeAddData()
NodeAddData
.
public NodeAddData(ConfigurationNode parent, java.lang.String nodeName)
NodeAddData
and sets the most
important data fields.
parent
- the parent nodenodeName
- the name of the new nodeMethod Detail |
---|
public boolean isAttribute()
public void setAttribute(boolean attribute)
attribute
- the attribute flagpublic java.lang.String getNewNodeName()
public void setNewNodeName(java.lang.String newNodeName)
newNodeName
- the name of the new nodepublic ConfigurationNode getParent()
public void setParent(ConfigurationNode parent)
parent
- the parent nodepublic java.util.List getPathNodes()
database
. Now the key
database.connection.settings.username
(assuming the syntax
of the default expression engine) is to be added. Then
username
is the name of the new node, but the nodes
connection
and settings
must be added to
the parent node first. In this example these names would be returned by
this method.
public void addPathNode(java.lang.String nodeName)
nodeName
- the name of the nodegetPathNodes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |