Top Description Fields Constructors Methods
org.dom4j.tree

public Class DefaultElement

extends AbstractElement
Class Inheritance
Known Direct Subclasses
org.dom4j.util.IndexedElement, org.dom4j.util.UserDataElement, org.dom4j.bean.BeanElement, org.dom4j.datatype.DatatypeElement, org.dom4j.dom.DOMElement
Imports
org.dom4j.*, java.util.ArrayList, .Collections, .Iterator, .List

DefaultElement is the default DOM4J default implementation of an XML element.

Author
James Strachan
Version
$Revision: 1.59 $

Field Summary

Modifier and TypeField and Description
private Object
attributes

Lazily constructes list of attributes

private Object
content

Stores null for no content, a Node for a single content node or a List for multiple content nodes.

private static final transient DocumentFactory
DOCUMENT_FACTORY

Hides org.dom4j.tree.AbstractElement.DOCUMENT_FACTORY.

The DocumentFactory instance used by default
private Branch
parentBranch

Stores the parent branch of this node which is either a Document if this element is the root element in a document, or another Element if it is a child of the root document, or null if it has not been added to a document yet.

private QName
qname

The QName for this element

Inherited from org.dom4j.tree.AbstractElement:
USE_STRINGVALUE_SEPARATORVERBOSE_TOSTRING

Constructor Summary

AccessConstructor and Description
public
public
public
DefaultElement(QName qname, int attributeCount)

public
DefaultElement(String name, Namespace namespace)

Method Summary

Modifier and TypeMethod and Description
public void
add(Attribute
is the attribute to be added
attribute
)

Overrides org.dom4j.tree.AbstractElement.add.

Implements org.dom4j.Element.add.

Adds the given Attribute to this element.
public List<Namespace>
additionalNamespaces()

Overrides org.dom4j.tree.AbstractElement.additionalNamespaces.

Implements org.dom4j.Element.additionalNamespaces.

Returns any additional namespaces declarations for this element other than namespace returned via the getNamespace()method.
public List<Namespace>
protected void
addNewNode(Node
DOCUMENT ME!
node
)

Overrides org.dom4j.tree.AbstractElement.addNewNode.

Like addNode() but does not require a parent check
public Attribute
attribute(int
DOCUMENT ME!
index
)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

Returns the attribute at the specified indexGets the
public Attribute
attribute(String
DOCUMENT ME!
name
)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

Returns the attribute with the given name
public Attribute
attribute(QName
is the fully qualified name
qName
)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

DOCUMENT ME!
public Attribute
public int
public Iterator<Attribute>
protected List<Attribute>
protected List<Attribute>
attributeList(int
DOCUMENT ME!
size
)

Implements abstract org.dom4j.tree.AbstractElement.attributeList.

DOCUMENT ME!
public List<Attribute>
attributes()

Overrides org.dom4j.tree.AbstractElement.attributes.

Implements org.dom4j.Element.attributes.

Returns the Attributeinstances this element contains as a backed Listso that the attributes may be modified directly using the Listinterface.
public void
clearContent()

Implements org.dom4j.Branch.clearContent.

Clears the content for this branch, removing any Node instances this branch may contain.
public Object
clone()

Overrides org.dom4j.tree.AbstractNode.clone.

Implements org.dom4j.Node.clone.

clone will return a deep clone or if this node is read-only then clone will return the same instance.

protected List<Node>
contentList()

Implements abstract org.dom4j.tree.AbstractBranch.contentList.

DOCUMENT ME!
public List<Namespace>
declaredNamespaces()

Overrides org.dom4j.tree.AbstractElement.declaredNamespaces.

Implements org.dom4j.Element.declaredNamespaces.

Returns all the namespaces declared by this element.
public Element
element(String
DOCUMENT ME!
name
)

Overrides org.dom4j.tree.AbstractElement.element.

Implements org.dom4j.Element.element.

Returns the first element for the given local name and any namespace.
public Element
element(QName
is the fully qualified name to search for
qName
)

Overrides org.dom4j.tree.AbstractElement.element.

Implements org.dom4j.Element.element.

Returns the first element for the given fully qualified name.
public Element
public Document
getDocument()

Overrides org.dom4j.tree.AbstractNode.getDocument.

Implements org.dom4j.Node.getDocument.

getDocument returns the Document that this Node is part of if this node supports the parent relationship.

protected DocumentFactory
public Namespace
getNamespaceForPrefix(String
DOCUMENT ME!
prefix
)

Overrides org.dom4j.tree.AbstractElement.getNamespaceForPrefix.

Implements org.dom4j.Element.getNamespaceForPrefix.

Returns the Namespace which is mapped to the given prefix or null if it could not be found.
public Namespace
getNamespaceForURI(String
DOCUMENT ME!
uri
)

Overrides org.dom4j.tree.AbstractElement.getNamespaceForURI.

Implements org.dom4j.Element.getNamespaceForURI.

Returns the Namespace which is mapped to the given URI or null if it could not be found.
public Element
getParent()

Overrides org.dom4j.tree.AbstractNode.getParent.

Implements org.dom4j.Node.getParent.

getParent returns the parent Element if this node supports the parent relationship or null if it is the root element or does not support the parent relationship.

public QName
getQName()

Implements org.dom4j.Element.getQName.

Returns the QName of this element which represents the local name, the qualified name and the Namespace.
public String
public String
getText()

Overrides org.dom4j.tree.AbstractBranch.getText.

Implements org.dom4j.Element.getText, org.dom4j.Node.getText.

Returns the text value of this element without recursing through child elements.
public int
indexOf(Node
the content child node to find.
node
)

Overrides org.dom4j.tree.AbstractElement.indexOf.

Implements org.dom4j.Branch.indexOf.

Returns the index of the given node if it is a child node of this branch or -1 if the given node is not a child node.
public Node
node(int
the index of the node to return.
index
)

Overrides org.dom4j.tree.AbstractElement.node.

Implements org.dom4j.Branch.node.

Returns the Node at the specified index position.
public int
nodeCount()

Overrides org.dom4j.tree.AbstractElement.nodeCount.

Implements org.dom4j.Branch.nodeCount.

Returns the number of Node instances that this branch contains.
public Iterator<Node>
nodeIterator()

Overrides org.dom4j.tree.AbstractElement.nodeIterator.

Implements org.dom4j.Branch.nodeIterator.

Returns an iterator through the content nodes of this branch
public ProcessingInstruction
public List<ProcessingInstruction>
processingInstructions()

Overrides org.dom4j.tree.AbstractElement.processingInstructions.

Implements org.dom4j.Branch.processingInstructions.

Returns a list of all the processing instructions in this branch.
public List<ProcessingInstruction>
processingInstructions(String
DOCUMENT ME!
target
)

Overrides org.dom4j.tree.AbstractElement.processingInstructions.

Implements org.dom4j.Branch.processingInstructions.

Returns a list of the processing instructions for the given target.
public boolean
remove(Attribute
is the attribute to be removed
attribute
)

Overrides org.dom4j.tree.AbstractElement.remove.

Implements org.dom4j.Element.remove.

Removes the given Attribute from this element.
protected boolean
public boolean
removeProcessingInstruction(String
DOCUMENT ME!
target
)

Overrides org.dom4j.tree.AbstractElement.removeProcessingInstruction.

Implements org.dom4j.Branch.removeProcessingInstruction.

Removes the processing instruction for the given target if it exists
protected void
public void
setAttributes(List<Attribute>
DOCUMENT ME!
attributes
)

Implements org.dom4j.Element.setAttributes.

Sets the attributes that this element contains
public void
setContent(List<Node>
is the list of nodes to use as the content for this branch.
content
)

Implements org.dom4j.Branch.setContent.

Sets the contents of this branch as a List of Node instances.
public void
setDocument(Document
is the new document of this node.
document
)

Overrides org.dom4j.tree.AbstractNode.setDocument.

Implements org.dom4j.Node.setDocument.

setDocument sets the document of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

public void
setParent(Element
is the new parent of this node.
parent
)

Overrides org.dom4j.tree.AbstractNode.setParent.

Implements org.dom4j.Node.setParent.

setParent sets the parent relationship of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

public void
setQName(QName
is the QName to be associated with this element
name
)

Implements org.dom4j.Element.setQName.

Sets the QName of this element which represents the local name, the qualified name and the Namespace.
public boolean
supportsParent()

Overrides org.dom4j.tree.AbstractNode.supportsParent.

Implements org.dom4j.Node.supportsParent.

supportsParent returns true if this node supports the parent relationship.

