|
|||||||||
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.Reference
public class Reference
Field Summary | |
---|---|
protected java.lang.String |
id
The unique identifier for this reference. |
protected static java.lang.String |
IDENTIFIER
The name of the element attribute defining a valid reference target. |
protected Node |
node
The referenced node. |
protected static java.lang.String |
REFERENCE
The name of the element attribute defining a reference to another element. |
Fields inherited from class net.smartlab.config.Element |
---|
name, parent |
Constructor Summary | |
---|---|
protected |
Reference(Node parent,
java.lang.String name,
java.lang.String id)
Creates a reference contained by the given parent node with a specified name and unique identifier. |
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. |
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 static final java.lang.String REFERENCE
protected static final java.lang.String IDENTIFIER
protected Node node
null
until resolved.
protected java.lang.String id
Constructor Detail |
---|
protected Reference(Node parent, java.lang.String name, java.lang.String id)
parent
- the node containing the element.name
- the element name.id
- the element identifier.Method Detail |
---|
public java.lang.String getId()
Element
getId
in class Element
Element.getId()
public java.util.Collection getElements() throws ConfigurationException
Element
getElements
in class Element
Collection
which enumerates the
contained elements.
ConfigurationException
- if something wrong occurs during the
operation.Element.getElements()
public java.util.Collection getElements(java.lang.String name) throws ConfigurationException
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.
ConfigurationException
- if something wrong occurs during the
operation.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 getAttributes() throws ConfigurationException
Element
getAttributes
in class Element
Collection
which enumerates the
attributes of this element.
ConfigurationException
- if something wrong occurs during the
operation.Element.getAttributes()
public java.util.Collection getAttributeNames() throws ConfigurationException
Element
getAttributeNames
in class Element
Collection
which enumerates the
attributes of this element.
ConfigurationException
- if something wrong occurs during the
operation.Element.getAttributeNames()
public java.lang.String getAttribute(java.lang.String name) throws ConfigurationException
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.
ConfigurationException
- if something wrong occurs during the
operation.Element.getAttribute(java.lang.String)
public java.lang.String getContent() throws ConfigurationException
Element
getContent
in class Element
ConfigurationException
- if the content couldn't be retrieved.Element.getContent()
public void resolve() throws ConfigurationException
Element
resolve
in class Element
ConfigurationException
- if something wrong occurs during the
operation.Element.resolve()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |