Save This Page
Home » dom4j-1.6.1 » org.dom4j.tree » [javadoc | source]
org.dom4j.tree
public class: FlyweightEntity [javadoc | source]
java.lang.Object
   org.dom4j.tree.AbstractNode
      org.dom4j.tree.AbstractEntity
         org.dom4j.tree.FlyweightEntity

All Implemented Interfaces:
    Entity, Cloneable, Node, Serializable

Direct Known Subclasses:
    DOMEntityReference, DefaultEntity

FlyweightEntity is a Flyweight pattern implementation of a singly linked, read-only XML entity.

This node could be shared across documents and elements though it does not support the parent relationship.

Often this node needs to be created and then the text content added later (for example in SAX) so this implementation allows a call to {@link#setText} providing the entity has no text already.

Field Summary
protected  String name    The name of the Entity 
protected  String text    The text of the Entity 
Fields inherited from org.dom4j.tree.AbstractNode:
NODE_TYPE_NAMES
Constructor:
 protected FlyweightEntity() 
 public FlyweightEntity(String name) 
    Creates the Entity with the specified name
    Parameters:
    name - is the name of the entity
 public FlyweightEntity(String name,
    String text) 
    Creates the Entity with the specified name and text.
    Parameters:
    name - is the name of the entity
    text - is the text of the entity
Method from org.dom4j.tree.FlyweightEntity Summary:
createXPathResult,   getName,   getText,   setText
Methods from org.dom4j.tree.AbstractEntity:
accept,   asXML,   getNodeType,   getPath,   getStringValue,   getUniquePath,   toString,   write
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
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.dom4j.tree.FlyweightEntity Detail:
 protected Node createXPathResult(Element parent) 
 public String getName() 
    DOCUMENT ME!
 public String getText() 
    DOCUMENT ME!
 public  void setText(String text) 
    sets the value of the entity if it is not defined yet otherwise an UnsupportedOperationException is thrown as this class is read only.