|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.smartlab.config.Element net.smartlab.config.Node
public class Node
Field Summary | |
---|---|
protected java.util.Map |
attributes
The node attributes. |
protected java.util.List |
children
The node sub elements. |
protected java.lang.String |
content
The node direct contents. |
protected boolean |
resolved
Marks this node as already resolved for references. |
Fields inherited from class net.smartlab.config.Element |
---|
name, parent |
Constructor Summary | |
---|---|
protected |
Node(Node parent,
java.lang.String name,
org.xml.sax.Attributes attributes)
Constructs a generic empty node. |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the attribute whose name equals the specified one or null if the element doesn't contain a such named
attribute. |
java.util.Collection |
getAttributeNames()
Returns all the attributes names of this element. |
java.util.Collection |
getAttributes()
Returns all the attributes of this element. |
java.lang.String |
getContent()
Returns the element content as a string. |
Element |
getElement(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
Returns the first contained element whose name equals the given one and whose attribute list defines an attribute whose name and values matches the given parameters. |
java.util.Collection |
getElements()
Returns all the contained elements. |
java.util.Collection |
getElements(java.lang.String name)
Returns all the contained elements which name equals the given one. |
java.lang.String |
getId()
Returns the unique identifier associated with this element. |
void |
resolve()
Resolves the element reference. |
protected Node |
resolve(java.lang.String name,
java.lang.String id)
Resolves the requested reference through its children nodes or, recursively in the parent node children. |
protected void |
setContent(java.lang.String content)
Sets the content. |
Methods inherited from class net.smartlab.config.Element |
---|
getAttributeValues, getElement, getElement, getName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List children
protected java.util.Map attributes
protected java.lang.String content
protected boolean resolved
Constructor Detail |
---|
protected Node(Node parent, java.lang.String name, org.xml.sax.Attributes attributes)
parent
- the node containing this node.name
- a name associated to this node.attributes
- a set of attributes associated with this node.Method Detail |
---|
public java.lang.String getId()
Element
getId
in class Element
Element.getId()
public java.util.Collection getElements()
Element
getElements
in class Element
Collection
which enumerates the
contained elements.Element.getElements()
public java.util.Collection getElements(java.lang.String name)
Element
getElements
in class Element
name
- the name of the elements to search for.
Collection
which enumerates the
contained elements which name equals the given one.Element.getElements(java.lang.String)
public Element getElement(java.lang.String name, java.lang.String attribute, java.lang.String value) throws ConfigurationException
Element
getElement
in class Element
name
- the name of the element to search for.attribute
- attribute the name of the attribute which must be
defined on the element.value
- the value the attribute must match.
Element
or null
if
the search fails.
ConfigurationException
- if something wrong occurs during the
operation.Element.getElement(java.lang.String,
java.lang.String, java.lang.String)
public java.util.Collection getAttributeNames()
Element
getAttributeNames
in class Element
Collection
which enumerates the
attributes of this element.Element.getAttributeNames()
public java.util.Collection getAttributes()
Element
getAttributes
in class Element
Collection
which enumerates the
attributes of this element.Element.getAttributes()
public java.lang.String getAttribute(java.lang.String name)
Element
null
if the element doesn't contain a such named
attribute.
getAttribute
in class Element
name
- the name of the attribute to get.
String
instance representing the attribute value
or null
if no attribute with the specified name
was found.Element.getAttribute(java.lang.String)
public java.lang.String getContent()
Element
getContent
in class Element
Element.getContent()
protected void setContent(java.lang.String content)
content
- the content to setpublic void resolve() throws ConfigurationException
Element
resolve
in class Element
ConfigurationException
- if something wrong occurs during the
operation.Element.resolve()
protected Node resolve(java.lang.String name, java.lang.String id) throws ConfigurationException
name
- the referenced element name.id
- the referenced element identifier.
ConfigurationException
- if the referenced element cannot be found
in the wntire configuration tree.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |