public interface Node extends NodeElement
Modifier and Type | Method and Description |
---|---|
void |
addAttributeChangeListener(AttributeChangeListener l)
Adds an listener that is notified when an attribute was changed.
|
void |
addElement(int index,
java.lang.Object e)
Adds a node element at
index to this node. |
void |
addElement(java.lang.Object e)
Adds a node element to this node.
|
boolean |
clearInheratedAttribute(java.lang.String name)
Clears an attributed that was defined by a parent node and
has same value.
|
void |
clearInheratedAttributes()
Clears all attributes that were defined by a parent node and
have same value.
|
void |
clearValue(java.lang.String name)
Clears an attribute, this means they value becomes NULL.
|
boolean |
contains(Node child,
boolean deep)
Tests if this node contains the given node.
|
void |
fireSaxEvents(org.xml.sax.ContentHandler handler)
Fires SAX events to a SAX content handler.
|
java.lang.Object |
firstElement()
Gets the first element of this node.
|
java.lang.String |
getAttrAsString(java.lang.String name)
Gets an attribute as String.
|
java.lang.String |
getAttrAsString(java.lang.String name,
boolean inherit)
Gets the value of an attribute as String.
|
java.lang.Object |
getAttribute(java.lang.String name)
Gets an attribute.
|
java.lang.Object |
getAttribute(java.lang.String name,
boolean inherit)
Gets the value of an attribute.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributeMap()
Gets a map of all defined attributes.
|
java.lang.String |
getContentText(boolean deep)
Gets only the text of this node.
|
java.util.Set<java.lang.String> |
getDefinedAttributes(boolean deep)
Gets a Set of all defined attributes.
|
java.util.List<java.lang.Object> |
getElements()
Gets childreen of this node.
|
java.util.List<Node> |
getElements(java.lang.String name,
boolean deep)
Finds all sub nodes of this node that have the given name.
|
java.lang.String |
getLocalName()
Gets the local name of this node.
|
java.lang.String |
getNamespacePrefix()
Gets the namespace prefix of this node.
|
java.util.Set<java.lang.String> |
getNamespacePrefixes(boolean inherated)
Gets a set of all defined namespace prefixes.
|
java.lang.String |
getNamespaceURI(java.lang.String prefix,
boolean inherated)
Gets the URI of a namespace prefix.
|
java.lang.String |
getQName()
Gets the full qualified name of this node.
|
Node |
getRoot()
Gets the root node of this node.
|
int |
indexOf(java.lang.Object child)
Gets the index of a child.
|
boolean |
isEmpty()
Determinates if this node has no elements.
|
java.lang.Object |
lastElement()
Gets the last element of this node.
|
void |
removeAttributeChangeListener(AttributeChangeListener l)
Removes a listener that was listener for attribute changes.
|
java.lang.Object |
removeElement(int i)
Removes an element from this node.
|
boolean |
removeElement(java.lang.Object e)
Removes an element from this node.
|
boolean |
replaceElement(java.lang.Object oldElement,
java.lang.Object newElement)
Replaces an element.
|
boolean |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the value of an attribute.
|
void |
setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
Sets all attributes that are contained in the map.
|
java.lang.Object |
setElement(int index,
java.lang.Object e)
Replaces a node element at
index of this node. |
void |
setNamespace(java.lang.String prefix,
java.lang.String uri)
Sets a namespace.
|
clone, getParent, setParent, writeTo
java.util.List<java.lang.Object> getElements()
NodeElement
or String
.void addElement(java.lang.Object e)
e
- Node element.java.lang.UnsupportedOperationException
- is throws if no childreen are allowed.java.lang.NullPointerException
- is thrown if e==null
void addElement(int index, java.lang.Object e)
index
to this node.index
- Index of element.e
- Node element.java.lang.IndexOutOfBoundsException
- is thrown if index
is out of bounds.java.lang.UnsupportedOperationException
- is throws if no childreen are allowed.java.lang.NullPointerException
- is thrown if e==null
java.lang.Object setElement(int index, java.lang.Object e)
index
of this node.index
- Index of element.e
- Node element.java.lang.IndexOutOfBoundsException
- is thrown if index
is out of bounds.java.lang.UnsupportedOperationException
- is throws if no childreen are allowed.java.lang.NullPointerException
- is thrown if e==null
boolean removeElement(java.lang.Object e)
e
- NodeElementjava.lang.Object removeElement(int i)
i
- Index of element.java.lang.IndexOutOfBoundsException
- is thrown if index
is out of bounds.boolean replaceElement(java.lang.Object oldElement, java.lang.Object newElement)
oldElement
- Old element.newElement
- New element.true
if this node contained oldElementNode getRoot()
java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
java.util.Set<java.lang.String> getDefinedAttributes(boolean deep)
deep
- true, if defined of parent nodes are included.java.lang.String getQName()
java.lang.String getLocalName()
int indexOf(java.lang.Object child)
child
- Child.java.lang.Object lastElement()
java.lang.Object firstElement()
java.lang.Object getAttribute(java.lang.String name)
name
- Attribute name.java.lang.String getAttrAsString(java.lang.String name)
name
- Attribute name.java.lang.String getAttrAsString(java.lang.String name, boolean inherit)
name
- Name of attribute.inherit
- True if attribute can be defined by a parent node.java.lang.Object getAttribute(java.lang.String name, boolean inherit)
name
- Name of attribute.inherit
- True if attribute can be defined by a parent node.java.lang.String getContentText(boolean deep)
deep
- true, if sub-nodes shall be included.java.lang.String getNamespaceURI(java.lang.String prefix, boolean inherated)
prefix
- Prefix of namespace.inherated
- Regard also namespace definitions of parent nodes.java.util.Set<java.lang.String> getNamespacePrefixes(boolean inherated)
inherated
- Get also defined namespaces of parent nodes.void setNamespace(java.lang.String prefix, java.lang.String uri)
prefix
- Prefix of namespace.uri
- URI of namespace.java.lang.String getNamespacePrefix()
boolean isEmpty()
void clearInheratedAttributes()
boolean clearInheratedAttribute(java.lang.String name)
name
- Name of attribute.true
if attribute was cleared.boolean contains(Node child, boolean deep)
child
- Node.deep
- Search also in subnodes.true
if this node contains child
.void clearValue(java.lang.String name)
name
- Name of the attribute.boolean setAttribute(java.lang.String name, java.lang.Object value)
name
- Name of the attribute.value
- New value.void setAttributes(java.util.Map<java.lang.String,java.lang.Object> attributeMap)
attributeMap
- Map of attributes to values.java.util.List<Node> getElements(java.lang.String name, boolean deep)
name
- Tag of sub-node.deep
- true, if deep search.void fireSaxEvents(org.xml.sax.ContentHandler handler) throws org.xml.sax.SAXException
handler
- Content handler.org.xml.sax.SAXException
void addAttributeChangeListener(AttributeChangeListener l)
l
- Listener.void removeAttributeChangeListener(AttributeChangeListener l)
l
- Listener.© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.