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

All Implemented Interfaces:
    Element, Branch, Cloneable, Node, Serializable

Direct Known Subclasses:
    BaseElement, NonLazyElement, DatatypeElement, DefaultElement, DOMElement, UserDataElement, BeanElement, LElement, IndexedElement

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

Field Summary
protected static final  List EMPTY_LIST     
protected static final  Iterator EMPTY_ITERATOR     
protected static final  boolean VERBOSE_TOSTRING     
protected static final  boolean USE_STRINGVALUE_SEPARATOR     
Fields inherited from org.dom4j.tree.AbstractBranch:
DEFAULT_CONTENT_LIST_SIZE
Fields inherited from org.dom4j.tree.AbstractNode:
NODE_TYPE_NAMES
Constructor:
 public AbstractElement() 
Method from org.dom4j.tree.AbstractElement Summary:
accept,   add,   add,   add,   add,   add,   add,   add,   add,   add,   addAttribute,   addAttribute,   addCDATA,   addComment,   addElement,   addEntity,   addNamespace,   addNewNode,   addNewNode,   addNode,   addNode,   addProcessingInstruction,   addProcessingInstruction,   addText,   additionalNamespaces,   additionalNamespaces,   appendAttributes,   asXML,   attribute,   attribute,   attribute,   attribute,   attributeCount,   attributeIterator,   attributeList,   attributeList,   attributeValue,   attributeValue,   attributeValue,   attributeValue,   attributes,   childAdded,   childRemoved,   createAttributeList,   createAttributeList,   createCopy,   createCopy,   createCopy,   createElement,   createElement,   createSingleIterator,   declaredNamespaces,   element,   element,   element,   elementIterator,   elementIterator,   elementIterator,   elementIterator,   elementText,   elementText,   elementTextTrim,   elementTextTrim,   elements,   elements,   elements,   elements,   ensureAttributesCapacity,   getData,   getDocumentFactory,   getName,   getNamespace,   getNamespaceForPrefix,   getNamespaceForURI,   getNamespacePrefix,   getNamespaceURI,   getNamespacesForURI,   getNodeType,   getPath,   getQName,   getQualifiedName,   getStringValue,   getUniquePath,   getXPathNameStep,   getXPathResult,   hasMixedContent,   indexOf,   isRootElement,   isTextOnly,   node,   nodeCount,   nodeIterator,   normalize,   processingInstruction,   processingInstructions,   processingInstructions,   remove,   remove,   remove,   remove,   remove,   remove,   remove,   remove,   remove,   removeNode,   removeProcessingInstruction,   setAttributeValue,   setAttributeValue,   setAttributes,   setData,   setName,   setNamespace,   setText,   toString,   write
Methods from org.dom4j.tree.AbstractBranch:
add,   add,   add,   add,   addElement,   addElement,   addElement,   addElement,   addNode,   addNode,   appendContent,   childAdded,   childRemoved,   content,   contentList,   contentRemoved,   createContentList,   createContentList,   createEmptyList,   createResultList,   createSingleResultList,   elementByID,   elementID,   getContentAsStringValue,   getContentAsText,   getText,   getTextTrim,   hasContent,   indexOf,   invalidNodeTypeAddException,   isReadOnly,   node,   nodeCount,   nodeIterator,   remove,   remove,   remove,   remove,   removeNode,   setProcessingInstructions
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.AbstractElement Detail:
 public  void accept(Visitor visitor) 

    accept method is the Visitor Pattern method.

 public  void add(Attribute attribute) 
 public  void add(Node node) 
 public  void add(CDATA cdata) 
 public  void add(Comment comment) 
 public  void add(Element element) 
 public  void add(Entity entity) 
 public  void add(Namespace namespace) 
 public  void add(ProcessingInstruction pi) 
 public  void add(Text text) 
 public Element addAttribute(String name,
    String value) 
 public Element addAttribute(QName qName,
    String value) 
 public Element addCDATA(String cdata) 
 public Element addComment(String comment) 
 public Element addElement(String name) 
 public Element addEntity(String name,
    String text) 
 public Element addNamespace(String prefix,
    String uri) 
 protected  void addNewNode(Node node) 
    Like addNode() but does not require a parent check
 protected  void addNewNode(int index,
    Node node) 
 protected  void addNode(Node node) 
 protected  void addNode(int index,
    Node node) 
 public Element addProcessingInstruction(String target,
    String data) 
 public Element addProcessingInstruction(String target,
    Map data) 
 public Element addText(String text) 
 public List additionalNamespaces() 
 public List additionalNamespaces(String defaultNamespaceURI) 
 public  void appendAttributes(Element element) 
 public String asXML() 
 public Attribute attribute(int index) 
 public Attribute attribute(String name) 
 public Attribute attribute(QName qName) 
 public Attribute attribute(String name,
    Namespace namespace) 
 public int attributeCount() 
 public Iterator attributeIterator() 
 abstract protected List attributeList()
    DOCUMENT ME!
 abstract protected List attributeList(int attributeCount)
    DOCUMENT ME!
 public String attributeValue(String name) 
 public String attributeValue(QName qName) 
 public String attributeValue(String name,
    String defaultValue) 
 public String attributeValue(QName qName,
    String defaultValue) 
 public List attributes() 
 protected  void childAdded(Node node) 
    Called when a new child node is added to create any parent relationships
 protected  void childRemoved(Node node) 
 protected List createAttributeList() 
    A Factory Method pattern which creates a List implementation used to store attributes
 protected List createAttributeList(int size) 
    A Factory Method pattern which creates a List implementation used to store attributes
 public Element createCopy() 

    This returns a deep clone of this element. The new element is detached from its parent, and getParent() on the clone will return null.

 public Element createCopy(String name) 
 public Element createCopy(QName qName) 
 protected Element createElement(String name) 
 protected Element createElement(QName qName) 
 protected Iterator createSingleIterator(Object result) 
 public List declaredNamespaces() 
 public Element element(String name) 
 public Element element(QName qName) 
 public Element element(String name,
    Namespace namespace) 
 public Iterator elementIterator() 
 public Iterator elementIterator(String name) 
 public Iterator elementIterator(QName qName) 
 public Iterator elementIterator(String name,
    Namespace ns) 
 public String elementText(String name) 
 public String elementText(QName qName) 
 public String elementTextTrim(String name) 
 public String elementTextTrim(QName qName) 
 public List elements() 
 public List elements(String name) 
 public List elements(QName qName) 
 public List elements(String name,
    Namespace namespace) 
 public  void ensureAttributesCapacity(int minCapacity) 
    Ensures that the list of attributes has the given size
 public Object getData() 
 protected DocumentFactory getDocumentFactory() 
 public String getName() 
 public Namespace getNamespace() 
 public Namespace getNamespaceForPrefix(String prefix) 
 public Namespace getNamespaceForURI(String uri) 
 public String getNamespacePrefix() 
 public String getNamespaceURI() 
 public List getNamespacesForURI(String uri) 
 public short getNodeType() 
 public String getPath(Element context) 
 public QName getQName(String qualifiedName) 
 public String getQualifiedName() 
 public String getStringValue() 
 public String getUniquePath(Element context) 
 public String getXPathNameStep() 
    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 index) 
 public boolean hasMixedContent() 
 public int indexOf(Node node) 
 public boolean isRootElement() 
 public boolean isTextOnly() 
 public Node node(int index) 
 public int nodeCount() 
 public Iterator nodeIterator() 
 public  void normalize() 
    Puts all 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. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.In cases where the document contains CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate between Text nodes and CDATASection nodes.
 public ProcessingInstruction processingInstruction(String target) 
 public List processingInstructions() 
 public List processingInstructions(String target) 
 public boolean remove(Attribute attribute) 
 public boolean remove(Node node) 
 public boolean remove(CDATA cdata) 
 public boolean remove(Comment comment) 
 public boolean remove(Element element) 
 public boolean remove(Entity entity) 
 public boolean remove(Namespace namespace) 
 public boolean remove(ProcessingInstruction pi) 
 public boolean remove(Text text) 
 protected boolean removeNode(Node node) 
 public boolean removeProcessingInstruction(String target) 
 public  void setAttributeValue(String name,
    String value) 
Deprecated! As - of version 0.5. Please use #addAttribute(String,String) instead. WILL BE REMOVED IN dom4j-1.6 !!

    DOCUMENT ME!
 public  void setAttributeValue(QName qName,
    String value) 
Deprecated! As - of version 0.5. Please use #addAttribute(String,String) instead. WILL BE REMOVED IN dom4j-1.6 !!

    DOCUMENT ME!
 public  void setAttributes(Attributes attributes,
    NamespaceStack namespaceStack,
    boolean noNamespaceAttributes) 
    This method provides a more optimal way of setting all the attributes on an Element particularly for use in org.dom4j.io.SAXReader .
 public  void setData(Object data) 
 public  void setName(String name) 
 public  void setNamespace(Namespace namespace) 
 public  void setText(String text) 
 public String toString() 
 public  void write(Writer out) throws IOException