|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConfigurationNode
Definition of an interface for the nodes of a hierarchical configuration.
This interface defines a tree like structure for configuration data. A node has a value and can have an arbitrary number of children and attributes.
Method Summary | |
---|---|
void |
addAttribute(ConfigurationNode attr)
Adds the specified attribute to this node |
void |
addChild(ConfigurationNode node)
Adds a child to this node. |
java.lang.Object |
clone()
Returns a copy of this node. |
ConfigurationNode |
getAttribute(int index)
Returns the attribute node with the given index. |
int |
getAttributeCount()
Returns the number of attributes of this node. |
int |
getAttributeCount(java.lang.String name)
Returns the number of attributes with the given name. |
java.util.List<ConfigurationNode> |
getAttributes()
Returns a list with this node's attributes. |
java.util.List<ConfigurationNode> |
getAttributes(java.lang.String name)
Returns a list with the attribute nodes with the given name. |
ConfigurationNode |
getChild(int index)
Returns the child node with the given index. |
java.util.List<ConfigurationNode> |
getChildren()
Returns a list with the child nodes of this node. |
java.util.List<ConfigurationNode> |
getChildren(java.lang.String name)
Returns a list with all children of this node with the given name. |
int |
getChildrenCount()
Returns the number of this node's children. |
int |
getChildrenCount(java.lang.String name)
Returns the number of children with the given name. |
java.lang.String |
getName()
Returns the name of this node. |
ConfigurationNode |
getParentNode()
Returns this node's parent. |
java.lang.Object |
getReference()
Returns this node's reference. |
java.lang.Object |
getValue()
Returns the value of this node. |
boolean |
isAttribute()
Returns a flag whether this node is an attribute. |
boolean |
isDefined()
Returns a flag if this node is defined. |
boolean |
removeAttribute(ConfigurationNode node)
Removes the specified attribute from this node. |
boolean |
removeAttribute(java.lang.String name)
Removes all attributes with the given name. |
void |
removeAttributes()
Removes all attributes of this node. |
boolean |
removeChild(ConfigurationNode child)
Removes the given node from this node's children. |
boolean |
removeChild(java.lang.String childName)
Removes all child nodes of this node with the given name. |
void |
removeChildren()
Removes all children from this node. |
void |
setAttribute(boolean f)
Sets a flag whether this node is an attribute. |
void |
setName(java.lang.String name)
Sets the name of this node. |
void |
setParentNode(ConfigurationNode parent)
Sets the parent of this node. |
void |
setReference(java.lang.Object ref)
Sets this node's reference. |
void |
setValue(java.lang.Object val)
Sets the value of this node. |
void |
visit(ConfigurationNodeVisitor visitor)
Visits this node and all its sub nodes. |
Method Detail |
---|
java.lang.String getName()
void setName(java.lang.String name)
name
- the node namejava.lang.Object getValue()
void setValue(java.lang.Object val)
val
- the node's valuejava.lang.Object getReference()
void setReference(java.lang.Object ref)
ref
- the referenceConfigurationNode getParentNode()
void setParentNode(ConfigurationNode parent)
parent
- the parent of this nodevoid addChild(ConfigurationNode node)
node
- the new childjava.util.List<ConfigurationNode> getChildren()
int getChildrenCount()
java.util.List<ConfigurationNode> getChildren(java.lang.String name)
name
- the name of the searched children
int getChildrenCount(java.lang.String name)
name
- the name
ConfigurationNode getChild(int index)
index
- the index of the child node (0-based)
boolean removeChild(ConfigurationNode child)
child
- the child node to be removed
boolean removeChild(java.lang.String childName)
childName
- the name of the children to be removed
void removeChildren()
boolean isAttribute()
void setAttribute(boolean f)
f
- the attribute flagjava.util.List<ConfigurationNode> getAttributes()
ConfigurationNode
objects.
int getAttributeCount()
java.util.List<ConfigurationNode> getAttributes(java.lang.String name)
name
- the name of the attribute
int getAttributeCount(java.lang.String name)
name
- the name of the attribute
ConfigurationNode getAttribute(int index)
index
- the index
boolean removeAttribute(ConfigurationNode node)
node
- the attribute to remove
boolean removeAttribute(java.lang.String name)
name
- the name of the attributes to be removed
void removeAttributes()
void addAttribute(ConfigurationNode attr)
attr
- the attribute nodeboolean isDefined()
void visit(ConfigurationNodeVisitor visitor)
visitor
- the visitorConfigurationNodeVisitor
java.lang.Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |