addDocumentNotificationListener
public void addDocumentNotificationListener(DocumentNotificationListener listener)
Adds a document notification listener, which is informed about
changes to the document.
adoptNode
public Node adoptNode(Node source)
throws DOMException
allInvalidated
public void allInvalidated()
close
public void close()
Closes a document stream opened by open()
and forces
rendering.
- close in interface HTMLDocument
createAttribute
public Attr createAttribute(String name)
throws DOMException
createAttributeNS
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
throws DOMException
createCDATASection
public CDATASection createCDATASection(String data)
throws DOMException
createComment
public Comment createComment(String data)
createDocumentFragment
public DocumentFragment createDocumentFragment()
createElement
public Element createElement(String tagName)
throws DOMException
createElementNS
public Element createElementNS(String namespaceURI,
String qualifiedName)
throws DOMException
createEntityReference
public EntityReference createEntityReference(String name)
throws DOMException
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String target,
String data)
throws DOMException
createSimilarNode
protected Node createSimilarNode()
Should create a node with some cloned properties, like the node name,
but not attributes or children.
- createSimilarNode in interface NodeImpl
createTextNode
public Text createTextNode(String data)
externalScriptLoading
public void externalScriptLoading(NodeImpl node)
getAnchors
public HTMLCollection getAnchors()
A collection of all the anchor (
A
) elements in a document
with a value for the
name
attribute. For reasons of
backward compatibility, the returned set of anchors only contains
those anchors created with the
name
attribute, not those
created with the
id
attribute. Note that in [
XHTML 1.0], the
name
attribute (see section 4.10) has no semantics and
is only present for legacy user agents: the
id
attribute
is used instead. Users should prefer the iterator mechanisms provided
by [
DOM Level 2 Traversal] instead.
- getAnchors in interface HTMLDocument
getApplets
public HTMLCollection getApplets()
A collection of all the OBJECT
elements that include
applets and APPLET
(deprecated) elements in a document.
- getApplets in interface HTMLDocument
getBody
public HTMLElement getBody()
The element that contains the content for the document. In documents
with BODY
contents, returns the BODY
element. In frameset documents, this returns the outermost
FRAMESET
element.
- getBody in interface HTMLDocument
getCookie
public String getCookie()
This mutable string attribute denotes persistent state information
that (1) is associated with the current frame or document and (2) is
composed of information described by the
cookies
non-terminal of [
IETF RFC 2965], Section 4.2.2.
If no persistent state information is available for the current
frame or document document, then this property's value is an empty
string.
When this attribute is read, all cookies are returned as a single
string, with each cookie's name-value pair concatenated into a list
of name-value pairs, each list item being separated by a ';'
(semicolon).
When this attribute is set, the value it is set to should be a
string that adheres to the
cookie
non-terminal of [
IETF RFC 2965]; that
is, it should be a single name-value pair followed by zero or more
cookie attribute values. If no domain attribute is specified, then
the domain attribute for the new value defaults to the host portion
of an absolute URI [
IETF RFC 2396] of the current frame or document. If no path
attribute is specified, then the path attribute for the new value
defaults to the absolute path portion of the URI [
IETF RFC 2396] of the current
frame or document. If no max-age attribute is specified, then the
max-age attribute for the new value defaults to a user agent defined
value. If a cookie with the specified name is already associated with
the current frame or document, then the new value as well as the new
attributes replace the old value and attributes. If a max-age
attribute of 0 is specified for the new value, then any existing
cookies of the specified name are removed from the cookie storage.
See [
IETF RFC 2965] for the semantics of persistent state item attribute value
pairs. The precise nature of a user agent session is not defined by
this specification.
- getCookie in interface HTMLDocument
getDefaultTarget
public String getDefaultTarget()
getDoctype
public DocumentType getDoctype()
getDocumentElement
public Element getDocumentElement()
getDocumentURI
public String getDocumentURI()
getDomConfig
public DOMConfiguration getDomConfig()
getDomain
public String getDomain()
The domain name of the server that served the document, or
null
if the server cannot be identified by a domain
name.
- getDomain in interface HTMLDocument
getElementById
public Element getElementById(String elementId)
getElementsByName
public NodeList getElementsByName(String elementName)
Gets the collection of elements whose name
attribute is elementName
.
- getElementsByName in interface HTMLDocument
getElementsByTagName
public NodeList getElementsByTagName(String tagname)
Gets all elements that match the given tag name.
tagname
- The element tag name or an asterisk
character (*) to match all elements.
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
getImages
public HTMLCollection getImages()
A collection of all the
IMG
elements in a document. The
behavior is limited to
IMG
elements for backwards
compatibility. As suggested by [
HTML 4.01], to include images, authors may use
the
OBJECT
element or the
IMG
element.
Therefore, it is recommended not to use this attribute to find the
images in the document but
getElementsByTagName
with
HTML 4.01 or
getElementsByTagNameNS
with XHTML 1.0.
- getImages in interface HTMLDocument
getImplementation
public DOMImplementation getImplementation()
getInputEncoding
public String getInputEncoding()
getLinks
public HTMLCollection getLinks()
A collection of all AREA
elements and anchor (
A
) elements in a document with a value for the
href
attribute.
- getLinks in interface HTMLDocument
getLocation
public final Location getLocation()
getOnloadHandler
public Function getOnloadHandler()
getReferrer
public String getReferrer()
Returns the URI [
IETF RFC 2396] 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).
- getReferrer in interface HTMLDocument
getStrictErrorChecking
public boolean getStrictErrorChecking()
getStyleSheets
public Collection getStyleSheets()
getTextContent
public String getTextContent()
throws DOMException
Gets the text content of this node
and its descendents.
- getTextContent in interface NodeImpl
getTitle
public String getTitle()
The title of a document as specified by the TITLE
element
in the head of the document.
- getTitle in interface HTMLDocument
getXmlEncoding
public String getXmlEncoding()
getXmlStandalone
public boolean getXmlStandalone()
getXmlVersion
public String getXmlVersion()
importNode
public Node importNode(Node importedNode,
boolean deep)
throws DOMException
invalidated
public void invalidated(NodeImpl node)
This is called when the node has changed, but
it is unclear if it's a size change or a look
change. An attribute change should trigger this.
load
public void load()
throws IOException,
SAXException,
UnsupportedEncodingException
Loads the document from the reader provided when it was constructed.
It then closes the reader.
load
public void load(boolean closeReader)
throws IOException,
SAXException,
UnsupportedEncodingException
loadImage
protected void loadImage(String relativeUri,
ImageListener imageListener)
Loads images asynchronously such that they are shared if loaded
simultaneously from the same URI.
Informs the listener immediately if an image is already known.
relativeUri
- imageListener
-
lookInvalidated
public void lookInvalidated(NodeImpl node)
Called if something such as a color or
decoration has changed. This would be
something which does not affect the
rendered size, and can be revalidated
with a simple repaint.
namedItem
public Element namedItem(String name)
nodeLoaded
public void nodeLoaded(NodeImpl node)
normalizeDocument
public void normalizeDocument()
open
public void open()
Open a document stream for writing. If a document exists in the target,
this method clears it. 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 (see [
DOM Level 3 Load and Save]).
- open in interface HTMLDocument
positionInParentInvalidated
public void positionInParentInvalidated(NodeImpl node)
Changed if the position of the node in a
parent has changed.
renameNode
public Node renameNode(Node n,
String namespaceURI,
String qualifiedName)
throws DOMException
setBaseURI
public void setBaseURI(String value)
setBody
public void setBody(HTMLElement body)
The element that contains the content for the document. In documents
with BODY
contents, returns the BODY
element. In frameset documents, this returns the outermost
FRAMESET
element.
- setBody in interface HTMLDocument
setCookie
public void setCookie(String cookie)
throws DOMException
This mutable string attribute denotes persistent state information
that (1) is associated with the current frame or document and (2) is
composed of information described by the
cookies
non-terminal of [
IETF RFC 2965], Section 4.2.2.
If no persistent state information is available for the current
frame or document document, then this property's value is an empty
string.
When this attribute is read, all cookies are returned as a single
string, with each cookie's name-value pair concatenated into a list
of name-value pairs, each list item being separated by a ';'
(semicolon).
When this attribute is set, the value it is set to should be a
string that adheres to the
cookie
non-terminal of [
IETF RFC 2965]; that
is, it should be a single name-value pair followed by zero or more
cookie attribute values. If no domain attribute is specified, then
the domain attribute for the new value defaults to the host portion
of an absolute URI [
IETF RFC 2396] of the current frame or document. If no path
attribute is specified, then the path attribute for the new value
defaults to the absolute path portion of the URI [
IETF RFC 2396] of the current
frame or document. If no max-age attribute is specified, then the
max-age attribute for the new value defaults to a user agent defined
value. If a cookie with the specified name is already associated with
the current frame or document, then the new value as well as the new
attributes replace the old value and attributes. If a max-age
attribute of 0 is specified for the new value, then any existing
cookies of the specified name are removed from the cookie storage.
See [
IETF RFC 2965] for the semantics of persistent state item attribute value
pairs. The precise nature of a user agent session is not defined by
this specification.
- setCookie in interface HTMLDocument
setDefaultTarget
public void setDefaultTarget(String value)
setDoctype
public void setDoctype(DocumentType doctype)
setDocumentURI
public void setDocumentURI(String documentURI)
setDomain
public void setDomain(String domain)
setLocation
public void setLocation(String location)
setNodeValue
public void setNodeValue(String nodeValue)
throws DOMException
- setNodeValue in interface NodeImpl
setOnloadHandler
public void setOnloadHandler(Function onloadHandler)
setReferrer
public void setReferrer(String value)
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking)
setTextContent
public void setTextContent(String textContent)
throws DOMException
- setTextContent in interface NodeImpl
setTitle
public void setTitle(String title)
The title of a document as specified by the TITLE
element
in the head of the document.
- setTitle in interface HTMLDocument
setUserData
public Object setUserData(String key,
Object data,
UserDataHandler handler)
- setUserData in interface NodeImpl
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone)
throws DOMException
setXmlVersion
public void setXmlVersion(String xmlVersion)
throws DOMException
sizeInvalidated
public void sizeInvalidated(NodeImpl node)
structureInvalidated
public void structureInvalidated(NodeImpl node)
This is called when children of the node might
have changed.
write
public void write(String text)
Write a string of text to a document stream opened by
open()
. Note that the function will produce a document
which is not necessarily driven by a DTD and therefore might be
produce an invalid result in the context of the document.
- write in interface HTMLDocument
text
- The string to be parsed into some structure in the
document structure model.
writeln
public void writeln(String text)
Write a string of text followed by a newline character to a document
stream opened by open()
. Note that the function will
produce a document which is not necessarily driven by a DTD and
therefore might be produce an invalid result in the context of the
document
- writeln in interface HTMLDocument
text
- The string to be parsed into some structure in the
document structure model.