Top Description Fields Constructors Methods
org.dom4j.tree

public abstract Class AbstractCharacterData

extends AbstractNode
implements CharacterData
Class Inheritance
All Implemented Interfaces
org.dom4j.CharacterData, org.dom4j.Node, java.lang.Cloneable
Known Direct Subclasses
org.dom4j.tree.AbstractComment, org.dom4j.tree.AbstractText, org.dom4j.tree.AbstractCDATA
Imports
org.dom4j.CharacterData, .Element

AbstractCharacterData is an abstract base class for tree implementors to use for implementation inheritence.

Author
James Strachan
Version
$Revision: 1.12 $

Field Summary

Inherited from org.dom4j.tree.AbstractNode:
NODE_TYPE_NAMES

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
appendText(String
the text to append
text
)

Implements org.dom4j.CharacterData.appendText.

Appends the given text to this nodes text value.
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.dom4j.Node.getPath.

Returns the relative XPath expression which will return a node set containing the given node such as a/b/@c.
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.dom4j.Node.getUniquePath.

Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node.

Inherited from org.dom4j.tree.AbstractNode:
asXPathResultclonecreatePatterncreateXPathcreateXPathFiltercreateXPathResultdetachgetDocumentgetDocumentFactorygetNamegetNodeTypegetNodeTypeNamegetParentgetPathgetStringValuegetTextgetUniquePathhasContentisReadOnlymatchesnumberValueOfselectNodesselectNodesselectNodesselectObjectselectSingleNodesetDocumentsetNamesetParentsetTextsupportsParentvalueOfwrite

Constructor Detail

AbstractCharacterDataback to summary
public AbstractCharacterData()

Method Detail

appendTextback to summary
public void appendText(String text)

Implements org.dom4j.CharacterData.appendText.

Doc from org.dom4j.CharacterData.appendText.

Appends the given text to this nodes text value. Calling this method is equivalent of the code node.setText(node.getText() + text) but allows for possible implementation optimisations (such as a text based node storing a StringBuffer internally

Parameters
text:String

the text to append

getPathback to summary
public String getPath(Element context)

Implements org.dom4j.Node.getPath.

Doc from org.dom4j.Node.getPath.

Returns the relative XPath expression which will return a node set containing the given node such as a/b/@c. No indexing will be used to restrict the path if multiple elements with the same name occur on the path.

Parameters
context: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.

Returns:String

the XPath expression relative to the given context which will return a nodeset containing at least this node.

getUniquePathback to summary
public String getUniquePath(Element context)

Implements org.dom4j.Node.getUniquePath.

Doc from org.dom4j.Node.getUniquePath.

Returns the relative unique XPath expression from the given context which will return a nodeset of one node which is the current node. This method will use the XPath index operator to restrict the path if multiple elements with the same name occur on the path.

Parameters
context: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.

Returns:String

the XPath expression relative to the given context which will return a nodeset containing just this node.