Interface Document
- All Superinterfaces:
DocumentRange
,DocumentTraversal
,EventTarget
,Node
,NonElementParentNode
,ParentNode
- All Known Subinterfaces:
HTMLDocument
,SMILDocument
- All Known Implementing Classes:
DocumentImpl
,DTMNodeProxy
,HTMLDocumentImpl
,XMLDocument
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
ConstantHTML_NAMESPACE_URI="..."
static final String
ConstantNAMESPACE_SVG="..."
static final String
ConstantXML_NAMESPACE_URI="..."
static final String
ConstantXMLNS_NAMESPACE_URI="..."
Fields inherited from interface org.loboevolution.html.node.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Method Summary
Modifier and TypeMethodDescriptionMoves node from another document and returns it.caretRangeFromPoint
(double x, double y) Deprecated.void
clear()
Deprecated.void
close()
Closes an output stream and forces the sent data to display.createAttribute
(String localName) Creates an attribute object with a specified name.createAttributeNS
(String namespace, String qualifiedName) createAttributeNS.createCDATASection
(String data) Returns a CDATASection node whose data is data.createComment
(String data) Creates a comment object with the specified data.Creates a new document.createElement
(String tagName) Creates an instance of the element for the specified tag.createElementNS
(String namespace, String qualifiedName) createElementNS.createElementNS
(String namespace, String qualifiedName, String options) Returns an element with namespace.createEntityReference
(String ent1) createEvent
(String eventInterface) createEvent.createExpression.createNSResolver
(Node nodeResolver) createNSResolver.createProcessingInstruction
(String target, String data) Returns a ProcessingInstruction node whose target is target and data is data.createTextNode
(String data) Creates a text string from the specified value.elementFromPoint
(double x, double y) Returns the element for the specified x coordinate and the specified y coordinate.evaluate
(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.boolean
execCommand
(String commandId) execCommand.boolean
execCommand
(String commandId, boolean showUI) execCommand.boolean
execCommand
(String commandId, boolean showUI, String value) Executes a command on the current document, current selection, or the given range.Gets the object that has the focus when the parent document has focus.getall()
Deprecated.Deprecated.Deprecated.Deprecated.getBody()
Specifies the beginning and end of the document body.Returns document's encoding.Gets or sets the character set used to encode the object.getCommands.Gets a value that indicates whether standards-compliant mode is switched on for the object.Returns document's content type.Returns the HTTP cookies that apply to the Document.Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script.getDefaultView.Sets or gets a value that indicates whether the document can be edited.getDir()
Sets or retrieves a value that indicates the reading order of the object.Gets an object representing the document type declaration associated with the current document.Gets a reference to the root node of the document.Returns document's URL.Sets or gets the security domain of the document.getDomConfig.getElementById
(String elementId) Returns the first element within node's descendants whose ID is elementId.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.getElementsByName
(String elementName) Gets a collection of objects based on the value of the NAME or ID attribute.getElementsByTagName
(String qualifiedName) Retrieves a collection of objects based on the specified element name.getElementsByTagNameNS
(String namespaceURI, String localName) If namespace and localName are "*" returns a HTMLCollection of all descendant elements.Retrieves a collection of all embed objects in the document.Deprecated.getForms()
Retrieves a collection, in source order, of all form objects in the document.getHead()
Returns the head element.Retrieves a collection, in source order, of img objects in the document.Gets the implementation object of the current document.Returns the character encoding used to create the webpage that is loaded into the document object.Gets the date that the page was last modified, if the page supplies one.getLinks()
Retrieves a collection of all a objects that specify the href property and all area objects in the document.Contains information about the current URL.Returns document's origin.Return an HTMLCollection of the embed elements in the Document.Retrieves a value that indicates the current state of the object.Gets the URL of the location that referred the user to the current page.Retrieves a collection of all script objects in the document.getScrollingElement.Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.boolean
getStrictErrorChecking.getTitle()
Contains the title of the document.getURL()
Sets or gets the URL for the current document.getVisibilityState.getXmlEncoding.boolean
getXmlStandalone.getXmlVersion.boolean
hasFocus()
Gets a value indicating whether the object currently has focus.importNode
(Node importedNode, boolean deep) Returns a copy of node.boolean
Deprecated.boolean
Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.boolean
isHidden()
isHidden.boolean
isXml()
void
normalizeDocument.open()
open.open.open.open.Opens a new window and loads a document specified by a given URL.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.boolean
queryCommandIndeterm
(String commandId) Returns a Boolean value that indicates whether the specified command is in the indeterminate state.boolean
queryCommandState
(String commandId) Returns a Boolean value that indicates the current state of the command.boolean
queryCommandSupported
(String commandId) Returns a Boolean value that indicates whether the current command is supported on the current range.queryCommandValue
(String commandId) Returns the current value of the document, range, or current selection for the given command.void
Deprecated.renameNode
(Node node, String namespaceURI, String qualifiedName) void
setBgColor
(String bgColor) Deprecated.void
setBody
(HTMLElement body) setBody.void
setCookie.void
setDesignMode
(String designMode) setDesignMode.void
setDir.void
setDocumentURI
(String documentURI) setDocumentURI.void
setDomain.void
setFgColor
(String fgColor) setFgColor.void
setLocation
(Location location) setLocation.void
setStrictErrorChecking
(boolean strictErrorChecking) setStrictErrorChecking.void
setTitle.void
setXml
(boolean xml) void
setXmlStandalone
(boolean xmlStandalone) setXmlStandalone.void
setXmlVersion
(String xmlVersion) setXmlVersion.void
Writes one or more HTML expressions to a document in the specified window.void
Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.Methods inherited from interface org.loboevolution.html.node.ranges.DocumentRange
createRange
Methods inherited from interface org.loboevolution.traversal.DocumentTraversal
createNodeIterator, createNodeIterator, createNodeIterator, createNodeIterator, createTreeWalker, createTreeWalker, createTreeWalker, createTreeWalker
Methods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListener
Methods inherited from interface org.loboevolution.html.node.Node
appendChild, cloneNode, cloneNode, compareDocumentPosition, contains, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getRootNode, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData
Methods inherited from interface org.loboevolution.html.node.ParentNode
getChildElementCount, getChildren, getFirstElementChild, getLastElementChild, querySelector, querySelectorAll
-
Field Details
-
Method Details
-
getURL
String getURL()Sets or gets the URL for the current document.- Returns:
- a
String
object.
-
getActiveElement
Element getActiveElement()Gets the object that has the focus when the parent document has focus.- Returns:
- a
Element
object.
-
getall
Deprecated.Returns a reference to the collection of elements contained by the object.- Returns:
- a
HTMLAllCollection
object.
-
getAnchors
Deprecated.Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.- Returns:
- a
HTMLCollection
object.
-
getApplets
Deprecated.Retrieves a collection of all applet objects in the document.- Returns:
- a
HTMLCollection
object.
-
getCommands
HTMLCollection getCommands()getCommands.
- Returns:
- a
HTMLCollection
object.
-
getBgColor
Deprecated.Deprecated. Sets or retrieves a value that indicates the background color behind the object.- Returns:
- a
String
object.
-
setBgColor
Deprecated.setBgColor.
- Parameters:
bgColor
- aString
object.
-
getBody
HTMLElement getBody()Specifies the beginning and end of the document body.- Returns:
- a
HTMLElement
object.
-
setBody
setBody.
- Parameters:
body
- aHTMLElement
object.
-
getCharacterSet
String getCharacterSet()Returns document's encoding.- Returns:
- a
String
object.
-
getCharset
String getCharset()Gets or sets the character set used to encode the object.- Returns:
- a
String
object.
-
getCompatMode
String getCompatMode()Gets a value that indicates whether standards-compliant mode is switched on for the object.- Returns:
- a
String
object.
-
getContentType
String getContentType()Returns document's content type.- Returns:
- a
String
object.
-
getCookie
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.
- Returns:
- a
String
object.
-
setCookie
setCookie.
- Parameters:
cookie
- aString
object.
-
getCurrentScript
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.
- Returns:
- a
HTMLScriptElement
object.
-
getDefaultView
Window getDefaultView()getDefaultView.
- Returns:
- a
Window
object.
-
getDesignMode
String getDesignMode()Sets or gets a value that indicates whether the document can be edited.- Returns:
- a
String
object.
-
setDesignMode
setDesignMode.
- Parameters:
designMode
- aString
object.
-
getDir
String getDir()Sets or retrieves a value that indicates the reading order of the object.- Returns:
- a
String
object.
-
setDir
setDir.
- Parameters:
dir
- aString
object.
-
getDoctype
DocumentType getDoctype()Gets an object representing the document type declaration associated with the current document.- Returns:
- a
DocumentType
object.
-
getDocumentElement
Element getDocumentElement()Gets a reference to the root node of the document.- Returns:
- a
Element
object.
-
getDocumentURI
String getDocumentURI()Returns document's URL.- Returns:
- a
String
object.
-
getDomain
String getDomain()Sets or gets the security domain of the document.- Returns:
- a
String
object.
-
setDomain
setDomain.
- Parameters:
domain
- aString
object.
-
getEmbeds
HTMLCollection getEmbeds()Retrieves a collection of all embed objects in the document.- Returns:
- a
HTMLCollection
object.
-
getFgColor
Deprecated.Sets or gets the foreground (text) color of the document.- Returns:
- a
String
object.
-
setFgColor
setFgColor.
- Parameters:
fgColor
- aString
object.
-
getForms
HTMLCollection getForms()Retrieves a collection, in source order, of all form objects in the document.- Returns:
- a
HTMLCollection
object.
-
isFullscreen
Deprecated.isFullscreen.
- Returns:
- a boolean.
-
isFullscreenEnabled
boolean isFullscreenEnabled()Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.- Returns:
- a boolean.
-
getHead
HTMLHeadElement getHead()Returns the head element.- Returns:
- a
HTMLHeadElement
object.
-
isHidden
boolean isHidden()isHidden.
- Returns:
- a boolean.
-
getImages
HTMLCollection getImages()Retrieves a collection, in source order, of img objects in the document.- Returns:
- a
HTMLCollection
object.
-
getImplementation
DOMImplementation getImplementation()Gets the implementation object of the current document.- Returns:
- a
DOMImplementation
object.
-
getInputEncoding
String getInputEncoding()Returns the character encoding used to create the webpage that is loaded into the document object.- Returns:
- a
String
object.
-
getLastModified
String getLastModified()Gets the date that the page was last modified, if the page supplies one.- Returns:
- a
String
object.
-
getLinks
HTMLCollection getLinks()Retrieves a collection of all a objects that specify the href property and all area objects in the document.- Returns:
- a
HTMLCollection
object.
-
getLocation
Location getLocation()Contains information about the current URL.- Returns:
- a
Location
object.
-
setLocation
setLocation.
- Parameters:
location
- aLocation
object.
-
getOrigin
String getOrigin()Returns document's origin.- Returns:
- a
String
object.
-
getPlugins
HTMLCollection getPlugins()Return an HTMLCollection of the embed elements in the Document.- Returns:
- a
HTMLCollection
object.
-
getReadyState
DocumentReadyState getReadyState()Retrieves a value that indicates the current state of the object.- Returns:
- a
DocumentReadyState
object.
-
getReferrer
String getReferrer()Gets the URL of the location that referred the user to the current page.- Returns:
- a
String
object.
-
getScripts
HTMLCollection getScripts()Retrieves a collection of all script objects in the document.- Returns:
- a
HTMLCollection
object.
-
getScrollingElement
Element getScrollingElement()getScrollingElement.
- Returns:
- a
Element
object.
-
getTitle
String getTitle()Contains the title of the document.- Returns:
- a
String
object.
-
setTitle
setTitle.
- Parameters:
title
- aString
object.
-
getVisibilityState
VisibilityState getVisibilityState()getVisibilityState.
- Returns:
- a
VisibilityState
object.
-
adoptNode
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.
-
caretRangeFromPoint
Deprecated.caretRangeFromPoint.
- Parameters:
x
- a double.y
- a double.- Returns:
- a
Range
object.
-
clear
Deprecated.clear.
-
close
void close()Closes an output stream and forces the sent data to display. -
createAttribute
Creates an attribute object with a specified name.- Parameters:
localName
- String that sets the attribute object's name.- Returns:
- a
Attr
object.
-
createAttributeNS
createAttributeNS.
-
createCDATASection
Returns a CDATASection node whose data is data.- Parameters:
data
- aString
object.- Returns:
- a
CDATASection
object.
-
createComment
Creates a comment object with the specified data.- Parameters:
data
- Sets the comment object's data.- Returns:
- a
Comment
object.
-
createDocumentFragment
DocumentFragment createDocumentFragment()Creates a new document.- Returns:
- a
DocumentFragment
object.
-
createElement
Creates an instance of the element for the specified tag.- Parameters:
tagName
- The name of an element.- Returns:
- a
Element
object.
-
createElementNS
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.
-
createElementNS
createElementNS.
-
createEvent
createEvent.
-
createProcessingInstruction
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.- Parameters:
target
- aString
object.data
- aString
object.- Returns:
- a
ProcessingInstruction
object.
-
createTextNode
Creates a text string from the specified value.- Parameters:
data
- String that specifies the nodeValue property of the text node.- Returns:
- a
Text
object. - Throws:
DOMException
-
elementFromPoint
Returns the element for the specified x coordinate and the specified y coordinate.- Parameters:
x
- The x-offsety
- The y-offset- Returns:
- a
Element
object.
-
execCommand
Executes a command on the current document, current selection, or the given range.- 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
execCommand.
- Parameters:
commandId
- aString
object.showUI
- a boolean.- Returns:
- a boolean.
-
execCommand
execCommand.
- Parameters:
commandId
- aString
object.- Returns:
- a boolean.
-
getElementById
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 interfaceNonElementParentNode
- Parameters:
elementId
- aString
object.- Returns:
- a
Element
object.
-
getElementsByClassName
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.- Parameters:
classNames
- aString
object.- Returns:
- a
HTMLCollection
object.
-
getElementsByName
Gets a collection of objects based on the value of the NAME or ID attribute.- Parameters:
elementName
- Gets a collection of objects based on the value of the NAME or ID attribute.- Returns:
- a
HTMLCollection
object.
-
getElementsByTagName
Retrieves a collection of objects based on the specified element name.- Parameters:
qualifiedName
- Specifies the name of an element.- Returns:
- a
HTMLCollection
object.
-
getElementsByTagNameNS
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.
- Parameters:
namespaceURI
- aString
object.localName
- aString
object.- Returns:
- a
HTMLCollection
object.
-
getSelection
Selection getSelection()Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.- Returns:
- a
Selection
object.
-
getXmlEncoding
String getXmlEncoding()getXmlEncoding.
- Returns:
- a
String
object.
-
getXmlVersion
String getXmlVersion()getXmlVersion.
- Returns:
- a
String
object.
-
getXmlStandalone
boolean getXmlStandalone()getXmlStandalone.
- Returns:
- a boolean.
-
getStrictErrorChecking
boolean getStrictErrorChecking()getStrictErrorChecking.
- Returns:
- a boolean.
-
getDomConfig
DOMConfiguration getDomConfig()getDomConfig.
- Returns:
- a
DOMConfiguration
object.
-
setDocumentURI
setDocumentURI.
- Parameters:
documentURI
- aString
object.
-
setStrictErrorChecking
void setStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.
- Parameters:
strictErrorChecking
- a boolean.
-
setXmlStandalone
void setXmlStandalone(boolean xmlStandalone) setXmlStandalone.
- Parameters:
xmlStandalone
- a boolean.
-
setXmlVersion
setXmlVersion.
- Parameters:
xmlVersion
- aString
object.
-
hasFocus
boolean hasFocus()Gets a value indicating whether the object currently has focus.- Returns:
- a boolean.
-
importNode
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.
-
open
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.- 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
open.
-
open
open.
-
open
open.
-
open
Document open()open.
- Returns:
- a
Document
object.
-
queryCommandEnabled
Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.- Parameters:
commandId
- Specifies a command identifier.- Returns:
- a boolean.
-
queryCommandIndeterm
Returns a Boolean value that indicates whether the specified command is in the indeterminate state.- Parameters:
commandId
- String that specifies a command identifier.- Returns:
- a boolean.
-
queryCommandState
Returns a Boolean value that indicates the current state of the command.- Parameters:
commandId
- String that specifies a command identifier.- Returns:
- a boolean.
-
queryCommandSupported
Returns a Boolean value that indicates whether the current command is supported on the current range.- Parameters:
commandId
- Specifies a command identifier.- Returns:
- a boolean.
-
queryCommandValue
Returns the current value of the document, range, or current selection for the given command.- Parameters:
commandId
- String that specifies a command identifier.- Returns:
- a
String
object.
-
releaseEvents
Deprecated.releaseEvents.
-
write
Writes one or more HTML expressions to a document in the specified window.- Parameters:
text
- Specifies the text and HTML tags to write.
-
writeln
Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.- Parameters:
text
- The text and HTML tags to write.
-
normalizeDocument
void normalizeDocument()normalizeDocument.
-
createExpression
XPathExpression createExpression()createExpression.
- Returns:
- a
XPathExpression
object.
-
createNSResolver
createNSResolver.
- Parameters:
nodeResolver
- aNode
object.- Returns:
- a
XPathNSResolver
object.
-
evaluate
XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.
- Parameters:
expression
- aString
object.contextNode
- aNode
object.resolver
- aXPathNSResolver
object.type
- a short.result
- aObject
object.- Returns:
- a
XPathResult
object.
-
createEntityReference
-
renameNode
-
isXml
boolean isXml() -
setXml
void setXml(boolean xml)
-