org.ozoneDB.xml.dom4j.o3impl
Class OzoneElementImpl

java.lang.Object
  extended byorg.ozoneDB.OzoneObject
      extended byorg.ozoneDB.xml.dom4j.o3impl.AbstractNode
          extended byorg.ozoneDB.xml.dom4j.o3impl.AbstractBranch
              extended byorg.ozoneDB.xml.dom4j.o3impl.AbstractElement
                  extended byorg.ozoneDB.xml.dom4j.o3impl.DefaultElement
                      extended byorg.ozoneDB.xml.dom4j.o3impl.OzoneElementImpl
All Implemented Interfaces:
Branch, java.lang.Cloneable, Element, Node, OzoneBranch, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, OzoneElement, org.ozoneDB.OzoneRemote, java.io.Serializable

public class OzoneElementImpl
extends DefaultElement
implements OzoneElement, org.ozoneDB.OzoneCompatible

Author:
Per Nyfelt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractElement
EMPTY_ITERATOR, EMPTY_LIST, USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING
 
Fields inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE, outputFormat
 
Fields inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractNode
NODE_TYPE_NAMES
 
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE
 
Constructor Summary
OzoneElementImpl(QName qname)
           
OzoneElementImpl(QName qname, int attributeCount)
           
OzoneElementImpl(java.lang.String name)
           
OzoneElementImpl(java.lang.String name, Namespace namespace)
           
 
Method Summary
 Element addAttribute(QName qName, java.lang.String value)
          Adds the attribute value of the given fully qualified name.
 Element addAttribute(java.lang.String name, java.lang.String value)
          Adds the attribute value of the given local name.
 void addNode(int index, Node node)
           
 void addNode(Node node)
           
 java.util.List attributes()
          Returns the Attribute instances this element contains as a backed List so that the attributes may be modified directly using the List interface.
 void childAdded(Node node)
          Called when a new child node has been added to me to allow any parent relationships to be created or events to be fired.
 void childRemoved(Node node)
          Called when a child node has been removed to allow any parent relationships to be deleted or events to be fired.
 java.lang.Object clone()
          An element clone is identitical to its original except for two things 1. it has no document 2. it has no parent
 java.util.List content()
          Returns the content nodes of this branch as a backed List so that the content of this branch may be modified directly using the List interface.
 java.util.List contentList()
           
 void contentRemoved()
          Called when the given List content has been removed so each node should have its parent and document relationships cleared
static OzoneElement create(org.ozoneDB.OzoneInterface db, QName qname)
           
static OzoneElement create(org.ozoneDB.OzoneInterface db, QName qname, int attributeCount)
           
static OzoneElement create(org.ozoneDB.OzoneInterface db, java.lang.String name)
           
static OzoneElement create(org.ozoneDB.OzoneInterface db, java.lang.String name, Namespace namespace)
           
 java.util.List createContentList()
          A Factory Method pattern which creates a List implementation used to store content
 java.util.List createContentList(int size)
          A Factory Method pattern which creates a List implementation used to store content
 java.util.List createEmptyList()
          A Factory Method pattern which creates an empty a BackedList implementation
 BackedList createResultList()
          A Factory Method pattern which creates a BackedList implementation used to store results of a filtered content query.
 java.util.List createSingleResultList(java.lang.Object result)
          A Factory Method pattern which creates a BackedList implementation which contains a single result
 java.lang.String elementID(Element element)
           
 java.lang.String getContentAsStringValue(java.lang.Object content)
           
 java.lang.String getContentAsText(java.lang.Object content)
           
 DocumentFactory getDocumentFactory()
           
protected  NodeFactory getNodeFactory()
           
protected  XPathFactory getXPathFactory()
           
 void invalidNodeTypeAddException(Node node)
          Called when an invalid node has been added.
 void onActivate()
           
 void onCreate()
           
 void onDelete()
           
 void onPassivate()
           
 boolean removeNode(Node node)
           
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, clearContent, declaredNamespaces, element, element, element, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, getDocument, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractElement
accept, add, add, add, add, add, add, add, add, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getData, getName, getNamespace, getNamespacePrefix, getNamespaceURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setName, setNamespace, setText, toString, write
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractBranch
addElement, addElement, addElement, appendContent, elementByID, getTextTrim, hasContent, isReadOnly, setProcessingInstructions
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocumentFactory, setNodeFactory, setXPathFactory, valueOf
 
