AbstractElement is an abstract base class for tree
implementors to use for implementation inheritence.
| Modifier and Type | Field and Description |
|---|---|
| private static final DocumentFactory | DOCUMENT_FACTORY
Hides org. DocumentFactory instance used by default
|
| protected static final boolean | |
| protected static final boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(Visitor
Visitor is the visitor.Implements org.
|
| public void | add(Attribute
is the attribute to be added attribute)Implements org. Attribute to this element.
|
| public void | add(Node
is the given node to add node)Overrides org. Implements org. Node or throws IllegalAddException
if the given node is not of a valid type.
|
| public void | add(CDATA
is the CDATA to be added cdata)Implements org. CDATA to this element.
|
| public void | add(Comment
is the comment to be added comment)Overrides org. Implements org. Comment to this branch.
|
| public void | add(Element
is the element to be added element)Overrides org. Implements org. Element to this branch.
|
| public void | add(Entity
is the entity to be added entity)Implements org. Entity to this element.
|
| public void | add(Namespace
is the namespace to be added namespace)Implements org. Namespace to this element.
|
| public void | add(ProcessingInstruction
is the processing instruction to be added pi)Overrides org. Implements org. ProcessingInstruction to this branch.
|
| public void | add(Text
is the text to be added text)Implements org. Text to this element.
|
| public Element | addAttribute(String
is the name of the attribute whose value is to be added or
updated name, String is the attribute's value value)Implements org. |
| public Element | addAttribute(QName
is the fully qualified name of the attribute whose value is to
be added or updated qName, String is the attribute's value value)Implements org. |
| public Element | addCDATA(String
is the text for the cdata)CDATA node.Implements org. CDATA node with the given text to this element.
|
| public Element | addComment(String
is the text for the comment)Comment node.Implements org. Comment node with the given text to this
element.
|
| public Element | addElement(String
is the name for the name)Element node.Overrides org. Implements org. Element node with the given name to this branch
and returns a reference to the new node.
|
| public Element | addEntity(String
is the name for the name, String Entity node.is the text for the text)Entity node.Implements org. Entity node with the given name and text to
this element and returns a reference to the new node.
|
| public List | additionalNamespaces()
Implements org. getNamespace()method.
|
| public List | |
| public Element | addNamespace(String
is the prefix to use, which should not be null or blank prefix, String is the namespace URI uri)Implements org. |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public Element | addProcessingInstruction(String
is the target of the processing instruction target, String is the textual data (key/value pairs) of the processing
instruction data)Implements org. |
| public Element | addProcessingInstruction(String
is the target of the processing instruction target, Map<String, String> is a Map of the key / value pairs of the processing
instruction data)Implements org. |
| public Element | addText(String
is the text for the text)Text node.Implements org. Text node with the given text to this element.
|
| public void | appendAttributes(Element
is the element whose attributes will be added to me. element)Implements org. |
| public String | |
| public Attribute | attribute(int
DOCUMENT ME! index)Implements org. |
| public Attribute | attribute(String
DOCUMENT ME! name)Implements org. |
| public Attribute | attribute(QName
is the fully qualified name qName)Implements org. |
| public Attribute | |
| public int | |
| public Iterator | |
| protected abstract List | Returns: the internal List used to store attributes or creates one if one is not availableDOCUMENT ME! |
| protected abstract List | Returns: the internal List used to store attributes or creates one with the specified size if one is not availableDOCUMENT ME! attributeCount)DOCUMENT ME! |
| public List | attributes()
Implements org. Attributeinstances this element contains as a backed
Listso that the attributes may be modified directly using the
Listinterface.
|
| public String | attributeValue(String
is the name of the attribute value to be returned name)Implements org. |
| public String | attributeValue(QName
is the fully qualified name qName)Implements org. |
| public String | attributeValue(String
is the name of the attribute value to be returned name, String is the default value to be returned if the attribute has no
value defined. defaultValue)Implements org. |
| public String | attributeValue(QName
is the fully qualified name qName, String is the default value to be returned if the attribute has no
value defined. defaultValue)Implements org. |
| protected void | childAdded(Node
DOCUMENT ME! node)Implements abstract org. |
| protected void | childRemoved(Node
DOCUMENT ME! node)Implements abstract org. |
| protected List | Returns: DOCUMENT ME!A Factory Method pattern which creates a List implementation used to store attributes |
| protected List | Returns: DOCUMENT ME!DOCUMENT ME! size)A Factory Method pattern which creates a List implementation used to store attributes |
| public Element | Returns: the clone of this elementImplements org. This returns a deep clone of this element. |
| public Element | createCopy(String
DOCUMENT ME! name)Implements org. |
| public Element | createCopy(QName
DOCUMENT ME! qName)Implements org. |
| protected Element | |
| protected Element | |
| protected <T> Iterator | |
| public List | declaredNamespaces()
Implements org. |
| public Element | element(String
DOCUMENT ME! name)Implements org. |
| public Element | element(QName
is the fully qualified name to search for qName)Implements org. |
| public Element | |
| public Iterator | elementIterator()
Implements org. |
| public Iterator | elementIterator(String
DOCUMENT ME! name)Implements org. |
| public Iterator | elementIterator(QName
is the fully qualified name to search for qName)Implements org. |
| public Iterator | |
| public List | |
| public List | elements(String
DOCUMENT ME! name)Implements org. |
| public List | elements(QName
is the fully qualified name to search for qName)Implements org. |
| public List | |
| public String | |
| public String | |
| public String | |
| public String | |
| public void | ensureAttributesCapacity(int
DOCUMENT ME! minCapacity)Ensures that the list of attributes has the given size |
| public Object | getData()
Implements org. getText
|
| protected DocumentFactory | |
| public String | getName()
Overrides org. Implements org.
|
| public Namespace | getNamespace()
Implements org. Namespace of this element if one exists
otherwise Namespace.NO_NAMESPACE is returned.
|
| public Namespace | getNamespaceForPrefix(String
DOCUMENT ME! prefix)Implements org. Namespace which is mapped to the given prefix
or null if it could not be found.
|
| public Namespace | getNamespaceForURI(String
DOCUMENT ME! uri)Implements org. Namespace which is mapped to the given URI or
null if it could not be found.
|
| public String | getNamespacePrefix()
Implements org. String is returned.
|
| public List | getNamespacesForURI(String
DOCUMENT ME! uri)Implements org. |
| public String | getNamespaceURI()
Implements org. String is returned.
|
| public short | getNodeType()
Overrides org. Implements org. |
| public String | getPath(Element
is the parent context from which the relative path should
start. If the context is null or the context is not an
ancestor of this node then the path will be absolute and start
from the document and so begin with the '/' character. context)Implements org. |
| public QName | getQName(String
DOCUMENT ME! qualifiedName)Implements org. QName for the given qualified name, using the
namespace URI in scope for the given prefix of the qualified name or the
default namespace if the qualified name has no prefix.
|
| public String | getQualifiedName()
Implements org. |
| public String | getStringValue()
Overrides org. Implements org. |
| public String | getUniquePath(Element
is the parent context from which the path should start. If the
context is null or the context is not an ancestor of this node
then the path will start from the document and so begin with
the '/' character. context)Implements org. Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node. |
| public String | Returns: DOCUMENT ME!Returns the XPath expression to match this Elements name which is getQualifiedName() if there is a namespace prefix defined or if no namespace is present then it is getName() or if a namespace is defined with no prefix then the expression is [name()='X'] where X = getName(). |
| public Node | getXPathResult(int
DOCUMENT ME! index)Implements org. |
| public boolean | hasMixedContent()
Implements org. Element has mixed content.
|
| public int | indexOf(Node
the content child node to find. node)Overrides org. Implements org. |
| public boolean | |
| public boolean | isTextOnly()
Implements org. Element has text only content.
|
| public Node | node(int
the index of the node to return. index)Overrides org. Implements org. Node at the specified index position.
|
| public int | nodeCount()
Overrides org. Implements org. Node instances that this branch
contains.
|
| public Iterator | nodeIterator()
Overrides org. Implements org. |
| public void | normalize()
Implements org. Text nodes in the full depth of the sub-tree
underneath this Node, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments, processing
instructions, CDATA sections, and entity references) separates
Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes.
|
| public ProcessingInstruction | processingInstruction(String
DOCUMENT ME! target)Implements org. |
| public List | processingInstructions()
Implements org. |
| public List | processingInstructions(String
DOCUMENT ME! target)Implements org. |
| public boolean | remove(Attribute
is the attribute to be removed attribute)Implements org. Attribute from this element.
|
| public boolean | remove(Node
is the given node to be removed node)Overrides org. Implements org. Node if the node is an immediate child
of this branch.
|
| public boolean | remove(CDATA
is the CDATA to be removed cdata)Implements org. CDATA if the node is an immediate child
of this element.
|
| public boolean | remove(Comment
is the comment to be removed comment)Overrides org. Implements org. Comment if the node is an immediate
child of this branch.
|
| public boolean | remove(Element
is the element to be removed element)Overrides org. Implements org. Element if the node is an immediate
child of this branch.
|
| public boolean | remove(Entity
is the entity to be removed entity)Implements org. Entity if the node is an immediate child
of this element.
|
| public boolean | remove(Namespace
is the namespace to be removed namespace)Implements org. Namespace if the node is an immediate
child of this element.
|
| public boolean | remove(ProcessingInstruction
is the processing instruction to be removed pi)Overrides org. Implements org. ProcessingInstruction if the node is an
immediate child of this branch.
|
| public boolean | remove(Text
is the text to be removed text)Implements org. Text if the node is an immediate child
of this element.
|
| protected boolean | |
| public boolean | removeProcessingInstruction(String
DOCUMENT ME! target)Implements org. |
| public void | setAttributes(Attributes
DOCUMENT ME! attributes, NamespaceStack DOCUMENT ME! namespaceStack, boolean DOCUMENT ME! noNamespaceAttributes)This method provides a more optimal way of setting all the attributes on
an Element particularly for use in |
| public void | setAttributeValue(String
DOCUMENT ME! name, String DOCUMENT ME! value)Implements org.
Deprecated
As of version 0.5. Please use
DOCUMENT ME!
addAttribute(String, String) instead. WILL BE REMOVED IN
dom4j-1.6 !!
|
| public void | setAttributeValue(QName
DOCUMENT ME! qName, String DOCUMENT ME! value)Implements org.
Deprecated
As of version 0.5. Please use
DOCUMENT ME!
addAttribute(String, String) instead. WILL BE REMOVED IN
dom4j-1.6 !!
|
| public void | setData(Object
DOCUMENT ME! data)Implements org. setTextif it doesn't
|
| public void | setName(String
is the new name of this node name)Overrides org. Implements org.
Sets the text data of this node or this method will throw an
|
| public void | |
| public void | setText(String
is the new textual value of this node text)Overrides org. Implements org.
Sets the text data of this node or this method will throw an
|
| public String | |
| public void | write(Writer
is the out)Writer to output the XML toOverrides org. Implements org.
|