org.apache.commons.configuration.tree
public class NodeAddData extends Object
A simple data class used by ExpressionEngine
to store
the results of the 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:
Since: 1.3
Field Summary | |
---|---|
boolean | attribute Stores the attribute flag. |
String | newNodeName Stores the name of the new node. |
ConfigurationNode | parent Stores the parent node of the add operation. |
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, String nodeName)
Creates a new instance of NodeAddData and sets the most
important data fields.
|
Method Summary | |
---|---|
void | addPathNode(String nodeName)
Adds the name of a path node. |
String | getNewNodeName()
Returns the name of the new node.
|
ConfigurationNode | getParent()
Returns the parent node.
|
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(String newNodeName)
Sets the name of the new node. |
void | setParent(ConfigurationNode parent)
Sets the parent node. |
NodeAddData
.NodeAddData
and sets the most
important data fields.
Parameters: parent the parent node nodeName the name of the new node
Parameters: nodeName the name of the node
See Also: getPathNodes
Returns: the new node's name
Returns: the parent node
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.
Returns: a list with the names of nodes that must be added as parents of the new node (never null)
Returns: true for an attribute node, false for a child node
Parameters: attribute the attribute flag
Parameters: newNodeName the name of the new node
Parameters: parent the parent node