Methods inherited from class org.ozoneDB.OzoneObject
container, database, deleteRecursive, equals, getHandle, getObjectID, handle, hashCode, requireWriteLocking, self, setContainer, toXML
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ozoneDB.xml.dom4j.OzoneBranch
getTextTrim
 
Methods inherited from interface org.dom4j.Branch
add, add, add, add, addElement, addElement, addElement, appendContent, clearContent, elementByID, indexOf, node, nodeCount, nodeIterator, normalize, processingInstruction, processingInstructions, processingInstructions, remove, remove, remove, remove, removeProcessingInstruction, setContent, setProcessingInstructions
 
Methods inherited from interface org.dom4j.Node
accept, asXML, asXPathResult, createXPath, detach, getDocument, getName, getNodeType, getNodeTypeName, getParent, getPath, getPath, getStringValue, getText, getUniquePath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setName, setParent, setText, supportsParent, valueOf, write
 
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy
getObjectID
 
Methods inherited from interface org.dom4j.Element
add, add, add, add, add, addCDATA, addComment, addEntity, additionalNamespaces, addNamespace, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, attribute, attribute, attribute, attributeCount, attributeIterator, attributeValue, attributeValue, attributeValue, attributeValue, createCopy, createCopy, createCopy, declaredNamespaces, element, element, elementIterator, elementIterator, elementIterator, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, getData, getNamespace, getNamespaceForPrefix, getNamespaceForURI, getNamespacePrefix, getNamespaceURI, getQName, getQName, getQualifiedName, getStringValue, getText, getTextTrim, getXPathResult, hasMixedContent, isRootElement, isTextOnly, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setQName
 
Methods inherited from interface org.ozoneDB.OzoneCompatible
container, database, self, setContainer, toXML
 

Constructor Detail

OzoneElementImpl

public OzoneElementImpl(java.lang.String name)

OzoneElementImpl

public OzoneElementImpl(QName qname)

OzoneElementImpl

public OzoneElementImpl(QName qname,
                        int attributeCount)

OzoneElementImpl

public OzoneElementImpl(java.lang.String name,
                        Namespace namespace)
Method Detail

create

public static OzoneElement create(org.ozoneDB.OzoneInterface db,
                                  java.lang.String name)

create

public static OzoneElement create(org.ozoneDB.OzoneInterface db,
                                  QName qname)

create

public static OzoneElement create(org.ozoneDB.OzoneInterface db,
                                  QName qname,
                                  int attributeCount)

create

public static OzoneElement create(org.ozoneDB.OzoneInterface db,
                                  java.lang.String name,
                                  Namespace namespace)

getDocumentFactory

public DocumentFactory getDocumentFactory()
Overrides:
getDocumentFactory in class AbstractNode

getNodeFactory

protected NodeFactory getNodeFactory()
Overrides:
getNodeFactory in class AbstractElement

getXPathFactory

protected XPathFactory getXPathFactory()
Overrides:
getXPathFactory in class AbstractNode

addAttribute

public Element addAttribute(java.lang.String name,
                            java.lang.String value)
Description copied from interface: Element

Adds the attribute value of the given local name. If an attribute already exists for the given name it will be replaced. 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 given name.

Specified by:
addAttribute in interface Element
Overrides:
addAttribute in class AbstractElement

addAttribute

public Element addAttribute(QName qName,
                            java.lang.String value)
Description copied from interface: Element

Adds the attribute value of the given fully qualified name. If an attribute already exists for the given name it will be replaced. 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 given name.

Specified by:
addAttribute in interface Element
Overrides:
addAttribute in class AbstractElement

attributes

public java.util.List attributes()
Description copied from interface: Element

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

Specified by:
attributes in interface Element
Overrides:
attributes in class DefaultElement

content

public java.util.List content()
Description copied from interface: Branch

Returns the content nodes of this branch as a backed List so that the content of this branch may be modified directly using the List interface. The List is backed by the Branch so that changes to the list are reflected in the branch and vice versa.

Specified by:
content in interface Branch
Overrides:
content in class AbstractBranch

invalidNodeTypeAddException

public void invalidNodeTypeAddException(Node node)
Called when an invalid node has been added. Throws an IllegalAddException.

Specified by:
invalidNodeTypeAddException in interface OzoneBranch
Overrides:
invalidNodeTypeAddException in class AbstractBranch

contentRemoved

public void contentRemoved()
Called when the given List content has been removed so each node should have its parent and document relationships cleared

Specified by:
contentRemoved in interface OzoneBranch
Overrides:
contentRemoved in class AbstractBranch

getContentAsText

public java.lang.String getContentAsText(java.lang.Object content)
Specified by:
getContentAsText in interface OzoneBranch
Overrides:
getContentAsText in class AbstractBranch
Returns:
the text value of the given content object as text which returns the text value of CDATA, Entity or Text nodes

getContentAsStringValue

public java.lang.String getContentAsStringValue(java.lang.Object content)
Specified by:
getContentAsStringValue in interface OzoneBranch
Overrides:
getContentAsStringValue in class AbstractBranch
Returns:
the XPath defined string-value of the given content object

elementID

public java.lang.String elementID(Element element)
Specified by:
elementID in interface OzoneBranch
Overrides:
elementID in class AbstractBranch
Returns:
the ID of the given Element

createContentList

public java.util.List createContentList()
A Factory Method pattern which creates a List implementation used to store content

Specified by:
createContentList in interface OzoneBranch
Overrides:
createContentList in class AbstractBranch

createContentList

public java.util.List createContentList(int size)
A Factory Method pattern which creates a List implementation used to store content

Specified by:
createContentList in interface OzoneBranch
Overrides:
createContentList in class AbstractBranch

createResultList

public BackedList createResultList()
A Factory Method pattern which creates a BackedList implementation used to store results of a filtered content query.

Specified by:
createResultList in interface OzoneBranch
Overrides:
createResultList in class AbstractBranch

createSingleResultList

public java.util.List createSingleResultList(java.lang.Object result)
A Factory Method pattern which creates a BackedList implementation which contains a single result

Specified by:
createSingleResultList in interface OzoneBranch
Overrides:
createSingleResultList in class AbstractBranch

createEmptyList

public java.util.List createEmptyList()
A Factory Method pattern which creates an empty a BackedList implementation

Specified by:
createEmptyList in interface OzoneBranch
Overrides:
createEmptyList in class AbstractBranch

childRemoved

public void childRemoved(Node node)
Description copied from interface: OzoneBranch
Called when a child node has been removed to allow any parent relationships to be deleted or events to be fired.

Specified by:
childRemoved in interface OzoneBranch
Overrides:
childRemoved in class AbstractElement

childAdded

public void childAdded(Node node)
Description copied from interface: OzoneBranch
Called when a new child node has been added to me to allow any parent relationships to be created or events to be fired.

Specified by:
childAdded in interface OzoneBranch
Overrides:
childAdded in class AbstractElement

removeNode

public boolean removeNode(Node node)
Specified by:
removeNode in interface OzoneBranch
Overrides:
removeNode in class DefaultElement

addNode

public void addNode(Node node)
Specified by:
addNode in interface OzoneBranch
Overrides:
addNode in class AbstractElement

contentList

public java.util.List contentList()
Specified by:
contentList in interface OzoneBranch
Overrides:
contentList in class DefaultElement

addNode

public void addNode(int index,
                    Node node)
Specified by:
addNode in interface OzoneBranch
Overrides:
addNode in class AbstractElement

clone

public java.lang.Object clone()
An element clone is identitical to its original except for two things 1. it has no document 2. it has no parent

Specified by:
clone in interface Node
Overrides:
clone in class DefaultElement
Returns:
a clone of the Element as its own unique persiatant object

onCreate

public void onCreate()
Specified by:
onCreate in interface org.ozoneDB.OzoneCompatible
Overrides:
onCreate in class AbstractNode

onActivate

public void onActivate()
Specified by:
onActivate in interface org.ozoneDB.OzoneCompatible

onPassivate

public void onPassivate()
Specified by:
onPassivate in interface org.ozoneDB.OzoneCompatible

onDelete

public void onDelete()
Specified by:
onDelete in interface org.ozoneDB.OzoneCompatible


Copyright © 2004 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.