| java.lang.Object org.kxml2.kdom.Node org.kxml2.kdom.Element
Element | public class Element extends Node (Code) | | In order to create an element, please use the createElement method
instead of invoking the constructor directly. The right place to
add user defined initialization code is the init method.
|
Constructor Summary | |
public | Element() |
clear | public void clear()(Code) | | removes all children and attributes
|
createElement | public Element createElement(String namespace, String name)(Code) | | Forwards creation request to parent if any, otherwise
calls super.createElement.
|
getAttributeCount | public int getAttributeCount()(Code) | | Returns the number of attributes of this element.
|
getAttributeName | public String getAttributeName(int index)(Code) | | |
getAttributeNamespace | public String getAttributeNamespace(int index)(Code) | | |
getAttributeValue | public String getAttributeValue(int index)(Code) | | |
getName | public String getName()(Code) | | returns the (local) name of the element
|
getNamespace | public String getNamespace()(Code) | | returns the namespace of the element
|
getNamespaceCount | public int getNamespaceCount()(Code) | | returns the number of declared namespaces, NOT including
parent elements
|
getNamespacePrefix | public String getNamespacePrefix(int i)(Code) | | |
getNamespaceUri | public String getNamespaceUri(String prefix)(Code) | | returns the namespace for the given prefix
|
getParent | public Node getParent()(Code) | | Returns the parent node of this element
|
getRoot | public Node getRoot()(Code) | | Returns the root node, determined by ascending to the
all parents un of the root element.
|
init | public void init()(Code) | | called when all properties are set, but before children
are parsed. Please do not use setParent for initialization
code any longer.
|
parse | public void parse(XmlPullParser parser) throws IOException, XmlPullParserException(Code) | | Builds the child elements from the given Parser. By overwriting
parse, an element can take complete control over parsing its
subtree.
|
setAttribute | public void setAttribute(String namespace, String name, String value)(Code) | | Sets the given attribute; a value of null removes the attribute
|
setName | public void setName(String name)(Code) | | sets the name of the element
|
setNamespace | public void setNamespace(String namespace)(Code) | | sets the namespace of the element. Please note: For no
namespace, please use Xml.NO_NAMESPACE, null is not a legal
value. Currently, null is converted to Xml.NO_NAMESPACE, but
future versions may throw an exception.
|
setParent | protected void setParent(Node parent)(Code) | | Sets the Parent of this element. Automatically called from the
add method. Please use with care, you can simply
create inconsitencies in the document tree structure using
this method!
|
setPrefix | public void setPrefix(String prefix, String namespace)(Code) | | Sets the given prefix; a namespace value of null removess the
prefix
|
write | public void write(XmlSerializer writer) throws IOException(Code) | | Writes this element and all children to the given XmlWriter.
|
|
|