public class ConfigurationNode extends Object implements IHierarchyParent
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected Map<String,String> |
attributes |
protected List<ConfigurationNode> |
children |
protected boolean |
readOnly |
protected String |
type |
protected String |
value |
Constructor and Description |
---|
ConfigurationNode(ConfigurationNode source)
Duplication constructor.
|
ConfigurationNode(String type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(int index,
ConfigurationNode child)
Add child at specified position.
|
void |
clearChildren()
Clear children.
|
protected static Map<String,String> |
cloneAttributes(Map<String,String> attributes) |
protected ConfigurationNode |
createDuplicate(boolean readOnly)
Create a duplicate of the current node.
|
protected ConfigurationNode |
createNewNode()
Make a new blank node identical in type and class to the current node.
|
protected ConfigurationNode |
createNewNode(ConfigurationNode source)
Make a new node that is a copy of the specified node.
|
boolean |
equals(Object o)
Check if equals
|
ConfigurationNode |
findChild(int index)
Get child n.
|
int |
getAttributeCount()
Get the attribute count.
|
Iterator<String> |
getAttributes()
Iterate over attributes.
|
String |
getAttributeValue(String attribute)
Get an attribute value.
|
int |
getChildCount()
Get child count.
|
String |
getType()
Get type.
|
String |
getValue()
Get value.
|
int |
hashCode()
Calculate a hashcode
|
void |
makeReadOnly()
Make this node (and its children) read-only
|
void |
removeChild(int index)
Remove child n.
|
void |
setAttribute(String attribute,
String value)
Set an attribute.
|
void |
setValue(String value)
Set value.
|
String |
toString()
Construct a human-readable string
|
public static final String _rcsid
protected List<ConfigurationNode> children
protected String type
protected String value
protected boolean readOnly
public ConfigurationNode(String type)
public ConfigurationNode(ConfigurationNode source)
protected ConfigurationNode createNewNode()
protected ConfigurationNode createNewNode(ConfigurationNode source)
public void makeReadOnly()
protected ConfigurationNode createDuplicate(boolean readOnly)
public String getType()
public void setValue(String value)
value
- is the value to set.public String getValue()
public int getChildCount()
getChildCount
in interface IHierarchyParent
public ConfigurationNode findChild(int index)
findChild
in interface IHierarchyParent
index
- is the child number.public void removeChild(int index)
removeChild
in interface IHierarchyParent
index
- is the child to remove.public void addChild(int index, ConfigurationNode child)
addChild
in interface IHierarchyParent
index
- is the position to add the child.child
- is the child to add.public void clearChildren()
clearChildren
in interface IHierarchyParent
public void setAttribute(String attribute, String value)
attribute
- is the name of the attribute.value
- is the value of the attribute (null to remove it).public int getAttributeCount()
public Iterator<String> getAttributes()
public String getAttributeValue(String attribute)
attribute
- is the name of the attribute.public String toString()