Class XMLDocument

java.lang.Object
org.loboevolution.html.js.xml.XMLDocument
All Implemented Interfaces:
EventTarget, Document, Node, NonElementParentNode, ParentNode, DocumentRange, DocumentTraversal

public class XMLDocument extends Object implements Document
XMLDocument class.
  • Constructor Details

    • XMLDocument

      public XMLDocument()
  • Method Details

    • load

      public static XMLDocument load(String fileName)
      Load XML file
      Parameters:
      fileName - name of file in file system
      Returns:
      XMLDocument
    • loadXML

      public String loadXML(String fileName)
      Load XML file
      Parameters:
      fileName - name of file in file system
      Returns:
      XML String
    • getXML

      public String getXML()

      getXML.

      Returns:
      XML String
    • getElementsByTagName

      public HTMLCollection getElementsByTagName(String tagname)
      Retrieves a collection of objects based on the specified element name.
      Specified by:
      getElementsByTagName in interface Document
      Parameters:
      tagname - Specifies the name of an element.
      Returns:
      a HTMLCollection object.
    • getElementById

      public Element getElementById(String id)
      Returns the first element within node's descendants whose ID is elementId. Returns a reference to the first object with the specified value of the ID or NAME attribute.
      Specified by:
      getElementById in interface Document
      Specified by:
      getElementById in interface NonElementParentNode
      Parameters:
      id - a String object.
      Returns:
      a Element object.
    • appendChild

      public Node appendChild(Node newChild)

      appendChild.

      Specified by:
      appendChild in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • prependChild

      public Node prependChild(Node newChild)

      prependChild.

      Specified by:
      prependChild in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • prepend

      public Node prepend(Node newChild)

      prepend.

      Specified by:
      prepend in interface Node
      Parameters:
      newChild - a Node object.
      Returns:
      a Node object.
    • cloneNode

      public Node cloneNode(boolean deep)
      Returns a copy of node. If deep is true, the copy also includes the node's descendants.
      Specified by:
      cloneNode in interface Node
      Parameters:
      deep - a boolean.
      Returns:
      a Node object.
    • compareDocumentPosition

      public short compareDocumentPosition(Node other)

      compareDocumentPosition.

      Specified by:
      compareDocumentPosition in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a short.
    • isSupported

      public boolean isSupported(String xml, String s)
      Specified by:
      isSupported in interface Node
    • hasAttributes

      public boolean hasAttributes()
      Description copied from interface: Node
      Returns true if element has attributes, and false otherwise.
      Specified by:
      hasAttributes in interface Node
      Returns:
      a boolean.
    • getFeature

      public Node getFeature(String name, String version)
      Specified by:
      getFeature in interface Node
    • getBaseURI

      public String getBaseURI()
      Returns node's node document's document base URL.
      Specified by:
      getBaseURI in interface Node
      Returns:
      a String object.
    • getChildNodes

      public NodeList getChildNodes()
      Returns the children.
      Specified by:
      getChildNodes in interface Node
      Returns:
      a NodeList object.
    • getFirstChild

      public Node getFirstChild()
      Returns the first child.
      Specified by:
      getFirstChild in interface Node
      Returns:
      a Node object.
    • getLastChild

      public Node getLastChild()
      Returns the last child.
      Specified by:
      getLastChild in interface Node
      Returns:
      a Node object.
    • getLocalName

      public String getLocalName()

      getLocalName.

      Specified by:
      getLocalName in interface Node
      Returns:
      a String object.
    • getNamespaceURI

      public String getNamespaceURI()

      getNamespaceURI.

      Specified by:
      getNamespaceURI in interface Node
      Returns:
      a String object.
    • getNextSibling

      public Node getNextSibling()
      Returns the next sibling.
      Specified by:
      getNextSibling in interface Node
      Returns:
      a Node object.
    • getNodeName

      public String getNodeName()
      Returns a string appropriate for the type of node.
      Specified by:
      getNodeName in interface Node
      Returns:
      a String object.
    • getNodeType

      public int getNodeType()
      Returns the type of node.
      Specified by:
      getNodeType in interface Node
      Returns:
      a Integer object.
    • getNodeValue

      public String getNodeValue()

      getNodeValue.

      Specified by:
      getNodeValue in interface Node
      Returns:
      a String object.
    • getOwnerDocument

      public Document getOwnerDocument()
      Returns the node document. Returns null for documents.
      Specified by:
      getOwnerDocument in interface Node
      Returns:
      a Document object.
    • getParentNode

      public Node getParentNode()
      Returns the parent.
      Specified by:
      getParentNode in interface Node
      Returns:
      a Node object.
    • getPrefix

      public String getPrefix()
      Returns prefix.
      Specified by:
      getPrefix in interface Node
      Returns:
      a String object.
    • getPreviousSibling

      public Node getPreviousSibling()
      Returns the previous sibling.
      Specified by:
      getPreviousSibling in interface Node
      Returns:
      a Node object.
    • getTextContent

      public String getTextContent()

      getTextContent.

      Specified by:
      getTextContent in interface Node
      Returns:
      a String object.
    • getUserData

      public Object getUserData(String key)

      getUserData.

      Specified by:
      getUserData in interface Node
      Parameters:
      key - a String object.
      Returns:
      a Object object.
    • hasChildNodes

      public boolean hasChildNodes()
      Returns whether node has children.
      Specified by:
      hasChildNodes in interface Node
      Returns:
      a boolean.
    • insertBefore

      public Node insertBefore(Node newChild, Node refChild)

      insertBefore.

      Specified by:
      insertBefore in interface Node
      Parameters:
      newChild - a Node object.
      refChild - a Node object.
      Returns:
      a Node object.
    • isDefaultNamespace

      public boolean isDefaultNamespace(String namespaceURI)

      isDefaultNamespace.

      Specified by:
      isDefaultNamespace in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a boolean.
    • isEqualNode

      public boolean isEqualNode(Node arg)
      Returns whether node and otherNode have the same properties.
      Specified by:
      isEqualNode in interface Node
      Parameters:
      arg - a Node object.
      Returns:
      a boolean.
    • isSameNode

      public boolean isSameNode(Node other)

      isSameNode.

      Specified by:
      isSameNode in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • lookupNamespaceURI

      public String lookupNamespaceURI(String prefix)

      lookupNamespaceURI.

      Specified by:
      lookupNamespaceURI in interface Node
      Parameters:
      prefix - a String object.
      Returns:
      a String object.
    • lookupPrefix

      public String lookupPrefix(String namespaceURI)

      lookupPrefix.

      Specified by:
      lookupPrefix in interface Node
      Parameters:
      namespaceURI - a String object.
      Returns:
      a String object.
    • normalize

      public void normalize()
      Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
      Specified by:
      normalize in interface Node
    • removeChild

      public Node removeChild(Node oldChild)

      removeChild.

      Specified by:
      removeChild in interface Node
      Parameters:
      oldChild - a Node object.
      Returns:
      a Node object.
    • replaceChild

      public Node replaceChild(Node newChild, Node oldChild)

      replaceChild.

      Specified by:
      replaceChild in interface Node
      Parameters:
      newChild - a Node object.
      oldChild - a Node object.
      Returns:
      a Node object.
    • getAttributes

      public NamedNodeMap getAttributes()
      Description copied from interface: Node

      getAttributes.

      Specified by:
      getAttributes in interface Node
      Returns:
      a NamedNodeMap object.
    • setNodeValue

      public void setNodeValue(String nodeValue)

      setNodeValue.

      Specified by:
      setNodeValue in interface Node
      Parameters:
      nodeValue - a String object.
    • setPrefix

      public void setPrefix(String prefix)

      setPrefix.

      Specified by:
      setPrefix in interface Node
      Parameters:
      prefix - a String object.
    • setTextContent

      public void setTextContent(String textContent)

      setTextContent.

      Specified by:
      setTextContent in interface Node
      Parameters:
      textContent - a String object.
    • setUserData

      public Object setUserData(String key, Object data, UserDataHandler handler)

      setUserData.

      Specified by:
      setUserData in interface Node
      Parameters:
      key - a String object.
      data - a Object object.
      handler - a UserDataHandler object.
      Returns:
      a Object object.
    • adoptNode

      public Node adoptNode(Node source)
      Moves node from another document and returns it.

      If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException.

      Specified by:
      adoptNode in interface Document
      Parameters:
      source - a Node object.
      Returns:
      a Node object.
    • createEntityReference

      public EntityReference createEntityReference(String ent1)
      Specified by:
      createEntityReference in interface Document
    • renameNode

      public Node renameNode(Node node, String namespaceURI, String qualifiedName)
      Specified by:
      renameNode in interface Document
    • createAttribute

      public Attr createAttribute(String name)
      Creates an attribute object with a specified name.
      Specified by:
      createAttribute in interface Document
      Parameters:
      name - String that sets the attribute object's name.
      Returns:
      a Attr object.
    • createAttributeNS

      public Attr createAttributeNS(String namespaceURI, String qualifiedName)

      createAttributeNS.

      Specified by:
      createAttributeNS in interface Document
      Parameters:
      namespaceURI - a String object.
      qualifiedName - a String object.
      Returns:
      a Attr object.
    • createCDATASection

      public CDATASection createCDATASection(String data)
      Returns a CDATASection node whose data is data.
      Specified by:
      createCDATASection in interface Document
      Parameters:
      data - a String object.
      Returns:
      a CDATASection object.
    • createComment

      public Comment createComment(String data)
      Creates a comment object with the specified data.
      Specified by:
      createComment in interface Document
      Parameters:
      data - Sets the comment object's data.
      Returns:
      a Comment object.
    • createDocumentFragment

      public DocumentFragment createDocumentFragment()
      Creates a new document.
      Specified by:
      createDocumentFragment in interface Document
      Returns:
      a DocumentFragment object.
    • createElement

      public Element createElement(String tagName)
      Creates an instance of the element for the specified tag.
      Specified by:
      createElement in interface Document
      Parameters:
      tagName - The name of an element.
      Returns:
      a Element object.
    • createElementNS

      public Element createElementNS(String namespaceURI, String qualifiedName)

      createElementNS.

      Specified by:
      createElementNS in interface Document
      Parameters:
      namespaceURI - a String object.
      qualifiedName - a String object.
      Returns:
      a Element object.
    • createProcessingInstruction

      public ProcessingInstruction createProcessingInstruction(String target, String data)
      Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown.
      Specified by:
      createProcessingInstruction in interface Document
      Parameters:
      target - a String object.
      data - a String object.
      Returns:
      a ProcessingInstruction object.
    • createTextNode

      public Text createTextNode(String data)
      Creates a text string from the specified value.
      Specified by:
      createTextNode in interface Document
      Parameters:
      data - String that specifies the nodeValue property of the text node.
      Returns:
      a Text object.
    • getDoctype

      public DocumentType getDoctype()
      Gets an object representing the document type declaration associated with the current document.
      Specified by:
      getDoctype in interface Document
      Returns:
      a DocumentType object.
    • getDocumentElement

      public Element getDocumentElement()
      Gets a reference to the root node of the document.
      Specified by:
      getDocumentElement in interface Document
      Returns:
      a Element object.
    • getDocumentURI

      public String getDocumentURI()
      Returns document's URL.
      Specified by:
      getDocumentURI in interface Document
      Returns:
      a String object.
    • getDomConfig

      public DOMConfiguration getDomConfig()

      getDomConfig.

      Specified by:
      getDomConfig in interface Document
      Returns:
      a DOMConfiguration object.
    • getElementsByTagNameNS

      public HTMLCollection getElementsByTagNameNS(String namespaceURI, String localName)
      If namespace and localName are "*" returns a HTMLCollection of all descendant elements.

      If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName.

      If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace.

      Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.

      Specified by:
      getElementsByTagNameNS in interface Document
      Parameters:
      namespaceURI - a String object.
      localName - a String object.
      Returns:
      a HTMLCollection object.
    • getImplementation

      public DOMImplementation getImplementation()
      Gets the implementation object of the current document.
      Specified by:
      getImplementation in interface Document
      Returns:
      a DOMImplementation object.
    • getInputEncoding

      public String getInputEncoding()
      Returns the character encoding used to create the webpage that is loaded into the document object.
      Specified by:
      getInputEncoding in interface Document
      Returns:
      a String object.
    • getStrictErrorChecking

      public boolean getStrictErrorChecking()

      getStrictErrorChecking.

      Specified by:
      getStrictErrorChecking in interface Document
      Returns:
      a boolean.
    • getXmlEncoding

      public String getXmlEncoding()

      getXmlEncoding.

      Specified by:
      getXmlEncoding in interface Document
      Returns:
      a String object.
    • getXmlStandalone

      public boolean getXmlStandalone()

      getXmlStandalone.

      Specified by:
      getXmlStandalone in interface Document
      Returns:
      a boolean.
    • getXmlVersion

      public String getXmlVersion()

      getXmlVersion.

      Specified by:
      getXmlVersion in interface Document
      Returns:
      a String object.
    • importNode

      public Node importNode(Node importedNode, boolean deep)
      Returns a copy of node. If deep is true, the copy also includes the node's descendants.

      If node is a document or a shadow root, throws a "NotSupportedError" DOMException.

      Specified by:
      importNode in interface Document
      Parameters:
      importedNode - a Node object.
      deep - a boolean.
      Returns:
      a Node object.
    • normalizeDocument

      public void normalizeDocument()

      normalizeDocument.

      Specified by:
      normalizeDocument in interface Document
    • setDocumentURI

      public void setDocumentURI(String documentURI)

      setDocumentURI.

      Specified by:
      setDocumentURI in interface Document
      Parameters:
      documentURI - a String object.
    • setStrictErrorChecking

      public void setStrictErrorChecking(boolean strictErrorChecking)

      setStrictErrorChecking.

      Specified by:
      setStrictErrorChecking in interface Document
      Parameters:
      strictErrorChecking - a boolean.
    • setXmlStandalone

      public void setXmlStandalone(boolean xmlStandalone)

      setXmlStandalone.

      Specified by:
      setXmlStandalone in interface Document
      Parameters:
      xmlStandalone - a boolean.
    • setXmlVersion

      public void setXmlVersion(String xmlVersion)

      setXmlVersion.

      Specified by:
      setXmlVersion in interface Document
      Parameters:
      xmlVersion - a String object.
    • isIsConnected

      public boolean isIsConnected()
      Returns true if node is connected and false otherwise.
      Specified by:
      isIsConnected in interface Node
      Returns:
      a boolean.
    • getParentElement

      public HTMLElement getParentElement()
      Returns the parent element.
      Specified by:
      getParentElement in interface Node
      Returns:
      a HTMLElement object.
    • getRootNode

      public Node getRootNode()
      Returns node's root.
      Specified by:
      getRootNode in interface Node
      Returns:
      a Node object.
    • cloneNode

      public Node cloneNode()

      cloneNode.

      Specified by:
      cloneNode in interface Node
      Returns:
      a Node object.
    • setOwnerDocument

      public void setOwnerDocument(Document document)
      Description copied from interface: Node

      setOwnerDocument.

      Specified by:
      setOwnerDocument in interface Node
      Parameters:
      document - a Document object.
    • contains

      public boolean contains(Node other)
      Returns true if other is an inclusive descendant of node, and false otherwise.
      Specified by:
      contains in interface Node
      Parameters:
      other - a Node object.
      Returns:
      a boolean.
    • addEventListener

      public void addEventListener(String type, Function listener)

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • addEventListener

      public void addEventListener(String type, Function listener, boolean useCapture)

      addEventListener.

      Specified by:
      addEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • removeEventListener

      public void removeEventListener(String type, Function listener)

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
    • removeEventListener

      public void removeEventListener(String type, Function listener, boolean useCapture)

      removeEventListener.

      Specified by:
      removeEventListener in interface EventTarget
      Parameters:
      type - a String object.
      listener - a Function object.
      useCapture - a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Node element, Event evt)

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      element - a Node object.
      evt - a Event object.
      Returns:
      a boolean.
    • dispatchEvent

      public boolean dispatchEvent(Event evt) throws EventException
      Description copied from interface: EventTarget

      dispatchEvent.

      Specified by:
      dispatchEvent in interface EventTarget
      Parameters:
      evt - a Event object.
      Returns:
      a boolean.
      Throws:
      EventException - if any.
    • getChildElementCount

      public int getChildElementCount()

      getChildElementCount.

      Specified by:
      getChildElementCount in interface ParentNode
      Returns:
      a Integer object.
    • getChildren

      public HTMLCollection getChildren()
      Returns the child elements.
      Specified by:
      getChildren in interface ParentNode
      Returns:
      a HTMLCollection object.
    • getFirstElementChild

      public Element getFirstElementChild()
      Returns the first child that is an element, and null otherwise.
      Specified by:
      getFirstElementChild in interface ParentNode
      Returns:
      a Element object.
    • getLastElementChild

      public Element getLastElementChild()
      Returns the last child that is an element, and null otherwise.
      Specified by:
      getLastElementChild in interface ParentNode
      Returns:
      a Element object.
    • querySelector

      public Element querySelector(String selectors)
      Returns the first element that is a descendant of node that matches selectors.
      Specified by:
      querySelector in interface ParentNode
      Parameters:
      selectors - a String object.
      Returns:
      a Element object.
    • querySelectorAll

      public NodeList querySelectorAll(String selectors)
      Returns all element descendants of node that match selectors.
      Specified by:
      querySelectorAll in interface ParentNode
      Parameters:
      selectors - a String object.
      Returns:
      a NodeList object.
    • getURL

      public String getURL()
      Sets or gets the URL for the current document.
      Specified by:
      getURL in interface Document
      Returns:
      a String object.
    • getActiveElement

      public Element getActiveElement()
      Gets the object that has the focus when the parent document has focus.
      Specified by:
      getActiveElement in interface Document
      Returns:
      a Element object.
    • getall

      public HTMLAllCollection getall()
      Returns a reference to the collection of elements contained by the object.
      Specified by:
      getall in interface Document
      Returns:
      a HTMLAllCollection object.
    • getAnchors

      public HTMLCollection getAnchors()
      Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
      Specified by:
      getAnchors in interface Document
      Returns:
      a HTMLCollection object.
    • getApplets

      public HTMLCollection getApplets()
      Retrieves a collection of all applet objects in the document.
      Specified by:
      getApplets in interface Document
      Returns:
      a HTMLCollection object.
    • getCommands

      public HTMLCollection getCommands()

      getCommands.

      Specified by:
      getCommands in interface Document
      Returns:
      a HTMLCollection object.
    • getBgColor

      public String getBgColor()
      Deprecated. Sets or retrieves a value that indicates the background color behind the object.
      Specified by:
      getBgColor in interface Document
      Returns:
      a String object.
    • setBgColor

      public void setBgColor(String bgColor)

      setBgColor.

      Specified by:
      setBgColor in interface Document
      Parameters:
      bgColor - a String object.
    • getBody

      public HTMLElement getBody()
      Specifies the beginning and end of the document body.
      Specified by:
      getBody in interface Document
      Returns:
      a HTMLElement object.
    • setBody

      public void setBody(HTMLElement body)

      setBody.

      Specified by:
      setBody in interface Document
      Parameters:
      body - a HTMLElement object.
    • getCharacterSet

      public String getCharacterSet()
      Returns document's encoding.
      Specified by:
      getCharacterSet in interface Document
      Returns:
      a String object.
    • getCharset

      public String getCharset()
      Gets or sets the character set used to encode the object.
      Specified by:
      getCharset in interface Document
      Returns:
      a String object.
    • getCompatMode

      public String getCompatMode()
      Gets a value that indicates whether standards-compliant mode is switched on for the object.
      Specified by:
      getCompatMode in interface Document
      Returns:
      a String object.
    • getContentType

      public String getContentType()
      Returns document's content type.
      Specified by:
      getContentType in interface Document
      Returns:
      a String object.
    • getCookie

      public String getCookie()
      Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.

      Can be set, to add a new cookie to the element's set of HTTP cookies.

      If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.

      Specified by:
      getCookie in interface Document
      Returns:
      a String object.
    • setCookie

      public void setCookie(String cookie)

      setCookie.

      Specified by:
      setCookie in interface Document
      Parameters:
      cookie - a String object.
    • getCurrentScript

      public HTMLScriptElement getCurrentScript()
      Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.

      Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.

      Specified by:
      getCurrentScript in interface Document
      Returns:
      a HTMLScriptElement object.
    • getDefaultView

      public Window getDefaultView()

      getDefaultView.

      Specified by:
      getDefaultView in interface Document
      Returns:
      a Window object.
    • getDesignMode

      public String getDesignMode()
      Sets or gets a value that indicates whether the document can be edited.
      Specified by:
      getDesignMode in interface Document
      Returns:
      a String object.
    • setDesignMode

      public void setDesignMode(String designMode)

      setDesignMode.

      Specified by:
      setDesignMode in interface Document
      Parameters:
      designMode - a String object.
    • getDir

      public String getDir()
      Sets or retrieves a value that indicates the reading order of the object.
      Specified by:
      getDir in interface Document
      Returns:
      a String object.
    • setDir

      public void setDir(String dir)

      setDir.

      Specified by:
      setDir in interface Document
      Parameters:
      dir - a String object.
    • getDomain

      public String getDomain()
      Sets or gets the security domain of the document.
      Specified by:
      getDomain in interface Document
      Returns:
      a String object.
    • setDomain

      public void setDomain(String domain)

      setDomain.

      Specified by:
      setDomain in interface Document
      Parameters:
      domain - a String object.
    • getEmbeds

      public HTMLCollection getEmbeds()
      Retrieves a collection of all embed objects in the document.
      Specified by:
      getEmbeds in interface Document
      Returns:
      a HTMLCollection object.
    • getFgColor

      public String getFgColor()
      Sets or gets the foreground (text) color of the document.
      Specified by:
      getFgColor in interface Document
      Returns:
      a String object.
    • setFgColor

      public void setFgColor(String fgColor)

      setFgColor.

      Specified by:
      setFgColor in interface Document
      Parameters:
      fgColor - a String object.
    • getForms

      public HTMLCollection getForms()
      Retrieves a collection, in source order, of all form objects in the document.
      Specified by:
      getForms in interface Document
      Returns:
      a HTMLCollection object.
    • isFullscreen

      public boolean isFullscreen()

      isFullscreen.

      Specified by:
      isFullscreen in interface Document
      Returns:
      a boolean.
    • isFullscreenEnabled

      public boolean isFullscreenEnabled()
      Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
      Specified by:
      isFullscreenEnabled in interface Document
      Returns:
      a boolean.
    • getHead

      public HTMLHeadElement getHead()
      Returns the head element.
      Specified by:
      getHead in interface Document
      Returns:
      a HTMLHeadElement object.
    • isHidden

      public boolean isHidden()

      isHidden.

      Specified by:
      isHidden in interface Document
      Returns:
      a boolean.
    • getImages

      public HTMLCollection getImages()
      Retrieves a collection, in source order, of img objects in the document.
      Specified by:
      getImages in interface Document
      Returns:
      a HTMLCollection object.
    • getLastModified

      public String getLastModified()
      Gets the date that the page was last modified, if the page supplies one.
      Specified by:
      getLastModified in interface Document
      Returns:
      a String object.
    • getLinks

      public HTMLCollection getLinks()
      Retrieves a collection of all a objects that specify the href property and all area objects in the document.
      Specified by:
      getLinks in interface Document
      Returns:
      a HTMLCollection object.
    • getLocation

      public Location getLocation()
      Contains information about the current URL.
      Specified by:
      getLocation in interface Document
      Returns:
      a Location object.
    • setLocation

      public void setLocation(Location location)

      setLocation.

      Specified by:
      setLocation in interface Document
      Parameters:
      location - a Location object.
    • getOrigin

      public String getOrigin()
      Returns document's origin.
      Specified by:
      getOrigin in interface Document
      Returns:
      a String object.
    • getPlugins

      public HTMLCollection getPlugins()
      Return an HTMLCollection of the embed elements in the Document.
      Specified by:
      getPlugins in interface Document
      Returns:
      a HTMLCollection object.
    • getReadyState

      public DocumentReadyState getReadyState()
      Retrieves a value that indicates the current state of the object.
      Specified by:
      getReadyState in interface Document
      Returns:
      a DocumentReadyState object.
    • getReferrer

      public String getReferrer()
      Gets the URL of the location that referred the user to the current page.
      Specified by:
      getReferrer in interface Document
      Returns:
      a String object.
    • getScripts

      public HTMLCollection getScripts()
      Retrieves a collection of all script objects in the document.
      Specified by:
      getScripts in interface Document
      Returns:
      a HTMLCollection object.
    • getScrollingElement

      public Element getScrollingElement()

      getScrollingElement.

      Specified by:
      getScrollingElement in interface Document
      Returns:
      a Element object.
    • getTitle

      public String getTitle()
      Contains the title of the document.
      Specified by:
      getTitle in interface Document
      Returns:
      a String object.
    • setTitle

      public void setTitle(String title)

      setTitle.

      Specified by:
      setTitle in interface Document
      Parameters:
      title - a String object.
    • getVisibilityState

      public VisibilityState getVisibilityState()

      getVisibilityState.

      Specified by:
      getVisibilityState in interface Document
      Returns:
      a VisibilityState object.
    • caretRangeFromPoint

      public Range caretRangeFromPoint(double x, double y)

      caretRangeFromPoint.

      Specified by:
      caretRangeFromPoint in interface Document
      Parameters:
      x - a double.
      y - a double.
      Returns:
      a Range object.
    • clear

      public void clear()

      clear.

      Specified by:
      clear in interface Document
    • close

      public void close()
      Closes an output stream and forces the sent data to display.
      Specified by:
      close in interface Document
    • createElementNS

      public Element createElementNS(String namespace, String qualifiedName, String options)
      Returns an element with namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.

      If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.

      If one of the following conditions is true a "NamespaceError" DOMException will be thrown:

      localName does not match the QName production. Namespace prefix is not null and namespace is the empty string. Namespace prefix is "xml" and namespace is not the XML namespace. qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".

      When supplied, options's is can be used to create a customized built-in element.

      Specified by:
      createElementNS in interface Document
      Parameters:
      namespace - a String object.
      qualifiedName - a String object.
      options - a String object.
      Returns:
      a Element object.
    • createEvent

      public Event createEvent(String eventInterface)

      createEvent.

      Specified by:
      createEvent in interface Document
      Parameters:
      eventInterface - a String object.
      Returns:
      a Event object.
    • createNodeIterator

      public NodeIterator createNodeIterator(Node root) throws DOMException
      Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
      Specified by:
      createNodeIterator in interface DocumentTraversal
      Parameters:
      root - a Node object.
      Throws:
      DOMException
    • createNodeIterator

      public NodeIterator createNodeIterator(Node root, int whatToShow) throws DOMException
      Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
      Specified by:
      createNodeIterator in interface DocumentTraversal
      Parameters:
      root - a Node object.
      whatToShow - a Integer object.
      Throws:
      DOMException
    • createNodeIterator

      public NodeIterator createNodeIterator(Node root, NodeFilter filter) throws DOMException
      Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
      Specified by:
      createNodeIterator in interface DocumentTraversal
      Parameters:
      root - a Node object.
      filter - a NodeFilter object.
      Throws:
      DOMException
    • createNodeIterator

      public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter) throws DOMException
      Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
      Specified by:
      createNodeIterator in interface DocumentTraversal
      Parameters:
      root - a Node object.
      whatToShow - a Integer object.
      filter - a NodeFilter object.
      Throws:
      DOMException
    • createRange

      public Range createRange()
      Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
      Specified by:
      createRange in interface DocumentRange
      Returns:
      a Range object.
    • createTreeWalker

      public TreeWalker createTreeWalker(Node root) throws DOMException

      createTreeWalker.

      Specified by:
      createTreeWalker in interface DocumentTraversal
      Parameters:
      root - a Node object.
      Throws:
      DOMException
    • createTreeWalker

      public TreeWalker createTreeWalker(Node root, int whatToShow) throws DOMException

      createTreeWalker.

      Specified by:
      createTreeWalker in interface DocumentTraversal
      Parameters:
      root - a Node object.
      whatToShow - a Integer object.
      Throws:
      DOMException
    • createTreeWalker

      public TreeWalker createTreeWalker(Node root, NodeFilter filter) throws DOMException

      createTreeWalker.

      Specified by:
      createTreeWalker in interface DocumentTraversal
      Parameters:
      root - a Node object.
      filter - a NodeFilter object.
      Throws:
      DOMException
    • createTreeWalker

      public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter) throws DOMException
      Description copied from interface: DocumentTraversal

      createTreeWalker.

      Specified by:
      createTreeWalker in interface DocumentTraversal
      Parameters:
      root - a Node object.
      whatToShow - a Integer object.
      filter - a NodeFilter object.
      Throws:
      DOMException
    • elementFromPoint

      public Element elementFromPoint(double x, double y)
      Returns the element for the specified x coordinate and the specified y coordinate.
      Specified by:
      elementFromPoint in interface Document
      Parameters:
      x - The x-offset
      y - The y-offset
      Returns:
      a Element object.
    • execCommand

      public boolean execCommand(String commandId, boolean showUI, String value)
      Executes a command on the current document, current selection, or the given range.
      Specified by:
      execCommand in interface Document
      Parameters:
      commandId - String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
      showUI - Display the user interface, defaults to false.
      value - Value to assign.
      Returns:
      a boolean.
    • execCommand

      public boolean execCommand(String commandId, boolean showUI)

      execCommand.

      Specified by:
      execCommand in interface Document
      Parameters:
      commandId - a String object.
      showUI - a boolean.
      Returns:
      a boolean.
    • execCommand

      public boolean execCommand(String commandId)

      execCommand.

      Specified by:
      execCommand in interface Document
      Parameters:
      commandId - a String object.
      Returns:
      a boolean.
    • getElementsByClassName

      public HTMLCollection getElementsByClassName(String classNames)
      Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
      Specified by:
      getElementsByClassName in interface Document
      Parameters:
      classNames - a String object.
      Returns:
      a HTMLCollection object.
    • getElementsByName

      public HTMLCollection getElementsByName(String elementName)
      Gets a collection of objects based on the value of the NAME or ID attribute.
      Specified by:
      getElementsByName in interface Document
      Parameters:
      elementName - Gets a collection of objects based on the value of the NAME or ID attribute.
      Returns:
      a HTMLCollection object.
    • getSelection

      public Selection getSelection()
      Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
      Specified by:
      getSelection in interface Document
      Returns:
      a Selection object.
    • hasFocus

      public boolean hasFocus()
      Gets a value indicating whether the object currently has focus.
      Specified by:
      hasFocus in interface Document
      Returns:
      a boolean.
    • open

      public Document open(String url, String name, String features, boolean replace)
      Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
      Specified by:
      open in interface Document
      Parameters:
      url - Specifies a MIME type for the document.
      name - Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
      features - Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.
      replace - Specifies whether the existing entry for the document is replaced in the history list.
      Returns:
      a Document object.
    • open

      public Document open(String url, String name, String features)

      open.

      Specified by:
      open in interface Document
      Parameters:
      url - a String object.
      name - a String object.
      features - a String object.
      Returns:
      a Document object.
    • open

      public Document open(String url, String name)

      open.

      Specified by:
      open in interface Document
      Parameters:
      url - a String object.
      name - a String object.
      Returns:
      a Document object.
    • open

      public Document open(String url)

      open.

      Specified by:
      open in interface Document
      Parameters:
      url - a String object.
      Returns:
      a Document object.
    • open

      public Document open()

      open.

      Specified by:
      open in interface Document
      Returns:
      a Document object.
    • queryCommandEnabled

      public boolean queryCommandEnabled(String commandId)
      Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
      Specified by:
      queryCommandEnabled in interface Document
      Parameters:
      commandId - Specifies a command identifier.
      Returns:
      a boolean.
    • queryCommandIndeterm

      public boolean queryCommandIndeterm(String commandId)
      Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
      Specified by:
      queryCommandIndeterm in interface Document
      Parameters:
      commandId - String that specifies a command identifier.
      Returns:
      a boolean.
    • queryCommandState

      public boolean queryCommandState(String commandId)
      Returns a Boolean value that indicates the current state of the command.
      Specified by:
      queryCommandState in interface Document
      Parameters:
      commandId - String that specifies a command identifier.
      Returns:
      a boolean.
    • queryCommandSupported

      public boolean queryCommandSupported(String commandId)
      Returns a Boolean value that indicates whether the current command is supported on the current range.
      Specified by:
      queryCommandSupported in interface Document
      Parameters:
      commandId - Specifies a command identifier.
      Returns:
      a boolean.
    • queryCommandValue

      public String queryCommandValue(String commandId)
      Returns the current value of the document, range, or current selection for the given command.
      Specified by:
      queryCommandValue in interface Document
      Parameters:
      commandId - String that specifies a command identifier.
      Returns:
      a String object.
    • releaseEvents

      public void releaseEvents()

      releaseEvents.

      Specified by:
      releaseEvents in interface Document
    • write

      public void write(String text)
      Writes one or more HTML expressions to a document in the specified window.
      Specified by:
      write in interface Document
      Parameters:
      text - Specifies the text and HTML tags to write.
    • writeln

      public void writeln(String text)
      Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
      Specified by:
      writeln in interface Document
      Parameters:
      text - The text and HTML tags to write.
    • createExpression

      public XPathExpression createExpression()

      createExpression.

      Specified by:
      createExpression in interface Document
      Returns:
      a XPathExpression object.
    • createNSResolver

      public XPathNSResolver createNSResolver(Node nodeResolver)

      createNSResolver.

      Specified by:
      createNSResolver in interface Document
      Parameters:
      nodeResolver - a Node object.
      Returns:
      a XPathNSResolver object.
    • evaluate

      public XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result)

      evaluate.

      Specified by:
      evaluate in interface Document
      Parameters:
      expression - a String object.
      contextNode - a Node object.
      resolver - a XPathNSResolver object.
      type - a short.
      result - a Object object.
      Returns:
      a XPathResult object.
    • isXml

      public boolean isXml()
      Specified by:
      isXml in interface Document
    • setXml

      public void setXml(boolean xml)
      Specified by:
      setXml in interface Document
    • toString

      public String toString()
      Overrides:
      toString in class Object