Class HTMLDocumentImpl

    • Method Detail

      • getLocales

        public java.util.Set getLocales()
        Gets an immutable set of locales previously set for this document.
      • setLocales

        public void setLocales​(java.util.Set locales)
        Sets the locales of the document. This helps determine whether specific fonts can display text in the languages of all the locales.
        Parameters:
        locales - An immutable set of java.util.Locale instances.
      • getBaseURI

        public java.lang.String getBaseURI()
        Specified by:
        getBaseURI in interface org.w3c.dom.Node
        Overrides:
        getBaseURI in class NodeImpl
      • setBaseURI

        public void setBaseURI​(java.lang.String value)
      • getDefaultTarget

        public java.lang.String getDefaultTarget()
      • setDefaultTarget

        public void setDefaultTarget​(java.lang.String value)
      • getTextContent

        public java.lang.String getTextContent()
                                        throws org.w3c.dom.DOMException
        Description copied from class: NodeImpl
        Gets the text content of this node and its descendents.
        Specified by:
        getTextContent in interface org.w3c.dom.Node
        Overrides:
        getTextContent in class NodeImpl
        Throws:
        org.w3c.dom.DOMException
      • setTextContent

        public void setTextContent​(java.lang.String textContent)
                            throws org.w3c.dom.DOMException
        Specified by:
        setTextContent in interface org.w3c.dom.Node
        Overrides:
        setTextContent in class NodeImpl
        Throws:
        org.w3c.dom.DOMException
      • getTitle

        public java.lang.String getTitle()
        Description copied from interface: HTMLDocument
        The title of a document as specified by the TITLE element in the head of the document.
        Specified by:
        getTitle in interface HTMLDocument
      • setTitle

        public void setTitle​(java.lang.String title)
        Description copied from interface: HTMLDocument
        The title of a document as specified by the TITLE element in the head of the document.
        Specified by:
        setTitle in interface HTMLDocument
      • getReferrer

        public java.lang.String getReferrer()
        Description copied from interface: HTMLDocument
        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).
        Specified by:
        getReferrer in interface HTMLDocument
      • setReferrer

        public void setReferrer​(java.lang.String value)
      • getDomain

        public java.lang.String getDomain()
        Description copied from interface: HTMLDocument
        The domain name of the server that served the document, or null if the server cannot be identified by a domain name.
        Specified by:
        getDomain in interface HTMLDocument
      • setDomain

        public void setDomain​(java.lang.String domain)
      • getBody

        public HTMLElement getBody()
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        getBody in interface HTMLDocument
      • getImages

        public HTMLCollection getImages()
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        getImages in interface HTMLDocument
      • getApplets

        public HTMLCollection getApplets()
        Description copied from interface: HTMLDocument
        A collection of all the OBJECT elements that include applets and APPLET (deprecated) elements in a document.
        Specified by:
        getApplets in interface HTMLDocument
      • getLinks

        public HTMLCollection getLinks()
        Description copied from interface: HTMLDocument
        A collection of all AREA elements and anchor ( A) elements in a document with a value for the href attribute.
        Specified by:
        getLinks in interface HTMLDocument
      • getAnchors

        public HTMLCollection getAnchors()
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        getAnchors in interface HTMLDocument
      • getCookie

        public java.lang.String getCookie()
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        getCookie in interface HTMLDocument
      • setCookie

        public void setCookie​(java.lang.String cookie)
                       throws org.w3c.dom.DOMException
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        setCookie in interface HTMLDocument
        Throws:
        org.w3c.dom.DOMException - SYNTAX_ERR: If the new value does not adhere to the cookie syntax specified by [IETF RFC 2965].
      • open

        public void open()
        Description copied from interface: HTMLDocument
        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]).
        Specified by:
        open in interface HTMLDocument
      • load

        public void load()
                  throws java.io.IOException,
                         org.xml.sax.SAXException,
                         java.io.UnsupportedEncodingException
        Loads the document from the reader provided when the current instance of HTMLDocumentImpl was constructed. It then closes the reader.
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        java.io.UnsupportedEncodingException
      • load

        public void load​(boolean closeReader)
                  throws java.io.IOException,
                         org.xml.sax.SAXException,
                         java.io.UnsupportedEncodingException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        java.io.UnsupportedEncodingException
      • close

        public void close()
        Description copied from interface: HTMLDocument
        Closes a document stream opened by open() and forces rendering.
        Specified by:
        close in interface HTMLDocument
      • write

        public void write​(java.lang.String text)
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        write in interface HTMLDocument
        Parameters:
        text - The string to be parsed into some structure in the document structure model.
      • writeln

        public void writeln​(java.lang.String text)
        Description copied from interface: HTMLDocument
        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
        Specified by:
        writeln in interface HTMLDocument
        Parameters:
        text - The string to be parsed into some structure in the document structure model.
      • getElementsByName

        public org.w3c.dom.NodeList getElementsByName​(java.lang.String elementName)
        Gets the collection of elements whose name attribute is elementName.
        Specified by:
        getElementsByName in interface HTMLDocument
        Parameters:
        elementName - The name attribute value for an element.
        Returns:
        The matching elements.
      • getDoctype

        public org.w3c.dom.DocumentType getDoctype()
        Specified by:
        getDoctype in interface org.w3c.dom.Document
      • setDoctype

        public void setDoctype​(org.w3c.dom.DocumentType doctype)
      • getDocumentElement

        public org.w3c.dom.Element getDocumentElement()
        Specified by:
        getDocumentElement in interface org.w3c.dom.Document
      • 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
        Throws:
        org.w3c.dom.DOMException
      • createDocumentFragment

        public org.w3c.dom.DocumentFragment createDocumentFragment()
        Specified by:
        createDocumentFragment in interface org.w3c.dom.Document
      • createTextNode

        public org.w3c.dom.Text createTextNode​(java.lang.String data)
        Specified by:
        createTextNode in interface org.w3c.dom.Document
      • createComment

        public org.w3c.dom.Comment createComment​(java.lang.String data)
        Specified by:
        createComment in interface org.w3c.dom.Document
      • createCDATASection

        public org.w3c.dom.CDATASection createCDATASection​(java.lang.String data)
                                                    throws org.w3c.dom.DOMException
        Specified by:
        createCDATASection in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • createProcessingInstruction

        public org.w3c.dom.ProcessingInstruction createProcessingInstruction​(java.lang.String target,
                                                                             java.lang.String data)
                                                                      throws org.w3c.dom.DOMException
        Specified by:
        createProcessingInstruction in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • createAttribute

        public org.w3c.dom.Attr createAttribute​(java.lang.String name)
                                         throws org.w3c.dom.DOMException
        Specified by:
        createAttribute in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • createEntityReference

        public org.w3c.dom.EntityReference createEntityReference​(java.lang.String name)
                                                          throws org.w3c.dom.DOMException
        Specified by:
        createEntityReference in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getElementsByTagName

        public org.w3c.dom.NodeList getElementsByTagName​(java.lang.String tagname)
        Gets all elements that match the given tag name.
        Specified by:
        getElementsByTagName in interface org.w3c.dom.Document
        Parameters:
        tagname - The element tag name or an asterisk character (*) to match all elements.
      • importNode

        public org.w3c.dom.Node importNode​(org.w3c.dom.Node importedNode,
                                           boolean deep)
                                    throws org.w3c.dom.DOMException
        Specified by:
        importNode in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • createElementNS

        public org.w3c.dom.Element createElementNS​(java.lang.String namespaceURI,
                                                   java.lang.String qualifiedName)
                                            throws org.w3c.dom.DOMException
        Specified by:
        createElementNS in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • createAttributeNS

        public org.w3c.dom.Attr createAttributeNS​(java.lang.String namespaceURI,
                                                  java.lang.String qualifiedName)
                                           throws org.w3c.dom.DOMException
        Specified by:
        createAttributeNS in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getElementsByTagNameNS

        public org.w3c.dom.NodeList getElementsByTagNameNS​(java.lang.String namespaceURI,
                                                           java.lang.String localName)
        Specified by:
        getElementsByTagNameNS in interface org.w3c.dom.Document
      • getElementById

        public org.w3c.dom.Element getElementById​(java.lang.String elementId)
        Specified by:
        getElementById in interface org.w3c.dom.Document
      • namedItem

        public org.w3c.dom.Element namedItem​(java.lang.String name)
      • getInputEncoding

        public java.lang.String getInputEncoding()
        Specified by:
        getInputEncoding in interface org.w3c.dom.Document
      • getXmlEncoding

        public java.lang.String getXmlEncoding()
        Specified by:
        getXmlEncoding in interface org.w3c.dom.Document
      • getXmlStandalone

        public boolean getXmlStandalone()
        Specified by:
        getXmlStandalone in interface org.w3c.dom.Document
      • setXmlStandalone

        public void setXmlStandalone​(boolean xmlStandalone)
                              throws org.w3c.dom.DOMException
        Specified by:
        setXmlStandalone in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getXmlVersion

        public java.lang.String getXmlVersion()
        Specified by:
        getXmlVersion in interface org.w3c.dom.Document
      • setXmlVersion

        public void setXmlVersion​(java.lang.String xmlVersion)
                           throws org.w3c.dom.DOMException
        Specified by:
        setXmlVersion in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getStrictErrorChecking

        public boolean getStrictErrorChecking()
        Specified by:
        getStrictErrorChecking in interface org.w3c.dom.Document
      • setStrictErrorChecking

        public void setStrictErrorChecking​(boolean strictErrorChecking)
        Specified by:
        setStrictErrorChecking in interface org.w3c.dom.Document
      • getDocumentURI

        public java.lang.String getDocumentURI()
        Specified by:
        getDocumentURI in interface org.w3c.dom.Document
      • setDocumentURI

        public void setDocumentURI​(java.lang.String documentURI)
        Specified by:
        setDocumentURI in interface org.w3c.dom.Document
      • adoptNode

        public org.w3c.dom.Node adoptNode​(org.w3c.dom.Node source)
                                   throws org.w3c.dom.DOMException
        Specified by:
        adoptNode in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getDomConfig

        public org.w3c.dom.DOMConfiguration getDomConfig()
        Specified by:
        getDomConfig in interface org.w3c.dom.Document
      • normalizeDocument

        public void normalizeDocument()
        Specified by:
        normalizeDocument in interface org.w3c.dom.Document
      • renameNode

        public org.w3c.dom.Node renameNode​(org.w3c.dom.Node n,
                                           java.lang.String namespaceURI,
                                           java.lang.String qualifiedName)
                                    throws org.w3c.dom.DOMException
        Specified by:
        renameNode in interface org.w3c.dom.Document
        Throws:
        org.w3c.dom.DOMException
      • getImplementation

        public org.w3c.dom.DOMImplementation getImplementation()
        Specified by:
        getImplementation in interface org.w3c.dom.Document
      • getLocalName

        public java.lang.String getLocalName()
        Specified by:
        getLocalName in interface org.w3c.dom.Node
        Specified by:
        getLocalName in class NodeImpl
      • getNodeName

        public java.lang.String getNodeName()
        Specified by:
        getNodeName in interface org.w3c.dom.Node
        Specified by:
        getNodeName in class NodeImpl
      • getNodeType

        public short getNodeType()
        Specified by:
        getNodeType in interface org.w3c.dom.Node
        Specified by:
        getNodeType in class NodeImpl
      • getNodeValue

        public java.lang.String getNodeValue()
                                      throws org.w3c.dom.DOMException
        Specified by:
        getNodeValue in interface org.w3c.dom.Node
        Specified by:
        getNodeValue in class NodeImpl
        Throws:
        org.w3c.dom.DOMException
      • setNodeValue

        public void setNodeValue​(java.lang.String nodeValue)
                          throws org.w3c.dom.DOMException
        Specified by:
        setNodeValue in interface org.w3c.dom.Node
        Specified by:
        setNodeValue in class NodeImpl
        Throws:
        org.w3c.dom.DOMException
      • getLocation

        public final Location getLocation()
      • setLocation

        public void setLocation​(java.lang.String location)
      • setBody

        public void setBody​(HTMLElement body)
        Description copied from interface: HTMLDocument
        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.
        Specified by:
        setBody in interface HTMLDocument
      • allInvalidated

        public void allInvalidated​(boolean forgetRenderStates)
      • getStyleSheets

        public java.util.Collection getStyleSheets()
      • sizeInvalidated

        public void sizeInvalidated​(NodeImpl node)
      • 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.
        Parameters:
        node -
      • positionInParentInvalidated

        public void positionInParentInvalidated​(NodeImpl node)
        Changed if the position of the node in a parent has changed.
        Parameters:
        node -
      • 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.
        Parameters:
        node -
      • structureInvalidated

        public void structureInvalidated​(NodeImpl node)
        This is called when children of the node might have changed.
        Parameters:
        node -
      • nodeLoaded

        public void nodeLoaded​(NodeImpl node)
      • externalScriptLoading

        public void externalScriptLoading​(NodeImpl node)
      • allInvalidated

        public void allInvalidated()
        Informs listeners that the whole document has been invalidated.
      • loadImage

        protected void loadImage​(java.lang.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.
        Parameters:
        relativeUri -
        imageListener -
      • getOnloadHandler

        public org.mozilla.javascript.Function getOnloadHandler()
      • setOnloadHandler

        public void setOnloadHandler​(org.mozilla.javascript.Function onloadHandler)
      • setUserData

        public java.lang.Object setUserData​(java.lang.String key,
                                            java.lang.Object data,
                                            org.w3c.dom.UserDataHandler handler)
        Specified by:
        setUserData in interface org.w3c.dom.Node
        Overrides:
        setUserData in class NodeImpl
      • createSimilarNode

        protected org.w3c.dom.Node createSimilarNode()
        Description copied from class: NodeImpl
        Should create a node with some cloned properties, like the node name, but not attributes or children.
        Specified by:
        createSimilarNode in class NodeImpl