org.dom4j.tree
abstract public class: AbstractEntity [javadoc |
source]
java.lang.Object
org.dom4j.tree.AbstractNode
org.dom4j.tree.AbstractEntity
All Implemented Interfaces:
Entity, Cloneable, Node, Serializable
Direct Known Subclasses:
FlyweightEntity, DOMEntityReference, DefaultEntity
AbstractEntity is an abstract base class for tree implementors
to use for implementation inheritence.
- author:
< - a href="mailto:james.strachan@metastuff.com">James Strachan
- version:
$ - Revision: 1.15 $
| Methods from org.dom4j.tree.AbstractNode: |
|---|
|
asXPathResult, clone, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getDocument, getDocumentFactory, getName, getNodeType, getNodeTypeName, getParent, getPath, getStringValue, getText, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write |
| Method from org.dom4j.tree.AbstractEntity Detail: |
public void accept(Visitor visitor) {
visitor.visit(this);
}
|
public String asXML() {
return "&" + getName() + ";";
}
|
public short getNodeType() {
return ENTITY_REFERENCE_NODE;
}
|
public String getPath(Element context) {
// From XPaths perspective, entities are included in text
Element parent = getParent();
return ((parent != null) && (parent != context)) ? (parent
.getPath(context) + "/text()") : "text()";
}
|
public String getStringValue() {
return "&" + getName() + ";";
}
|
public String getUniquePath(Element context) {
// From XPaths perspective, entities are included in text
Element parent = getParent();
return ((parent != null) && (parent != context)) ? (parent
.getUniquePath(context) + "/text()") : "text()";
}
|
public String toString() {
return super.toString() + " [Entity: &" + getName() + ";]";
}
|
public void write(Writer writer) throws IOException {
writer.write("&");
writer.write(getName());
writer.write(";");
}
|