org.ozoneDB.xml.dom.html
Class HTMLDocumentImpl
java.lang.Object
|
+--org.ozoneDB.OzoneObject
|
+--org.ozoneDB.xml.dom.NodeImpl
|
+--org.ozoneDB.xml.dom.DocumentImpl
|
+--org.ozoneDB.xml.dom.html.HTMLDocumentImpl
- All Implemented Interfaces:
- org.w3c.dom.Document, DocumentProxy, org.w3c.dom.DOMImplementation, java.io.Externalizable, org.w3c.dom.html.HTMLDocument, org.w3c.dom.Node, NodeProxy, org.ozoneDB.OzoneCompatible, org.ozoneDB.OzoneCompatibleOrProxy, org.ozoneDB.OzoneRemote, java.io.Serializable
- public final class HTMLDocumentImpl
- extends DocumentImpl
- implements org.w3c.dom.html.HTMLDocument
Implements an HTML document. Provides access to the top level element in the
document, its body and title.
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.
Note: <FRAMESET> documents are not supported at the moment, neither
are direct document writing (open()
, write(java.lang.String)
) and HTTP attribute
methods (getURL()
, getCookie()
).
- Version:
- $Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
- Author:
- Assaf Arkin
- See Also:
HTMLDocument
,
org.openxml.XMLDocument
,
Serialized Form
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 |
Method Summary |
protected org.w3c.dom.Node |
castNewChild(org.w3c.dom.Node newChild)
Checks whether newChild can be added to this node as a child, and
if so, performs a necessary cast. |
java.lang.Object |
clone()
|
org.w3c.dom.Node |
cloneNode(boolean deep)
|
void |
close()
|
org.w3c.dom.Element |
createElement(java.lang.String tagName)
|
org.w3c.dom.html.HTMLCollection |
getAnchors()
|
org.w3c.dom.html.HTMLCollection |
getApplets()
|
org.w3c.dom.html.HTMLElement |
getBody()
|
java.lang.String |
getCookie()
|
org.w3c.dom.Element |
getDocumentElement()
|
java.lang.String |
getDomain()
|
org.w3c.dom.Element |
getElementById(java.lang.String elementId)
|
org.w3c.dom.NodeList |
getElementsByName(java.lang.String elementName)
|
org.w3c.dom.html.HTMLCollection |
getForms()
|
org.w3c.dom.html.HTMLElement |
getHead()
Obtains the <HEAD> element in the document, creating one if does
not exist before. |
org.w3c.dom.html.HTMLCollection |
getImages()
|
org.w3c.dom.html.HTMLCollection |
getLinks()
|
java.lang.String |
getReferrer()
|
java.lang.String |
getTitle()
|
java.lang.String |
getURL()
|
void |
open()
|
void |
setBody(org.w3c.dom.html.HTMLElement newBody)
|
void |
setCookie(java.lang.String cookie)
|
void |
setTitle(java.lang.String newTitle)
|
void |
write(java.lang.String text)
|
void |
writeln(java.lang.String text)
|
Methods inherited from class org.ozoneDB.xml.dom.DocumentImpl |
acquire, assignDoctype, clearDocument, cloneInto, createAttribute, createAttribute, createAttributeNS, createCDATASection, createComment, createDocument, createDocumentFragment, createDocumentType, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, equals, getContainer, getDoctype, getElementsByTagName, getElementsByTagNameNS, getImplementation, getNodeType, hasFeature, importNode, lock, onDelete, readExternal, registerElement, setContainer, setDoctype, setElementTypes, setNodeValue, supportsChildern, toString, unlock, writeExternal |
Methods inherited from class org.ozoneDB.xml.dom.NodeImpl |
appendChild, 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.w3c.dom.Document |
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode |
Methods inherited from interface org.w3c.dom.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
Methods inherited from interface org.ozoneDB.xml.dom.NodeProxy |
getChild, getChildCount, getChildNodes, init, isReadOnly, setNextSibling, setNodeName, setOwnerDocument, setParentNode, setPreviousSibling, setReadOnly |
HTMLDocumentImpl
public HTMLDocumentImpl()
getDocumentElement
public org.w3c.dom.Element getDocumentElement()
- Specified by:
getDocumentElement
in interface org.w3c.dom.Document
- Overrides:
getDocumentElement
in class DocumentImpl
getHead
public org.w3c.dom.html.HTMLElement getHead()
- Obtains the <HEAD> element in the document, creating one if does
not exist before. The <HEAD> element is the first element in the
<HTML> in the document. The <HTML> element is obtained by
calling
getDocumentElement()
. If the element does not exist, one
is created.
Called by getTitle()
, setTitle(java.lang.String)
, getBody()
and
setBody(org.w3c.dom.html.HTMLElement)
to assure the document has the <HEAD> element
correctly placed.
- Returns:
- The <HEAD> element
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interface org.w3c.dom.html.HTMLDocument
setTitle
public void setTitle(java.lang.String newTitle)
- Specified by:
setTitle
in interface org.w3c.dom.html.HTMLDocument
getBody
public org.w3c.dom.html.HTMLElement getBody()
- Specified by:
getBody
in interface org.w3c.dom.html.HTMLDocument
setBody
public void setBody(org.w3c.dom.html.HTMLElement newBody)
- Specified by:
setBody
in interface org.w3c.dom.html.HTMLDocument
getElementById
public org.w3c.dom.Element getElementById(java.lang.String elementId)
- Specified by:
getElementById
in interface org.w3c.dom.Document
- Overrides:
getElementById
in class DocumentImpl
getElementsByName
public org.w3c.dom.NodeList getElementsByName(java.lang.String elementName)
- Specified by:
getElementsByName
in interface org.w3c.dom.html.HTMLDocument
createElement
public org.w3c.dom.Element createElement(java.lang.String tagName)
throws org.w3c.dom.DOMException
- Specified by:
createElement
in interface org.w3c.dom.Document
- Overrides:
createElement
in class DocumentImpl
org.w3c.dom.DOMException
getReferrer
public java.lang.String getReferrer()
- Specified by:
getReferrer
in interface org.w3c.dom.html.HTMLDocument
getDomain
public java.lang.String getDomain()
- Specified by:
getDomain
in interface org.w3c.dom.html.HTMLDocument
getURL
public java.lang.String getURL()
- Specified by:
getURL
in interface org.w3c.dom.html.HTMLDocument
getCookie
public java.lang.String getCookie()
- Specified by:
getCookie
in interface org.w3c.dom.html.HTMLDocument
setCookie
public void setCookie(java.lang.String cookie)
- Specified by:
setCookie
in interface org.w3c.dom.html.HTMLDocument
getImages
public org.w3c.dom.html.HTMLCollection getImages()
- Specified by:
getImages
in interface org.w3c.dom.html.HTMLDocument
getApplets
public org.w3c.dom.html.HTMLCollection getApplets()
- Specified by:
getApplets
in interface org.w3c.dom.html.HTMLDocument
getLinks
public org.w3c.dom.html.HTMLCollection getLinks()
- Specified by:
getLinks
in interface org.w3c.dom.html.HTMLDocument
getForms
public org.w3c.dom.html.HTMLCollection getForms()
- Specified by:
getForms
in interface org.w3c.dom.html.HTMLDocument
getAnchors
public org.w3c.dom.html.HTMLCollection getAnchors()
- Specified by:
getAnchors
in interface org.w3c.dom.html.HTMLDocument
open
public void open()
- Specified by:
open
in interface org.w3c.dom.html.HTMLDocument
close
public void close()
- Specified by:
close
in interface org.w3c.dom.html.HTMLDocument
write
public void write(java.lang.String text)
- Specified by:
write
in interface org.w3c.dom.html.HTMLDocument
writeln
public void writeln(java.lang.String text)
- Specified by:
writeln
in interface org.w3c.dom.html.HTMLDocument
clone
public java.lang.Object clone()
- Overrides:
clone
in class DocumentImpl
cloneNode
public org.w3c.dom.Node cloneNode(boolean deep)
- Specified by:
cloneNode
in interface org.w3c.dom.Node
- Overrides:
cloneNode
in class DocumentImpl
castNewChild
protected org.w3c.dom.Node castNewChild(org.w3c.dom.Node newChild)
throws org.w3c.dom.DOMException
- Description copied from class:
NodeImpl
- Checks whether newChild can be added to this node as a child, and
if so, performs a necessary cast. newChild cannot be null and must
belong to this DOM. It is impossible to transfer nodes between different
DOM implementations.
The following rules govern the allowed newChild types:
- Parent is an
Attr
, newChild must be either
a Text
or an EntityReference
- Parent is a
DocumentType
, newChild must be
either an Entity
or a Notation
.
- Parnet is any other node type, newChild must be an
Element
, a CharacterData
derived type,
a DocumentFragment
, an EntityReference
or a ProcessingInstruction
.
Any deviation will throw an exception.
- Overrides:
castNewChild
in class NodeImpl
- Parameters:
newChild
- New child node
- Returns:
- newChild cast to type
NodeImpl
- Throws:
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
newChild is null, does not belong to this DOM, or its node type
is not supported for this parent
Copyright © 2002 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.