org.ozoneDB.xml.dom4j.o3impl
Class OzoneDocumentImpl

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.AbstractDocument
                  extended byorg.ozoneDB.xml.dom4j.o3impl.DefaultDocument
                      extended byorg.ozoneDB.xml.dom4j.o3impl.OzoneDocumentImpl
All Implemented Interfaces:
Branch, java.lang.Cloneable, Document, Node, OzoneBranch, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, OzoneDocument, org.ozoneDB.OzoneRemote, java.io.Serializable

public class OzoneDocumentImpl
extends DefaultDocument
implements OzoneDocument, org.ozoneDB.OzoneCompatible

Author:
Per Nyfelt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ozoneDB.xml.dom4j.o3impl.DefaultDocument
EMPTY_ITERATOR, EMPTY_LIST
 
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
OzoneDocumentImpl()
           
OzoneDocumentImpl(DocumentType docType)
           
OzoneDocumentImpl(Element rootElement)
           
OzoneDocumentImpl(Element rootElement, DocumentType docType)
           
OzoneDocumentImpl(java.lang.String name)
           
OzoneDocumentImpl(java.lang.String name, Element rootElement, DocumentType docType)
           
 
Method Summary
 void addNode(int index, Node node)
           
 void addNode(Node node)
           
 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()
          clone will return a deep clone or if this node is read-only then clone will return the same instance.
 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 OzoneDocument create(org.ozoneDB.OzoneInterface db)
           
static OzoneDocument create(org.ozoneDB.OzoneInterface db, DocumentType docType)
           
static OzoneDocument create(org.ozoneDB.OzoneInterface db, Element rootElement)
           
static OzoneDocument create(org.ozoneDB.OzoneInterface db, Element rootElement, DocumentType docType)
           
static OzoneDocument create(org.ozoneDB.OzoneInterface db, java.lang.String name)
          creates a named Document.
static OzoneDocument create(org.ozoneDB.OzoneInterface db, java.lang.String name, Element rootElement, DocumentType docType)
           
 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.DefaultDocument
addDocType, clearContent, getDocType, getEntityResolver, getName, getRootElement, processingInstruction, processingInstructions, processingInstructions, removeProcessingInstruction, rootElementAdded, setContent, setDocType, setEntityResolver, setName
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractDocument
accept, add, addComment, addElement, addElement, addElement, addProcessingInstruction, addProcessingInstruction, asXML, asXPathResult, checkAddElementAllowed, getDocument, getNodeType, getPath, getStringValue, getUniquePath, normalize, remove, setRootElement, toString, write
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractBranch
add, add, add, addElement, appendContent, elementByID, getText, getTextTrim, hasContent, indexOf, isReadOnly, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions
 
Methods inherited from class org.ozoneDB.xml.dom4j.o3impl.AbstractNode
createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getParent, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setDocumentFactory, setNodeFactory, setParent, setText, setXPathFactory, supportsParent, 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.Document
addComment, addDocType, addProcessingInstruction, addProcessingInstruction, getDocType, getEntityResolver, getRootElement, setDocType, setEntityResolver, setRootElement
 
Methods inherited from interface org.ozoneDB.OzoneCompatible
container, database, self, setContainer, toXML
 

Constructor Detail

OzoneDocumentImpl

public OzoneDocumentImpl()

OzoneDocumentImpl

public OzoneDocumentImpl(java.lang.String name)

OzoneDocumentImpl

public OzoneDocumentImpl(Element rootElement)

OzoneDocumentImpl

public OzoneDocumentImpl(DocumentType docType)

OzoneDocumentImpl

public OzoneDocumentImpl(Element rootElement,
                         DocumentType docType)

OzoneDocumentImpl

public OzoneDocumentImpl(java.lang.String name,
                         Element rootElement,
                         DocumentType docType)
Method Detail

create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db)

create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db,
                                   java.lang.String name)
creates a named Document. Document name and object name should be the same here i think


create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db,
                                   Element rootElement)

create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db,
                                   DocumentType docType)

create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db,
                                   Element rootElement,
                                   DocumentType docType)

create

public static OzoneDocument create(org.ozoneDB.OzoneInterface db,
                                   java.lang.String name,
                                   Element rootElement,
                                   DocumentType docType)

getDocumentFactory

public DocumentFactory getDocumentFactory()
Overrides:
getDocumentFactory in class AbstractNode

getNodeFactory

protected NodeFactory getNodeFactory()
Overrides:
getNodeFactory in class AbstractNode

getXPathFactory

protected XPathFactory getXPathFactory()
Overrides:
getXPathFactory in class AbstractNode

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 AbstractDocument

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 AbstractDocument

removeNode

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

addNode

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

contentList

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

addNode

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

clone

public java.lang.Object clone()
Description copied from interface: Node

clone will return a deep clone or if this node is read-only then clone will return the same instance.

Specified by:
clone in interface Node
Overrides:
clone in class DefaultDocument

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.