|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kxml.kdom.Node
org.kxml.kdom.Element
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.
Field Summary | |
protected java.util.Vector |
attributes
|
protected java.lang.String |
name
|
protected java.lang.String |
namespace
|
protected Node |
parent
|
protected PrefixMap |
prefixMap
|
Fields inherited from class org.kxml.kdom.Node |
children, types |
Constructor Summary | |
Element()
|
Method Summary | |
void |
clear()
removes all children and attributes |
Element |
createElement(java.lang.String namespace,
java.lang.String name)
Forwards creation request to parent if any, otherwise calls super.createElement. |
Attribute |
getAttribute(int index)
Returns the attribute at the given index. |
Attribute |
getAttribute(java.lang.String name)
convenience method for getAttribute (Xml.NO_NAMESPACE, name) |
Attribute |
getAttribute(java.lang.String namespace,
java.lang.String name)
returns the attribute with the given namespace and name. |
int |
getAttributeCount()
Returns the number of attributes of this element. |
java.util.Vector |
getAttributes()
Returns a Vector containing all Attributes. |
Document |
getDocument()
Returns the document this element is a member of. |
java.lang.String |
getName()
returns the (local) name of the element |
java.lang.String |
getNamespace()
returns the namespace of the element |
Node |
getParent()
Returns the parent node of this element |
Element |
getParentElement()
Returns the parent element if available, null otherwise |
PrefixMap |
getPrefixMap()
Returns the namespace prefix map of this Element. |
java.lang.String |
getValue(java.lang.String name)
Returns the value of the given attribute. |
java.lang.String |
getValueDefault(java.lang.String name,
java.lang.String dflt)
Returns the value of the given attribute, or the given default value if the desired attribute does not exist. |
Element |
init(Node parent,
java.lang.String namespace,
java.lang.String name,
java.util.Vector attributes)
Deprecated. The init method is invoked by createElement setParent . |
void |
parse(AbstractXmlParser parser)
Builds the child elements from the given Parser. |
void |
removeAttribute(int index)
Removes the attribute at the given index |
void |
setAttribute(Attribute attribute)
sets the given attribute |
void |
setAttributes(java.util.Vector attributes)
Replaces all attributes by the given Vector. |
void |
setName(java.lang.String name)
sets the name of the element |
void |
setNamespace(java.lang.String namespace)
sets the namespace of the element. |
protected void |
setParent(Node parent)
Sets the Parent of this element. |
void |
setPrefixMap(PrefixMap prefixMap)
Sets the namespace prefix map of this Node. |
void |
setValue(java.lang.String name,
java.lang.String value)
sets the value of the given attribute to the given string. |
void |
write(AbstractXmlWriter writer)
Writes this element and all children to the given XmlWriter. |
Methods inherited from class org.kxml.kdom.Node |
addChild, addChild, getChild, getChildCount, getElement, getElement, getElement, getText, getText, getType, indexOf, indexOf, removeChild, toString, writeChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String namespace
protected java.lang.String name
protected java.util.Vector attributes
protected Node parent
protected PrefixMap prefixMap
Constructor Detail |
public Element()
Method Detail |
public Element init(Node parent, java.lang.String namespace, java.lang.String name, java.util.Vector attributes)
public void clear()
public Element createElement(java.lang.String namespace, java.lang.String name)
createElement
in class Node
public Attribute getAttribute(int index)
public Attribute getAttribute(java.lang.String name)
public Attribute getAttribute(java.lang.String namespace, java.lang.String name)
public int getAttributeCount()
public java.util.Vector getAttributes()
public Document getDocument()
public java.lang.String getName()
getName
in class Node
public java.lang.String getNamespace()
getNamespace
in class Node
public Node getParent()
public Element getParentElement()
public PrefixMap getPrefixMap()
public java.lang.String getValue(java.lang.String name)
public java.lang.String getValueDefault(java.lang.String name, java.lang.String dflt)
public void parse(AbstractXmlParser parser) throws java.io.IOException
parse
in interface XmlIO
parse
in class Node
java.io.IOException
public void removeAttribute(int index)
public void setAttributes(java.util.Vector attributes)
public void setAttribute(Attribute attribute)
public void setValue(java.lang.String name, java.lang.String value)
public void setName(java.lang.String name)
public void setNamespace(java.lang.String namespace)
protected void setParent(Node parent)
public void setPrefixMap(PrefixMap prefixMap)
public void write(AbstractXmlWriter writer) throws java.io.IOException
write
in interface XmlIO
write
in class Node
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |