|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.jaxmpp.core.client.xml.DefaultElement
public class DefaultElement
Default implementation of XML Element object. This class should be used every time when new XML Element is created.
| Constructor Summary | |
|---|---|
DefaultElement(String name)
|
|
DefaultElement(String name,
String value,
String xmlns)
|
|
| Method Summary | |
|---|---|
Element |
addChild(Element child)
Add child element to tree and return the added element. |
static Element |
create(Element src)
|
static DefaultElement |
create(Element src,
int deep)
|
boolean |
equals(Object obj)
|
String |
getAsString()
Get this element as XML string. |
String |
getAttribute(String attName)
Get attribute by name. |
Map<String,String> |
getAttributes()
Get all attributes as a Map. |
Element |
getChildAfter(Element child)
Gets the first child after specified child in children list. |
List<Element> |
getChildren()
Get all children of the element. |
List<Element> |
getChildren(String name)
Get children by name. |
List<Element> |
getChildrenNS(String xmlns)
Get children by namespace. |
Element |
getChildrenNS(String name,
String xmlns)
Get children by namespace. |
Element |
getFirstChild()
Get the first child element of this element. |
String |
getName()
Get name of this element. |
Element |
getNextSibling()
Get next sibling to this element or null if no parent or no more siblings exist. |
Element |
getParent()
Get parent element of this element. |
String |
getValue()
Get element value. |
String |
getXMLNS()
Get namespace of this element. traverses up to find actual namespace. |
int |
hashCode()
|
void |
removeAttribute(String key)
Remove attribute from element. |
void |
removeChild(Element child)
Remove child from element. |
void |
setAttribute(String key,
String value)
Set value of attribute. |
void |
setAttributes(Map<String,String> attrs)
Set a number of attributes. |
void |
setParent(Element parent)
Set element parent. |
void |
setValue(String value)
Set value of this element. |
void |
setXMLNS(String xmlns)
Change the namespace of this element. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultElement(String name)
public DefaultElement(String name,
String value,
String xmlns)
| Method Detail |
|---|
public static final Element create(Element src)
throws XMLException
XMLException
public static final DefaultElement create(Element src,
int deep)
throws XMLException
XMLException
public Element addChild(Element child)
throws XMLException
Element
addChild in interface Elementchild - Child to add.
XMLExceptionpublic boolean equals(Object obj)
equals in class Object
public String getAsString()
throws XMLException
Element
getAsString in interface ElementXMLException
public String getAttribute(String attName)
throws XMLException
Element
getAttribute in interface ElementattName - Name of attribute to fetch.
XMLException
public Map<String,String> getAttributes()
throws XMLException
Element
getAttributes in interface ElementXMLException
public Element getChildAfter(Element child)
throws XMLException
Element
getChildAfter in interface Elementchild - The child to look up.
XMLException
public List<Element> getChildren()
throws XMLException
Element
getChildren in interface ElementXMLException
public List<Element> getChildren(String name)
throws XMLException
Element
getChildren in interface Elementname - Name of the children to get.
XMLException
public List<Element> getChildrenNS(String xmlns)
throws XMLException
Element
getChildrenNS in interface Elementxmlns - Namespace of the children to get.
XMLException
public Element getChildrenNS(String name,
String xmlns)
throws XMLException
Element
getChildrenNS in interface Elementname - Name of the children to get.xmlns - Namespace of the children to get.
XMLException
public Element getFirstChild()
throws XMLException
Element
getFirstChild in interface ElementXMLException
public String getName()
throws XMLException
Element
getName in interface ElementXMLException
public Element getNextSibling()
throws XMLException
Element
getNextSibling in interface ElementXMLException
public Element getParent()
throws XMLException
Element
getParent in interface ElementXMLException
public String getValue()
throws XMLException
Element
getValue in interface ElementXMLException
public String getXMLNS()
throws XMLException
Element
getXMLNS in interface ElementXMLExceptionpublic int hashCode()
hashCode in class Object
public void removeAttribute(String key)
throws XMLException
Element
removeAttribute in interface Elementkey - Name of attribute to remove.
XMLException
public void removeChild(Element child)
throws XMLException
Element
removeChild in interface Elementchild - Child element to remove.
XMLException
public void setAttribute(String key,
String value)
throws XMLException
Element
setAttribute in interface Elementkey - Name of attribute to set.value - Value of attribute to set.
XMLException
public void setAttributes(Map<String,String> attrs)
throws XMLException
Element
setAttributes in interface Elementattrs - Attributes to set.
XMLException
public void setParent(Element parent)
throws XMLException
Element
setParent in interface Elementparent - The parent to set for this element.
XMLException
public void setValue(String value)
throws XMLException
Element
setValue in interface Elementvalue - Value to set.
XMLException
public void setXMLNS(String xmlns)
throws XMLException
Element
setXMLNS in interface Elementxmlns - Namespace to set.
XMLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||