|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.ipojo.metadata.Element
public class Element
An element represents an XML Element.
It contains a name, a namepace, Attribute
objects
and sub-elements. This class is used to parse iPOJO metadata.
Constructor Summary | |
---|---|
Element(String name,
String ns)
Creates an Element. |
Method Summary | |
---|---|
void |
addAttribute(Attribute att)
Adds a attribute. |
void |
addElement(Element elem)
Adds a sub-element. |
boolean |
containsAttribute(String name)
Does the element contain an attribute of the name given in parameter. |
boolean |
containsElement(String name)
Does the element contain a sub-element of the type given in parameter. |
boolean |
containsElement(String name,
String ns)
Does the element contain a sub-element of the type given in parameter. |
String |
getAttribute(String name)
Returns the value of the attribute given in parameter. |
String |
getAttribute(String name,
String ns)
Returns the value of the attribute "name" of the namespace "ns". |
Attribute[] |
getAttributes()
Gets element attributes. |
Element[] |
getElements()
Gets sub-elements. |
Element[] |
getElements(String name)
Gets the elements array of the element type given in parameter. |
Element[] |
getElements(String name,
String ns)
Gets the elements array of the element type given in parameter. |
String |
getName()
Gets element name. |
String |
getNameSpace()
Gets element namespace. |
void |
removeAttribute(Attribute att)
Removes an attribute. |
void |
removeElement(Element elem)
Removes a sub-element. |
String |
toString()
To String method. |
String |
toXMLString()
Gets the XML form of this element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Element(String name, String ns)
name
- the name of the elementns
- the namespace of the elementMethod Detail |
---|
public Element[] getElements()
public Attribute[] getAttributes()
public String getName()
public String getNameSpace()
public String getAttribute(String name)
name
- the name of the searched attribute
null
if the attribute does not existpublic String getAttribute(String name, String ns)
name
- the name of the attribute to findns
- the namespace of the attribute to find
null
if the attribute is not found.public void addElement(Element elem)
elem
- the element to addpublic void removeElement(Element elem)
elem
- the element to removepublic void addAttribute(Attribute att)
att
- the attribute to addpublic void removeAttribute(Attribute att)
att
- the attribute to removepublic Element[] getElements(String name)
name
- the type of the element to find (element name)
null
if the search failed)public Element[] getElements(String name, String ns)
name
- the type of the element to find (element name)ns
- the namespace of the element
null
if the search failed)public boolean containsElement(String name)
name
- the type of the element to check.
true
if the element contains an element of the type "name"public boolean containsElement(String name, String ns)
name
- the type of the element to check.ns
- the namespace of the element to check.
true
if the element contains an element of the type "name"public boolean containsAttribute(String name)
name
- the name of the element
true
if the element contains an attribute of the type "name"public String toXMLString()
public String toString()
toString
in class Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |