|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.apache.xerces.dom.NodeImpl | +--org.enhydra.apache.xerces.dom.ChildNode | +--org.enhydra.apache.xerces.dom.ParentNode | +--org.enhydra.apache.xerces.dom.CoreDocumentImpl | +--org.enhydra.apache.xerces.dom.DocumentImpl | +--org.enhydra.xml.lazydom.LazyDocument | +--org.enhydra.xml.lazydom.html.LazyHTMLDocument
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()
).
HTMLDocument
, Serialized FormInner classes inherited from class org.enhydra.apache.xerces.dom.DocumentImpl |
org.enhydra.apache.xerces.dom.DocumentImpl.EnclosingAttr, org.enhydra.apache.xerces.dom.DocumentImpl.LEntry |
Inner classes inherited from class org.enhydra.apache.xerces.dom.ParentNode |
org.enhydra.apache.xerces.dom.ParentNode.UserDataRecord |
Fields inherited from class org.enhydra.xml.lazydom.LazyDocument |
fTemplateDOM |
Fields inherited from class org.enhydra.apache.xerces.dom.DocumentImpl |
eventListeners, iterators, mutationEvents, ranges, savedEnclosingAttr, serialVersionUID |
Fields inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl |
actualEncoding, allowGrammarAccess, changes, docElement, docType, domNormalizer, encoding, errorChecking, fConfiguration, fDocumentURI, fFreeNLCache, fXPathEvaluator, identifiers, standalone, userData, version, xmlVersionChanged |
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode |
firstChild, fNodeListCache, ownerDocument |
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode |
nextSibling, previousSibling |
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl |
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE |
Fields inherited from interface org.enhydra.xml.lazydom.LazyNode |
DOCUMENT_NODE_ID, NULL_NODE_ID |
Constructor Summary | |
LazyHTMLDocument()
Constructor with no template. |
|
LazyHTMLDocument(TemplateDOM templateDOM)
LazyDOM: Constructor with TemplateDOM. |
Method Summary | |
LazyDocument |
cloneAsTemplateDocument(TemplateDOM templateDOM)
Subclasses should override this, returning the subclass built with the provided template DOM. |
Node |
cloneNode(boolean deep)
Subclasses should override this, returning the subclass built with the template DOM, if the current document was built with the template DOM. |
void |
close()
|
Attr |
createAttribute(String name)
Creates an Attribute having this Document as its OwnerDoc. |
LazyElement |
createElement(int nodeId)
Create a element from a template given its id. |
Element |
createElement(LazyElement template,
String tagName)
|
Element |
createElement(String tagName)
LazyDOM: standard createElement method, passes null template element. |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
|
Element |
createElementNS(String namespaceURI,
String qualifiedName,
String localpart)
Xerces-specific constructor. |
HTMLCollection |
getAnchors()
|
HTMLCollection |
getApplets()
|
HTMLElement |
getBody()
|
String |
getCookie()
|
Element |
getDocumentElement()
|
String |
getDomain()
|
Element |
getElementById(String elementId)
|
NodeList |
getElementsByName(String elementName)
|
NodeList |
getElementsByTagName(String tagName)
|
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
|
HTMLCollection |
getForms()
|
HTMLElement |
getHead()
Obtains the <HEAD> element in the document, creating one if does not exist before. |
HTMLCollection |
getImages()
|
DOMImplementation |
getImplementation()
|
HTMLCollection |
getLinks()
|
String |
getReferrer()
|
String |
getTitle()
|
String |
getURL()
|
void |
open()
|
void |
setBody(HTMLElement newBody)
|
void |
setCookie(String cookie)
|
void |
setTitle(String newTitle)
|
void |
write(String text)
|
void |
writeln(String text)
|
Methods inherited from class org.enhydra.apache.xerces.dom.DocumentImpl |
addEventListener, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, deletedText, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, getMutationEvents, insertedNode, insertedText, insertingNode, modifiedAttrValue, modifiedCharacterData, modifyingCharacterData, removedAttrNode, removedNode, removeEventListener, removeNodeIterator, removeRange, removingNode, renamedAttrNode, renamedElement, replacedCharacterData, replacedNode, replacedText, replacingData, replacingNode, saveEnclosingAttr, setAttrNode, setEventListeners, setMutationEvents, splitData |
Methods inherited from class org.enhydra.apache.xerces.dom.CoreDocumentImpl |
|
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode |
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodesUnoptimized, getLength, getTextContent, hasTextContent, internalInsertBefore, internalRemoveChild, isEqualNode, item, lastChild, lastChild, ownerDocument, setOwnerDocument, setReadOnly, synchronizeChildren |
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode |
getNextSibling, getParentNode, getPreviousSibling, parentNode, previousSibling |
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl |
addEventListener, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getContainer, getElementAncestor, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasAttributes, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setPrefix, setUserData, setUserData, synchronizeData, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Constructor Detail |
public LazyHTMLDocument()
public LazyHTMLDocument(TemplateDOM templateDOM)
Method Detail |
public DOMImplementation getImplementation()
getImplementation
in interface Document
getImplementation
in class LazyDocument
Document.getImplementation()
public Element getDocumentElement()
getDocumentElement
in interface Document
getDocumentElement
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
Document.getDocumentElement()
public HTMLElement getHead()
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.
public String getTitle()
getTitle
in interface HTMLDocument
public void setTitle(String newTitle)
setTitle
in interface HTMLDocument
public HTMLElement getBody()
getBody
in interface HTMLDocument
public void setBody(HTMLElement newBody)
setBody
in interface HTMLDocument
public Element getElementById(String elementId)
getElementById
in interface HTMLDocument
getElementById
in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
public NodeList getElementsByName(String elementName)
getElementsByName
in interface HTMLDocument
public final NodeList getElementsByTagName(String tagName)
getElementsByTagName
in interface Document
getElementsByTagName
in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName)
getElementsByTagNameNS
in interface Document
getElementsByTagNameNS
in class org.enhydra.apache.xerces.dom.CoreDocumentImpl
public Element createElementNS(String namespaceURI, String qualifiedName, String localpart) throws DOMException
createElementNS
in class LazyDocument
namespaceURI
- The namespace URI of the element to
create.qualifiedName
- The qualified name of the element type to
instantiate.localpart
- The local name of the element to instantiate.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.public Element createElementNS(String namespaceURI, String qualifiedName)
createElementNS
in interface Document
createElementNS
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
Document.createElementNS(java.lang.String, java.lang.String)
public Element createElement(LazyElement template, String tagName) throws DOMException
public Element createElement(String tagName) throws DOMException
createElement
in interface Document
createElement
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
Document.createElement(java.lang.String)
public LazyElement createElement(int nodeId) throws DOMException
LazyDocument
createElement
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
Document.createElement(java.lang.String)
public Attr createAttribute(String name) throws DOMException
CoreDocumentImpl.createAttribute(java.lang.String)
and returns
and attribute whose name is lower case.createAttribute
in interface Document
createAttribute
in class LazyDocument
name
- The name of the attributeDOMException(INVALID_NAME_ERR)
- if the attribute name
is not acceptablepublic String getReferrer()
getReferrer
in interface HTMLDocument
public String getDomain()
getDomain
in interface HTMLDocument
public String getURL()
getURL
in interface HTMLDocument
public String getCookie()
getCookie
in interface HTMLDocument
public void setCookie(String cookie)
setCookie
in interface HTMLDocument
public HTMLCollection getImages()
getImages
in interface HTMLDocument
public HTMLCollection getApplets()
getApplets
in interface HTMLDocument
public HTMLCollection getLinks()
getLinks
in interface HTMLDocument
public HTMLCollection getForms()
getForms
in interface HTMLDocument
public HTMLCollection getAnchors()
getAnchors
in interface HTMLDocument
public void open()
open
in interface HTMLDocument
public void close()
close
in interface HTMLDocument
public void write(String text)
write
in interface HTMLDocument
public void writeln(String text)
writeln
in interface HTMLDocument
public Node cloneNode(boolean deep)
LazyDocument
cloneNode(LazyDocument, boolean)
.cloneNode
in interface Node
cloneNode
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
Node.cloneNode(boolean)
public LazyDocument cloneAsTemplateDocument(TemplateDOM templateDOM)
LazyDocument
cloneAsTemplateDocument
in class LazyDocument
org.enhydra.xml.lazydom.LazyDocument
templateDOM
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |