|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ozoneDB.OzoneObject | +--org.ozoneDB.xml.dom.NodeImpl | +--org.ozoneDB.xml.dom.DocumentImpl
Implements an XML document, and also derived to implement an HTML document.
Provides access to the top level element in the document (getDocumentElement()
), to the DTD if one exists (getDoctype()
,
and to all node operations.
Several methods create new nodes of all basic types (comment, text, element,
etc.). These methods create new nodes but do not place them in the document
tree. The nodes may be placed in the document tree using Node.appendChild(org.w3c.dom.Node)
or Node.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
, or
they may be placed in some other document tree.
Notes:
Node.DOCUMENT_NODE
org.openxml.XMLDocument
.
Document
,
NodeImpl
,
DOMImplementation
,
Serialized FormField Summary |
Fields inherited from class org.ozoneDB.xml.dom.NodeImpl |
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_NODE |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
|
DocumentImpl()
|
protected |
DocumentImpl(java.lang.String rootElement)
|
Method Summary | |
void |
acquire(long lockTimeout)
Called to acquire access to a possible locked resource. |
void |
assignDoctype(DocumentTypeProxy docType)
|
void |
clearDocument()
Deletes all child Nodes from this Document to provide a fresh and empty Document. |
java.lang.Object |
clone()
|
void |
cloneInto(NodeProxy into,
boolean deep)
This clone method is called after a new node has been constructed to copy the contents of this node into the new one. |
org.w3c.dom.Node |
cloneNode(boolean deep)
|
org.w3c.dom.Attr |
createAttribute(java.lang.String name)
|
org.w3c.dom.Attr |
createAttribute(java.lang.String name,
java.lang.String defValue)
Creates an attribute with the default value specified in the DTD. |
org.w3c.dom.Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
|
org.w3c.dom.CDATASection |
createCDATASection(java.lang.String data)
|
org.w3c.dom.Comment |
createComment(java.lang.String data)
|
org.w3c.dom.Document |
createDocument(java.lang.String namespaceURI,
java.lang.String qualifiedName,
org.w3c.dom.DocumentType doctype)
|
org.w3c.dom.DocumentFragment |
createDocumentFragment()
|
org.w3c.dom.DocumentType |
createDocumentType(java.lang.String qualifiedName,
java.lang.String publicId,
java.lang.String systemId)
|
org.w3c.dom.Element |
createElement(java.lang.String tagName)
|
org.w3c.dom.Element |
createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
|
org.w3c.dom.EntityReference |
createEntityReference(java.lang.String name)
|
org.w3c.dom.ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
|
org.w3c.dom.Text |
createTextNode(java.lang.String data)
|
boolean |
equals(java.lang.Object other)
|
XMLContainerHelper |
getContainer()
Get the container of this document. |
org.w3c.dom.DocumentType |
getDoctype()
|
org.w3c.dom.Element |
getDocumentElement()
|
org.w3c.dom.Element |
getElementById(java.lang.String elementId)
|
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagName)
Creates a document type with the specified name (the name follows the !DOCTYPE entity) and associates it with the document. |
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
|
org.w3c.dom.DOMImplementation |
getImplementation()
|
short |
getNodeType()
Abstract method must be implemented by each node class. |
boolean |
hasFeature(java.lang.String feature,
java.lang.String version)
Return true if certain feature for specific DOM version supported by this implementation. |
org.w3c.dom.Node |
importNode(org.w3c.dom.Node importedNode,
boolean deep)
|
void |
lock()
Obtains a lock, preventing other threads from gaining access to the locked resource. |
void |
onDelete()
|
void |
readExternal(java.io.ObjectInput in)
|
void |
registerElement(java.lang.String tagName,
java.lang.Class elementClass)
Register an application-defined element type. |
void |
setContainer(XMLContainerHelper _container)
Set the container of this document. |
void |
setDoctype(org.w3c.dom.DocumentType docType)
|
void |
setElementTypes(java.util.Hashtable elementTypes)
|
void |
setNodeValue(java.lang.String value)
Changes the value of the node. |
protected boolean |
supportsChildern()
|
java.lang.String |
toString()
|
void |
unlock()
Releases a lock, so other thread may gain access to the resource. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.ozoneDB.xml.dom.NodeImpl |
appendChild, castNewChild, castOldChild, getAttributes, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, init, insertBefore, isReadOnly, isSupported, normalize, notifyIterators, removeChild, replaceChild, setNextSibling, setNodeName, setOwnerDocument, setParentNode, setPrefix, setPreviousSibling, setReadOnly, supports |
Methods inherited from class org.ozoneDB.OzoneObject |
container, database, deleteRecursive, getObjectID, handle, hashCode, onCreate, self, setContainer, toXML |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
Methods inherited from interface org.w3c.dom.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix |
Methods inherited from interface org.ozoneDB.xml.dom.NodeProxy |
getChild, getChildCount, getChildNodes, init, isReadOnly, setNextSibling, setNodeName, setOwnerDocument, setParentNode, setPreviousSibling, setReadOnly |
Constructor Detail |
public DocumentImpl()
protected DocumentImpl(java.lang.String rootElement)
Method Detail |
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class NodeImpl
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class NodeImpl
java.io.IOException
java.lang.ClassNotFoundException
public void setContainer(XMLContainerHelper _container)
setContainer
in interface DocumentProxy
public XMLContainerHelper getContainer()
getContainer
in interface DocumentProxy
public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep) throws org.w3c.dom.DOMException
importNode
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
createElementNS
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws org.w3c.dom.DOMException
createAttributeNS
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
getElementsByTagNameNS
in interface org.w3c.dom.Document
public org.w3c.dom.Element getElementById(java.lang.String elementId)
getElementById
in interface org.w3c.dom.Document
public org.w3c.dom.Document createDocument(java.lang.String namespaceURI, java.lang.String qualifiedName, org.w3c.dom.DocumentType doctype) throws org.w3c.dom.DOMException
createDocument
in interface org.w3c.dom.DOMImplementation
org.w3c.dom.DOMException
public org.w3c.dom.DocumentType createDocumentType(java.lang.String qualifiedName, java.lang.String publicId, java.lang.String systemId) throws org.w3c.dom.DOMException
createDocumentType
in interface org.w3c.dom.DOMImplementation
org.w3c.dom.DOMException
public short getNodeType()
NodeImpl
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class NodeImpl
Node.getNodeType()
public final void setNodeValue(java.lang.String value)
NodeImpl
Element Not supported Attr Value supported Text Value supported CDATASection Value supported EntityReference Not supported Entity Not supported ProcessingInstruction Value supported Comment Value supported Document Not supported DocumentType Not supported DocumentFragment Not supported Notation Not supportedFor most node types, if the value is set to null,
NodeImpl.getNodeValue()
will return an empty string instead.
setNodeValue
in interface org.w3c.dom.Node
setNodeValue
in class NodeImpl
value
- New value of nodepublic final org.w3c.dom.DocumentType getDoctype()
getDoctype
in interface org.w3c.dom.Document
public final void setDoctype(org.w3c.dom.DocumentType docType)
setDoctype
in interface DocumentProxy
public final org.w3c.dom.DOMImplementation getImplementation()
getImplementation
in interface org.w3c.dom.Document
public org.w3c.dom.Element getDocumentElement()
getDocumentElement
in interface org.w3c.dom.Document
public void setElementTypes(java.util.Hashtable elementTypes)
setElementTypes
in interface DocumentProxy
public org.w3c.dom.Element createElement(java.lang.String tagName) throws org.w3c.dom.DOMException
createElement
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public final org.w3c.dom.DocumentFragment createDocumentFragment()
createDocumentFragment
in interface org.w3c.dom.Document
public final org.w3c.dom.Text createTextNode(java.lang.String data)
createTextNode
in interface org.w3c.dom.Document
public final org.w3c.dom.Comment createComment(java.lang.String data)
createComment
in interface org.w3c.dom.Document
public final org.w3c.dom.CDATASection createCDATASection(java.lang.String data) throws org.w3c.dom.DOMException
createCDATASection
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public final org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws org.w3c.dom.DOMException
createProcessingInstruction
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public final org.w3c.dom.Attr createAttribute(java.lang.String name) throws org.w3c.dom.DOMException
createAttribute
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public final org.w3c.dom.Attr createAttribute(java.lang.String name, java.lang.String defValue) throws org.w3c.dom.DOMException
name
- The name of the attributedefValue
- The default value of the attribute
org.w3c.dom.DOMException
public final org.w3c.dom.EntityReference createEntityReference(java.lang.String name) throws org.w3c.dom.DOMException
createEntityReference
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
public final org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
getElementsByTagName
in interface org.w3c.dom.Document
org.w3c.dom.DOMException
- public boolean hasFeature(java.lang.String feature, java.lang.String version)
hasFeature
in interface org.w3c.dom.DOMImplementation
feature
- Name of feature to checkversion
- Optional version number
public void registerElement(java.lang.String tagName, java.lang.Class elementClass)
createElement(java.lang.String)
, an object of the specified class is created and returned.
This allows applications to define classes for specific element types.
tagName
- The name of the element tagelementClass
- Class derived from org.openxml.XMLElement
,
used to construct the elementpublic void assignDoctype(DocumentTypeProxy docType)
public void lock() throws java.lang.RuntimeException
unlock()
is called. Attempts to call acquire(long)
from another thread will be
blocked.
If the resource is already locked by another thread, the method will block until the lock is released or until the block has timedout.
lock()
may be called any number of times, and unlock()
must
be called that number of times to release the lock.
java.lang.RuntimeException
unlock()
public void unlock()
unlock()
must be called as many times as lock()
was called to
release the lock. unlock()
may be called an additional number of
times, if so required by the implementation (e.g. to assure that a lock
is released at the end of a thread).
lock()
public void acquire(long lockTimeout) throws java.lang.RuntimeException
java.lang.RuntimeException
lock()
,
unlock()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
public java.lang.String toString()
toString
in class org.ozoneDB.OzoneObject
public void cloneInto(NodeProxy into, boolean deep)
NodeImpl
Object.equals(java.lang.Object)
).
into must be a valid node of the exact same class as this one. deep is true if deep cloning (includes all children nodes) is to be performed. If deep is false, the clone might not pass the equality test.
Derived classes override and call this method to add per-class variable
copying. This method is called by Node.cloneNode(boolean)
and the default
Object.clone()
method.
Contents cloning duplicates the node's name and value, and its children. It does not duplicate it's context, that is, the node's parent or sibling. Initially a clone node has no parents or siblings. However, the node does belong to the same document, since all nodes must belong to some document. The cloned node is never read-only.
cloneInto
in interface NodeProxy
cloneInto
in class NodeImpl
into
- A node into which to duplicate this onedeep
- True if deep cloning is requiredprotected final boolean supportsChildern()
supportsChildern
in class NodeImpl
public void onDelete() throws java.lang.Exception
onDelete
in interface org.ozoneDB.OzoneCompatible
onDelete
in class org.ozoneDB.OzoneObject
java.lang.Exception
public void clearDocument() throws java.lang.Exception
clearDocument
in interface DocumentProxy
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |