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 org. or org., or
they may be placed in some other document tree.
org.w3c.dom.html.HTMLDocument
| Modifier and Type | Field and Description |
|---|---|
| private HTMLCollectionImpl | _anchors
Holds |
| private HTMLCollectionImpl | _applets
Holds |
| private static final Class | _elemClassSigHTML
Signature used to locate constructor of HTML element classes. |
| private static Hashtable | _elementTypesHTML
Holds names and classes of HTML element types. |
| private HTMLCollectionImpl | _forms
Holds |
| private HTMLCollectionImpl | _images
Holds |
| private HTMLCollectionImpl | _links
Holds |
| private StringWriter | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | canRenameElements(String newNamespaceURI, String newNodeName, ElementImpl el)
Overrides org. |
| public Node | cloneNode(boolean
If deep)true, recursively clone the subtree under
the specified node; if false, clone only the node
itself (and its attributes, if it is an Element).Overrides org. Implements org. |
| public void | close()
Implements org. open() and forces
rendering.
|
| public Attr | Returns: An attribute whose name is all lower caseThe name of the attribute name)Overrides org. Implements org. |
| public Element | createElement(String
The name of the element type to instantiate. For XML,
this is case-sensitive, otherwise it depends on the
case-sensitivity of the markup language in use. In that case, the
name is mapped to the canonical form of that markup by the DOM
implementation. tagName)Overrides org. Implements org. |
| public Element | Returns: Element A new Element object with the following attributes:The namespace URI of the element to
create. namespaceURI, String The qualified name of the element type to
instantiate. qualifiedName, String The local name of the element to instantiate. localpart)Overrides org. |
| public Element | createElementNS(String
The namespace URI of the element to create. namespaceURI, String The qualified name of the element type to
instantiate. qualifiedName)Overrides org. Implements org. |
| public HTMLCollection | getAnchors()
Implements org. A ) elements in a document
with a value for the name attribute.
|
| public HTMLCollection | getApplets()
Implements org. OBJECT elements that include
applets and APPLET ( deprecated ) elements in a document.
|
| public synchronized HTMLElement | getBody()
Implements org. |
| public String | getCookie()
Implements org. |
| public synchronized Element | getDocumentElement()
Overrides org. Implements org. |
| public String | getDomain()
Implements org. null if the server cannot be identified by a domain name.
|
| public synchronized Element | getElementById(String
The unique elementId)id value for an element.Overrides org. Implements org. Element that has an ID attribute with the
given value.
|
| private Element | Returns: The node in which to look forThe elementId, Node node)id value to look forRecursive method retreives an element by its |
| public NodeList | getElementsByName(String
The elementName)name attribute value for an
element.Implements org. name value is given by elementName .
|
| public final NodeList | getElementsByTagName(String
The name of the tag to match on. The special value "*"
matches all tags. For XML, the tagName)tagname parameter is
case-sensitive, otherwise it depends on the case-sensitivity of the
markup language in use.Overrides org. Implements org. NodeList of all the Elements in
document order with a given tag name and are contained in the
document.
|
| public final NodeList | getElementsByTagNameNS(String
The namespace URI of the elements to match on. The
special value namespaceURI, String "*" matches all namespaces.The local name of the elements to match on. The
special value "*" matches all local names. localName)Overrides org. Implements org. NodeList of all the Elements with a
given local name and namespace URI in document order.
|
| public HTMLCollection | getForms()
Implements org. |
| public synchronized HTMLElement | Returns: The <HEAD> elementObtains the <HEAD> element in the document, creating one if does not exist before. |
| public HTMLCollection | getImages()
Implements org. IMG elements in a document.
|
| public HTMLCollection | getLinks()
Implements org. AREA elements and anchor (
A ) elements in a document with a value for the
href attribute.
|
| public String | getReferrer()
Implements org. |
| public synchronized String | getTitle()
Implements org. TITLE element
in the head of the document.
|
| public String | |
| public void | |
| private static void | |
| private static synchronized void | populateElementTypes()
Called by the constructor to populate the element types list (see |
| public synchronized void | |
| public void | |
| public synchronized void | |
| public void | write(String
The string to be parsed into some structure in the
document structure model. text)Implements org. open() .
|
| public void | writeln(String
The string to be parsed into some structure in the
document structure model. text)Implements org. open() .
|
| _anchors | back to summary |
|---|---|
| private HTMLCollectionImpl _anchors Holds | |
| _applets | back to summary |
|---|---|
| private HTMLCollectionImpl _applets Holds | |
| _elemClassSigHTML | back to summary |
|---|---|
| private static final Class<T>[] _elemClassSigHTML Signature used to locate constructor of HTML element classes. This static array is shared across all HTML documents.
| |
| _elementTypesHTML | back to summary |
|---|---|
| private static Hashtable<K, V> _elementTypesHTML Holds names and classes of HTML element types. When an element with a
particular tag name is created, the matching
| |
| _forms | back to summary |
|---|---|
| private HTMLCollectionImpl _forms Holds | |
| _images | back to summary |
|---|---|
| private HTMLCollectionImpl _images Holds | |
| _links | back to summary |
|---|---|
| private HTMLCollectionImpl _links Holds | |
| _writer | back to summary |
|---|---|
| private StringWriter _writer Holds string writer used by direct manipulation operation ( | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| HTMLDocumentImpl | back to summary |
|---|---|
| public HTMLDocumentImpl() | |
| canRenameElements | back to summary |
|---|---|
| protected boolean canRenameElements(String newNamespaceURI, String newNodeName, ElementImpl el) Overrides org. | |
| cloneNode | back to summary |
|---|---|
| public Node cloneNode(boolean deep) Overrides org. Implements org. Doc from org. Returns a duplicate of this node, i.e., serves as a generic copy
constructor for nodes. The duplicate node has no parent (
| |
| close | back to summary |
|---|---|
| public void close() Implements org. Doc from org. Closes a document stream opened by | |
| createAttribute | back to summary |
|---|---|
| public Attr createAttribute(String name) throws DOMException Overrides org. Implements org. Creates an Attribute having this Document as its OwnerDoc.
Overrides
| |
| createElement | back to summary |
|---|---|
| public Element createElement(String tagName) throws DOMException Overrides org. Implements org. Doc from org. Creates an element of the type specified. Note that the instance
returned implements the
| |
| createElementNS | back to summary |
|---|---|
| public Element createElementNS(String namespaceURI, String qualifiedName, String localpart) throws DOMException Overrides org. Xerces-specific constructor. "localName" is passed in, so we don't need to create a new String for it.
| |
| createElementNS | back to summary | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public Element createElementNS(String namespaceURI, String qualifiedName) Overrides org. Implements org. Doc from org. Creates an element of the given qualified name and namespace URI.
| |||||||||||||
| getAnchors | back to summary |
|---|---|
| public HTMLCollection getAnchors() Implements org. Doc from org. A collection of all the anchor ( | |
| getApplets | back to summary |
|---|---|
| public HTMLCollection getApplets() Implements org. Doc from org. A collection of all the | |
| getBody | back to summary |
|---|---|
| public synchronized HTMLElement getBody() Implements org. Doc from org. The element that contains the content for the document. In documents
with | |
| getCookie | back to summary |
|---|---|
| public String getCookie() Implements org. Doc from org. The cookies associated with this document. If there are none, the
value is an empty string. Otherwise, the value is a string: a
semicolon-delimited list of "name, value" pairs for all the cookies
associated with the page. For example,
| |
| getDocumentElement | back to summary |
|---|---|
| public synchronized Element getDocumentElement() Overrides org. Implements org. Doc from org. This is a convenience attribute that allows direct access to the child node that is the document element of the document. | |
| getDomain | back to summary |
|---|---|
| public String getDomain() Implements org. Doc from org. The domain name of the server that served the document, or
| |
| getElementById | back to summary |
|---|---|
| public synchronized Element getElementById(String elementId) Overrides org. Implements org. Doc from org. Returns the Note Attributes with the name "ID" or "id" are not of type ID unless so defined. | |
| getElementById | back to summary |
|---|---|
| private Element getElementById(String elementId, Node node) Recursive method retreives an element by its | |
| getElementsByName | back to summary |
|---|---|
| public NodeList getElementsByName(String elementName) Implements org. Doc from org. Returns the (possibly empty) collection of elements whose
| |
| getElementsByTagName | back to summary |
|---|---|
| public final NodeList getElementsByTagName(String tagName) Overrides org. Implements org. Doc from org. Returns a | |
| getElementsByTagNameNS | back to summary |
|---|---|
| public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) Overrides org. Implements org. Doc from org. Returns a
| |
| getForms | back to summary |
|---|---|
| public HTMLCollection getForms() Implements org. Doc from org. A collection of all the forms of a document. | |
| getHead | back to summary |
|---|---|
| public synchronized 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
Called by
| |
| getImages | back to summary |
|---|---|
| public HTMLCollection getImages() Implements org. Doc from org. A collection of all the | |
| getLinks | back to summary |
|---|---|
| public HTMLCollection getLinks() Implements org. Doc from org. A collection of all | |
| getReferrer | back to summary |
|---|---|
| public String getReferrer() Implements org. Doc from org. Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark). | |
| getTitle | back to summary |
|---|---|
| public synchronized String getTitle() Implements org. Doc from org. The title of a document as specified by the | |
| getURL | back to summary |
|---|---|
| public String getURL() Implements org. Doc from org. The complete URI of the document. | |
| open | back to summary |
|---|---|
| public void open() Implements org. Doc from org. Note. This method and the ones following allow a user to add to or
replace the structure model of a document using strings of unparsed
HTML. At the time of writing alternate methods for providing similar
functionality for both HTML and XML documents were being considered.
The following methods may be deprecated at some point in the future in
favor of a more general-purpose mechanism.
| |
| populateElementType | back to summary |
|---|---|
| private static void populateElementType(String tagName, String className) | |
| populateElementTypes | back to summary |
|---|---|
| private static synchronized void populateElementTypes() Called by the constructor to populate the element types list (see | |
| setBody | back to summary |
|---|---|
| public synchronized void setBody(HTMLElement newBody) Implements org. | |
| setCookie | back to summary |
|---|---|
| public void setCookie(String cookie) Implements org. | |
| setTitle | back to summary |
|---|---|
| public synchronized void setTitle(String newTitle) Implements org. | |
| write | back to summary |
|---|---|
| public void write(String text) Implements org. Doc from org. Write a string of text to a document stream opened by
| |
| writeln | back to summary |
|---|---|
| public void writeln(String text) Implements org. Doc from org. Write a string of text followed by a newline character to a document
stream opened by
| |