Inherited from org.dom4j.tree.AbstractElement:
acceptaddaddaddaddaddaddaddaddaddAttributeaddAttributeaddCDATAaddCommentaddElementaddEntityaddNamespaceaddNewNodeaddNodeaddNodeaddProcessingInstructionaddProcessingInstructionaddTextappendAttributesasXMLattributeValueattributeValueattributeValueattributeValuechildAddedchildRemovedcreateAttributeListcreateAttributeListcreateCopycreateCopycreateCopycreateElementcreateElementcreateSingleIteratorelementIteratorelementIteratorelementIteratorelementIteratorelementselementselementselementselementTextelementTextelementTextTrimelementTextTrimensureAttributesCapacitygetDatagetNamegetNamespacegetNamespacePrefixgetNamespacesForURIgetNamespaceURIgetNodeTypegetPathgetQNamegetQualifiedNamegetUniquePathgetXPathNameStepgetXPathResulthasMixedContentisRootElementisTextOnlynormalizeremoveremoveremoveremoveremoveremoveremoveremovesetAttributessetAttributeValuesetAttributeValuesetDatasetNamesetNamespacesetTexttoStringwrite

Field Detail

attributesback to summary
private Object attributes

Lazily constructes list of attributes

contentback to summary
private Object content

Stores null for no content, a Node for a single content node or a List for multiple content nodes. The List will be lazily constructed when required.

DOCUMENT_FACTORYback to summary
private static final transient DocumentFactory DOCUMENT_FACTORY

Hides org.dom4j.tree.AbstractElement.DOCUMENT_FACTORY.

The DocumentFactory instance used by default

parentBranchback to summary
private Branch parentBranch

Stores the parent branch of this node which is either a Document if this element is the root element in a document, or another Element if it is a child of the root document, or null if it has not been added to a document yet.

qnameback to summary
private QName qname

The QName for this element

Constructor Detail

DefaultElementback to summary
public DefaultElement(String name)
DefaultElementback to summary
public DefaultElement(QName qname)
DefaultElementback to summary
public DefaultElement(QName qname, int attributeCount)
DefaultElementback to summary
public DefaultElement(String name, Namespace namespace)

Method Detail

addback to summary
public void add(Attribute attribute)

Overrides org.dom4j.tree.AbstractElement.add.

Implements org.dom4j.Element.add.

Doc from org.dom4j.Element.add.

Adds the given Attribute to this element. If the given node already has a parent defined then an IllegalAddException will be thrown. Attributes with null values are silently ignored. If the value of the attribute is null then this method call will remove any attributes with the QName of this attribute.

Parameters
attribute:Attribute

is the attribute to be added

additionalNamespacesback to summary
public List<Namespace> additionalNamespaces()

Overrides org.dom4j.tree.AbstractElement.additionalNamespaces.

Implements org.dom4j.Element.additionalNamespaces.

Doc from org.dom4j.Element.additionalNamespaces.

Returns any additional namespaces declarations for this element other than namespace returned via the getNamespace()method. If no additional namespace declarations are present for this element then an empty list will be returned. The list is backed by the element such that changes to the list will be reflected in the element though the reverse is not the case.

Returns:List<Namespace>

a list of any additional namespace declarations.

additionalNamespacesback to summary
public List<Namespace> additionalNamespaces(String defaultNamespaceURI)

Overrides org.dom4j.tree.AbstractElement.additionalNamespaces.

addNewNodeback to summary
protected void addNewNode(Node node)

Overrides org.dom4j.tree.AbstractElement.addNewNode.

Doc from org.dom4j.tree.AbstractElement.addNewNode.

Like addNode() but does not require a parent check

Parameters
node:Node

DOCUMENT ME!

attributeback to summary
public Attribute attribute(int index)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

Doc from org.dom4j.Element.attribute.

Returns the attribute at the specified indexGets the

Parameters
index:int

DOCUMENT ME!

Returns:Attribute

the attribute at the specified index where index >= 0 and index < number of attributes or throws an IndexOutOfBoundsException if the index is not within the allowable range

attributeback to summary
public Attribute attribute(String name)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

Doc from org.dom4j.Element.attribute.

Returns the attribute with the given name

Parameters
name:String

DOCUMENT ME!

Returns:Attribute

the attribute for the given local name in any namespace. If there are more than one attributes with the given local name in different namespaces then the first one is returned.

attributeback to summary
public Attribute attribute(QName qName)

Overrides org.dom4j.tree.AbstractElement.attribute.

Implements org.dom4j.Element.attribute.

Doc from org.dom4j.Element.attribute.

DOCUMENT ME!

Parameters
qName:QName

is the fully qualified name

Returns:Attribute

the attribute for the given fully qualified name or null if it could not be found.

attributeback to summary
public Attribute attribute(String name, Namespace namespace)

Overrides org.dom4j.tree.AbstractElement.attribute.

attributeCountback to summary
public int attributeCount()

Overrides org.dom4j.tree.AbstractElement.attributeCount.

Implements org.dom4j.Element.attributeCount.

Doc from org.dom4j.Element.attributeCount.

DOCUMENT ME!

Returns:int

the number of attributes this element contains

attributeIteratorback to summary
public Iterator<Attribute> attributeIterator()

Overrides org.dom4j.tree.AbstractElement.attributeIterator.

Implements org.dom4j.Element.attributeIterator.

Doc from org.dom4j.Element.attributeIterator.

DOCUMENT ME!

Returns:Iterator<Attribute>

an iterator over the attributes of this element

attributeListback to summary
protected List<Attribute> attributeList()

Implements abstract org.dom4j.tree.AbstractElement.attributeList.

Doc from org.dom4j.tree.AbstractElement.attributeList.

DOCUMENT ME!

Returns:List<Attribute>

the internal List used to store attributes or creates one if one is not available

attributeListback to summary
protected List<Attribute> attributeList(int size)

Implements abstract org.dom4j.tree.AbstractElement.attributeList.

Doc from org.dom4j.tree.AbstractElement.attributeList.

DOCUMENT ME!

Parameters
size:int

DOCUMENT ME!

Returns:List<Attribute>

the internal List used to store attributes or creates one with the specified size if one is not available

attributesback to summary
public List<Attribute> attributes()

Overrides org.dom4j.tree.AbstractElement.attributes.

Implements org.dom4j.Element.attributes.

Doc from org.dom4j.Element.attributes.

Returns the Attributeinstances this element contains as a backed Listso that the attributes may be modified directly using the Listinterface. The List is backed by the Element so that changes to the list are reflected in the element and vice versa.

Returns:List<Attribute>

the attributes that this element contains as a List

clearContentback to summary
public void clearContent()

Implements org.dom4j.Branch.clearContent.

Doc from org.dom4j.Branch.clearContent.

Clears the content for this branch, removing any Node instances this branch may contain.

cloneback to summary
public Object clone()

Overrides org.dom4j.tree.AbstractNode.clone.

Implements org.dom4j.Node.clone.

Doc from org.dom4j.Node.clone.

clone will return a deep clone or if this node is read-only then clone will return the same instance.

Returns:Object

a deep clone of myself or myself if I am read only.

contentListback to summary
protected List<Node> contentList()

Implements abstract org.dom4j.tree.AbstractBranch.contentList.

Doc from org.dom4j.tree.AbstractBranch.contentList.

DOCUMENT ME!

Returns:List<Node>

the internal List used to manage the content

declaredNamespacesback to summary
public List<Namespace> declaredNamespaces()

Overrides org.dom4j.tree.AbstractElement.declaredNamespaces.

Implements org.dom4j.Element.declaredNamespaces.

Doc from org.dom4j.Element.declaredNamespaces.

Returns all the namespaces declared by this element. If no namespaces are declared for this element then an empty list will be returned. The list is backed by the element such that changes to the list will be reflected in the element though the reverse is not the case.

Returns:List<Namespace>

a list of namespaces declared for this element.

elementback to summary
public Element element(String name)

Overrides org.dom4j.tree.AbstractElement.element.

Implements org.dom4j.Element.element.

Doc from org.dom4j.Element.element.

Returns the first element for the given local name and any namespace.

Parameters
name:String

DOCUMENT ME!

Returns:Element

the first element with the given local name

elementback to summary
public Element element(QName qName)

Overrides org.dom4j.tree.AbstractElement.element.

Implements org.dom4j.Element.element.

Doc from org.dom4j.Element.element.

Returns the first element for the given fully qualified name.

Parameters
qName:QName

is the fully qualified name to search for

Returns:Element

the first element with the given fully qualified name

elementback to summary
public Element element(String name, Namespace namespace)

Overrides org.dom4j.tree.AbstractElement.element.

getDocumentback to summary
public Document getDocument()

Overrides org.dom4j.tree.AbstractNode.getDocument.

Implements org.dom4j.Node.getDocument.

Doc from org.dom4j.Node.getDocument.

getDocument returns the Document that this Node is part of if this node supports the parent relationship.

This method is an optional feature and may not be supported for all Node implementations.

Returns:Document

the document of this node or null if this feature is not supported or the node is not associated with a Document

getDocumentFactoryback to summary
protected DocumentFactory getDocumentFactory()

Overrides org.dom4j.tree.AbstractElement.getDocumentFactory.

getNamespaceForPrefixback to summary
public Namespace getNamespaceForPrefix(String prefix)

Overrides org.dom4j.tree.AbstractElement.getNamespaceForPrefix.

Implements org.dom4j.Element.getNamespaceForPrefix.

Doc from org.dom4j.Element.getNamespaceForPrefix.

Returns the Namespace which is mapped to the given prefix or null if it could not be found.

Parameters
prefix:String

DOCUMENT ME!

Returns:Namespace

the Namespace associated with the given prefix

getNamespaceForURIback to summary
public Namespace getNamespaceForURI(String uri)

Overrides org.dom4j.tree.AbstractElement.getNamespaceForURI.

Implements org.dom4j.Element.getNamespaceForURI.

Doc from org.dom4j.Element.getNamespaceForURI.

Returns the Namespace which is mapped to the given URI or null if it could not be found. If there is more than one Namespace mapped to the URI, which of them will be returned is undetermined.

Parameters
uri:String

DOCUMENT ME!

Returns:Namespace

the Namespace associated with the given URI

getParentback to summary
public Element getParent()

Overrides org.dom4j.tree.AbstractNode.getParent.

Implements org.dom4j.Node.getParent.

Doc from org.dom4j.Node.getParent.

getParent returns the parent Element if this node supports the parent relationship or null if it is the root element or does not support the parent relationship.

This method is an optional feature and may not be supported for all Node implementations.

Returns:Element

the parent of this node or null if it is the root of the tree or the parent relationship is not supported.

getQNameback to summary
public QName getQName()

Implements org.dom4j.Element.getQName.

Doc from org.dom4j.Element.getQName.

Returns the QName of this element which represents the local name, the qualified name and the Namespace.

Returns:QName

the QName associated with this element

getStringValueback to summary
public String getStringValue()

Overrides org.dom4j.tree.AbstractElement.getStringValue.

Implements org.dom4j.Element.getStringValue, org.dom4j.Node.getStringValue.

Doc from org.dom4j.Element.getStringValue.

Returns the XPath string-value of this node. The behaviour of this method is defined in the XPath specification . This method returns the string-value of all the contained Text,CDATA,Entityand Element nodes all appended together.

Returns:String

the text from all the child Text and Element nodes appended together.

getTextback to summary
public String getText()

Overrides org.dom4j.tree.AbstractBranch.getText.

Implements org.dom4j.Element.getText, org.dom4j.Node.getText.

Doc from org.dom4j.Element.getText.

Returns the text value of this element without recursing through child elements. This method iterates through all Text,CDATA and Entitynodes that this element contains and appends the text values together.

Returns:String

the textual content of this Element. Child elements are not navigated. This method does not return null;

indexOfback to summary
public int indexOf(Node node)

Overrides org.dom4j.tree.AbstractElement.indexOf.

Implements org.dom4j.Branch.indexOf.

Doc from org.dom4j.Branch.indexOf.

Returns the index of the given node if it is a child node of this branch or -1 if the given node is not a child node.

Parameters
node:Node

the content child node to find.

Returns:int

the index of the given node starting at 0 or -1 if the node is not a child node of this branch

nodeback to summary
public Node node(int index)

Overrides org.dom4j.tree.AbstractElement.node.

Implements org.dom4j.Branch.node.

Doc from org.dom4j.Branch.node.

Returns the Node at the specified index position.

Parameters
index:int

the index of the node to return.

Returns:Node

the Node at the specified position.

nodeCountback to summary
public int nodeCount()

Overrides org.dom4j.tree.AbstractElement.nodeCount.

Implements org.dom4j.Branch.nodeCount.

Doc from org.dom4j.Branch.nodeCount.

Returns the number of Node instances that this branch contains.

Returns:int

the number of nodes this branch contains

nodeIteratorback to summary
public Iterator<Node> nodeIterator()

Overrides org.dom4j.tree.AbstractElement.nodeIterator.

Implements org.dom4j.Branch.nodeIterator.

Doc from org.dom4j.Branch.nodeIterator.

Returns an iterator through the content nodes of this branch

Returns:Iterator<Node>

an iterator through the content nodes of this branch

processingInstructionback to summary
public ProcessingInstruction processingInstruction(String target)

Overrides org.dom4j.tree.AbstractElement.processingInstruction.

Implements org.dom4j.Branch.processingInstruction.

Doc from org.dom4j.Branch.processingInstruction.

DOCUMENT ME!

Parameters
target:String

DOCUMENT ME!

Returns:ProcessingInstruction

the processing instruction for the given target

processingInstructionsback to summary
public List<ProcessingInstruction> processingInstructions()

Overrides org.dom4j.tree.AbstractElement.processingInstructions.

Implements org.dom4j.Branch.processingInstructions.

Doc from org.dom4j.Branch.processingInstructions.

Returns a list of all the processing instructions in this branch. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.

Returns:List<ProcessingInstruction>

a backed list of the processing instructions

processingInstructionsback to summary
public List<ProcessingInstruction> processingInstructions(String target)

Overrides org.dom4j.tree.AbstractElement.processingInstructions.

Implements org.dom4j.Branch.processingInstructions.

Doc from org.dom4j.Branch.processingInstructions.

Returns a list of the processing instructions for the given target. The list is backed by this branch so that changes to the list will be reflected in the branch but the reverse is not the case.

Parameters
target:String

DOCUMENT ME!

Returns:List<ProcessingInstruction>

a backed list of the processing instructions

removeback to summary
public boolean remove(Attribute attribute)

Overrides org.dom4j.tree.AbstractElement.remove.

Implements org.dom4j.Element.remove.

Doc from org.dom4j.Element.remove.

Removes the given Attribute from this element.

Parameters
attribute:Attribute

is the attribute to be removed

Returns:boolean

true if the attribute was removed

removeNodeback to summary
protected boolean removeNode(Node node)

Overrides org.dom4j.tree.AbstractElement.removeNode.

removeProcessingInstructionback to summary
public boolean removeProcessingInstruction(String target)

Overrides org.dom4j.tree.AbstractElement.removeProcessingInstruction.

Implements org.dom4j.Branch.removeProcessingInstruction.

Doc from org.dom4j.Branch.removeProcessingInstruction.

Removes the processing instruction for the given target if it exists

Parameters
target:String

DOCUMENT ME!

Returns:boolean

true if a processing instruction was removed else false

setAttributeListback to summary
protected void setAttributeList(List<Attribute> attributeList)
setAttributesback to summary
public void setAttributes(List<Attribute> attributes)

Implements org.dom4j.Element.setAttributes.

Doc from org.dom4j.Element.setAttributes.

Sets the attributes that this element contains

Parameters
attributes:List<Attribute>

DOCUMENT ME!

setContentback to summary
public void setContent(List<Node> content)

Implements org.dom4j.Branch.setContent.

Doc from org.dom4j.Branch.setContent.

Sets the contents of this branch as a List of Node instances.

Parameters
content:List<Node>

is the list of nodes to use as the content for this branch.

setDocumentback to summary
public void setDocument(Document document)

Overrides org.dom4j.tree.AbstractNode.setDocument.

Implements org.dom4j.Node.setDocument.

Doc from org.dom4j.Node.setDocument.

setDocument sets the document of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

This method should only be called from inside a Document implementation method and is not intended for general use.

Parameters
document:Document

is the new document of this node.

setParentback to summary
public void setParent(Element parent)

Overrides org.dom4j.tree.AbstractNode.setParent.

Implements org.dom4j.Node.setParent.

Doc from org.dom4j.Node.setParent.

setParent sets the parent relationship of this node if the parent relationship is supported or does nothing if the parent relationship is not supported.

This method should only be called from inside an Element implementation method and is not intended for general use.

Parameters
parent:Element

is the new parent of this node.

setQNameback to summary
public void setQName(QName name)

Implements org.dom4j.Element.setQName.

Doc from org.dom4j.Element.setQName.

Sets the QName of this element which represents the local name, the qualified name and the Namespace.

Parameters
name:QName

is the QName to be associated with this element

supportsParentback to summary
public boolean supportsParent()

Overrides org.dom4j.tree.AbstractNode.supportsParent.

Implements org.dom4j.Node.supportsParent.

Doc from org.dom4j.Node.supportsParent.

supportsParent returns true if this node supports the parent relationship.

Some XML tree implementations are singly linked and only support downward navigation through children relationships. The default case is that both parent and children relationships are supported though for memory and performance reasons the parent relationship may not be supported.

Returns:boolean

true if this node supports the parent relationship or false it is not supported