Class DocumentImpl

All Implemented Interfaces:
Cloneable, EventTarget, ModelNode, Document, Node, NonElementParentNode, ParentNode, DocumentRange, XPathEvaluator, ScriptableDelegate, DocumentTraversal
Direct Known Subclasses:
HTMLDocumentImpl

public class DocumentImpl extends NodeImpl implements Document, XPathEvaluator

DocumentImpl class.

  • Field Details

  • Constructor Details

    • DocumentImpl

      public DocumentImpl()
  • Method Details

    • 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.
    • renameNode

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

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

      public EntityReference createEntityReference(String entity)
      Specified by:
      createEntityReference in interface Document
    • createElementNS

      public Element createElementNS(String nUri, String qName)

      createElementNS.

      Specified by:
      createElementNS in interface Document
      Parameters:
      nUri - a String object.
      qName - a String object.
      Returns:
      a Element object.
    • createElementNS

      public Element createElementNS(String namespaceURI, 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:
      namespaceURI - a String object.
      qualifiedName - a String object.
      options - a String object.
      Returns:
      a Element object.
    • 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.
    • 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.
    • 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.
    • 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.
    • getChildElementCount

      public int getChildElementCount()

      getChildElementCount.

      Specified by:
      getChildElementCount in interface ParentNode
      Returns:
      a Integer 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 selector)
      Returns all element descendants of node that match selectors.
      Specified by:
      querySelectorAll in interface ParentNode
      Parameters:
      selector - a String object.
      Returns:
      a NodeList 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.
    • setDoctype

      public void setDoctype(DocumentType doctype)

      Setter for the field doctype.

      Parameters:
      doctype - 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.
    • 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.
    • 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 nUri, String qName) throws DOMException

      createAttributeNS.

      Specified by:
      createAttributeNS in interface Document
      Parameters:
      nUri - a String object.
      qName - a String object.
      Returns:
      a Attr object.
      Throws:
      DOMException
    • 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.
    • 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.
    • getDomConfig

      public DOMConfiguration getDomConfig()

      getDomConfig.

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

      public Element getElementById(String elementId)
      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:
      elementId - a String object.
      Returns:
      a Element object.
    • getImplementation

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

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

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

      public void setDocumentURI(String documentURI)

      setDocumentURI.

      Specified by:
      setDocumentURI in interface Document
      Parameters:
      documentURI - a String 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.
    • getXmlEncoding

      public String getXmlEncoding()

      getXmlEncoding.

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

      public void normalizeDocument()

      normalizeDocument.

      Specified by:
      normalizeDocument in interface Document
    • getStrictErrorChecking

      public boolean getStrictErrorChecking()

      getStrictErrorChecking.

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

      public void setStrictErrorChecking(boolean strictErrorChecking)

      setStrictErrorChecking.

      Specified by:
      setStrictErrorChecking in interface Document
      Parameters:
      strictErrorChecking - a boolean.
    • 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.
    • 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.
    • createEvent

      public Event createEvent(String eventType) throws DOMException

      createEvent.

      Specified by:
      createEvent in interface Document
      Parameters:
      eventType - a String object.
      Returns:
      a Event object.
      Throws:
      DOMException
    • createExpression

      public XPathExpression createExpression(String expression, XPathNSResolver resolver)
      Creates a parsed XPath expression with resolved namespaces. This is useful when an expression will be reused in an application since it makes it possible to compile the expression string into a more efficient internal form and preresolve all namespace prefixes which occur within the expression.
      Specified by:
      createExpression in interface XPathEvaluator
      Parameters:
      expression - The XPath expression string to be parsed.
      resolver - The resolver permits translation of prefixes within the XPath expression into appropriate namespace URIs . If this is specified as null, any namespace prefix within the expression will result in DOMException being thrown with the code NAMESPACE_ERR.
      Returns:
      The compiled form of the XPath expression.
    • createNSResolver

      public XPathNSResolver createNSResolver(Node nodeResolver)

      createNSResolver.

      Specified by:
      createNSResolver in interface Document
      Specified by:
      createNSResolver in interface XPathEvaluator
      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
      Specified by:
      evaluate in interface XPathEvaluator
      Parameters:
      expression - a String object.
      contextNode - a Node object.
      resolver - a XPathNSResolver object.
      type - a short.
      result - a Object object.
      Returns:
      a XPathResult object.
    • createExpression

      public XPathExpression createExpression()

      createExpression.

      Specified by:
      createExpression in interface Document
      Returns:
      a XPathExpression 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.
    • 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.
    • 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.
    • setWindow

      public void setWindow(HtmlRendererContext rcontext, UserAgentContext ucontext, HtmlRendererConfig config)
    • 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.
    • 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.
    • 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.
    • isHidden

      public boolean isHidden()

      isHidden.

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

      public HTMLHeadElement getHead()
      Returns the head element.
      Specified by:
      getHead in interface Document
      Returns:
      a HTMLHeadElement 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.
    • getApplets

      public HTMLCollection getApplets()
      Retrieves a collection of all applet objects in the document.
      Specified by:
      getApplets in interface Document
      Returns:
      a HTMLCollection object.
    • 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.
    • 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.
    • 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.
    • getEmbeds

      public HTMLCollection getEmbeds()
      Retrieves a collection of all embed objects in the document.
      Specified by:
      getEmbeds in interface Document
      Returns:
      a HTMLCollection 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.
    • getScripts

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

      public HTMLCollection getCommands()

      getCommands.

      Specified by:
      getCommands in interface Document
      Returns:
      a HTMLCollection 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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.
    • 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
    • createNodeIterator

      public NodeIterator createNodeIterator(Node root) throws DOMException
      Description copied from interface: DocumentTraversal
      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
      Description copied from interface: DocumentTraversal
      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
      Description copied from interface: DocumentTraversal
      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
      Description copied from interface: DocumentTraversal
      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
      Description copied from interface: DocumentTraversal

      createTreeWalker.

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

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

      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
      Description copied from interface: DocumentTraversal

      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.
    • 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.
    • importNode

      public Node importNode(Node importedNode, boolean deep) throws DOMException
      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.
      Throws:
      DOMException
    • 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.
    • removeAllChildrenImpl

      public void removeAllChildrenImpl()
    • 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.
    • 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.
    • isXml

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

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

      public String getLocalName()
      Description copied from class: NodeImpl

      getLocalName.

      Specified by:
      getLocalName in interface Node
      Specified by:
      getLocalName in class NodeImpl
      Returns:
      a String object.
    • getNodeType

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

      public String getNodeValue() throws DOMException
      Description copied from class: NodeImpl

      getNodeValue.

      Specified by:
      getNodeValue in interface Node
      Specified by:
      getNodeValue in class NodeImpl
      Returns:
      a String object.
      Throws:
      DOMException
    • setNodeValue

      public void setNodeValue(String nodeValue) throws DOMException
      Description copied from class: NodeImpl

      setNodeValue.

      Specified by:
      setNodeValue in interface Node
      Specified by:
      setNodeValue in class NodeImpl
      Parameters:
      nodeValue - a String object.
      Throws:
      DOMException
    • getNodeName

      public String getNodeName()
      Description copied from class: NodeImpl
      Returns a string appropriate for the type of node.
      Specified by:
      getNodeName in interface Node
      Specified by:
      getNodeName in class NodeImpl
      Returns:
      a String object.