Interface Document
- All Superinterfaces:
DocumentRange,DocumentTraversal,EventTarget,ModelNode,Node,NonElementParentNode,ParentNode
- All Known Subinterfaces:
HTMLDocument,SMILDocument
- All Known Implementing Classes:
DocumentImpl,DTMNodeProxy,HTMLDocumentImpl,XMLDocument
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantHTML_NAMESPACE_URI="..."static final StringConstantNAMESPACE_SVG="..."static final StringConstantXML_NAMESPACE_URI="..."static final StringConstantXMLNS_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.voidclear()Deprecated.voidclose()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.booleanexecCommand(String commandId) execCommand.booleanexecCommand(String commandId, boolean showUI) execCommand.booleanexecCommand(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.booleangetStrictErrorChecking.getTitle()Contains the title of the document.getURL()Sets or gets the URL for the current document.getVisibilityState.getXmlEncoding.booleangetXmlStandalone.getXmlVersion.booleanhasFocus()Gets a value indicating whether the object currently has focus.importNode(Node importedNode, boolean deep) Returns a copy of node.booleanDeprecated.booleanReturns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.booleanisHidden()isHidden.booleanisXml()voidnormalizeDocument.open()open.open.open.open.Opens a new window and loads a document specified by a given URL.booleanqueryCommandEnabled(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.booleanqueryCommandIndeterm(String commandId) Returns a Boolean value that indicates whether the specified command is in the indeterminate state.booleanqueryCommandState(String commandId) Returns a Boolean value that indicates the current state of the command.booleanqueryCommandSupported(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.voidDeprecated.renameNode(Node node, String namespaceURI, String qualifiedName) voidsetBgColor(String bgColor) Deprecated.voidsetBody(HTMLElement body) setBody.voidsetCookie.voidsetDesignMode(String designMode) setDesignMode.voidsetDir.voidsetDocumentURI(String documentURI) setDocumentURI.voidsetDomain.voidsetFgColor(String fgColor) setFgColor.voidsetLocation(Location location) setLocation.voidsetStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.voidsetTitle.voidsetXml(boolean xml) voidsetXmlStandalone(boolean xmlStandalone) setXmlStandalone.voidsetXmlVersion(String xmlVersion) setXmlVersion.voidWrites one or more HTML expressions to a document in the specified window.voidWrites 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
createRangeMethods inherited from interface org.loboevolution.traversal.DocumentTraversal
createNodeIterator, createNodeIterator, createNodeIterator, createNodeIterator, createTreeWalker, createTreeWalker, createTreeWalker, createTreeWalkerMethods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListenerMethods inherited from interface org.loboevolution.html.node.ModelNode
getDocumentItem, getFullURL, getParentModelNode, getRenderState, isEqualOrDescendentOf, setDocumentItem, warnMethods inherited from interface org.loboevolution.html.node.Node
appendChild, appendChildrenToCollectionImpl, cloneNode, cloneNode, compareDocumentPosition, contains, extractDescendentsArrayImpl, findUINode, forgetRenderState, getAttributes, getBaseURI, getChildNodes, getDocumentNode, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNextTo, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getPreviousTo, getRootNode, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setOwnerDocument, setParentImpl, setPrefix, setTextContent, setUserData, visitMethods 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
Stringobject.
-
getActiveElement
Element getActiveElement()Gets the object that has the focus when the parent document has focus.- Returns:
- a
Elementobject.
-
getall
Deprecated.Returns a reference to the collection of elements contained by the object.- Returns:
- a
HTMLAllCollectionobject.
-
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
HTMLCollectionobject.
-
getApplets
Deprecated.Retrieves a collection of all applet objects in the document.- Returns:
- a
HTMLCollectionobject.
-
getCommands
HTMLCollection getCommands()getCommands.
- Returns:
- a
HTMLCollectionobject.
-
getBgColor
Deprecated.Deprecated. Sets or retrieves a value that indicates the background color behind the object.- Returns:
- a
Stringobject.
-
setBgColor
Deprecated.setBgColor.
- Parameters:
bgColor- aStringobject.
-
getBody
HTMLElement getBody()Specifies the beginning and end of the document body.- Returns:
- a
HTMLElementobject.
-
setBody
setBody.
- Parameters:
body- aHTMLElementobject.
-
getCharacterSet
String getCharacterSet()Returns document's encoding.- Returns:
- a
Stringobject.
-
getCharset
String getCharset()Gets or sets the character set used to encode the object.- Returns:
- a
Stringobject.
-
getCompatMode
String getCompatMode()Gets a value that indicates whether standards-compliant mode is switched on for the object.- Returns:
- a
Stringobject.
-
getContentType
String getContentType()Returns document's content type.- Returns:
- a
Stringobject.
-
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
Stringobject.
-
setCookie
setCookie.
- Parameters:
cookie- aStringobject.
-
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
HTMLScriptElementobject.
-
getDefaultView
Window getDefaultView()getDefaultView.
- Returns:
- a
Windowobject.
-
getDesignMode
String getDesignMode()Sets or gets a value that indicates whether the document can be edited.- Returns:
- a
Stringobject.
-
setDesignMode
setDesignMode.
- Parameters:
designMode- aStringobject.
-
getDir
String getDir()Sets or retrieves a value that indicates the reading order of the object.- Returns:
- a
Stringobject.
-
setDir
setDir.
- Parameters:
dir- aStringobject.
-
getDoctype
DocumentType getDoctype()Gets an object representing the document type declaration associated with the current document.- Returns:
- a
DocumentTypeobject.
-
getDocumentElement
Element getDocumentElement()Gets a reference to the root node of the document.- Returns:
- a
Elementobject.
-
getDocumentURI
String getDocumentURI()Returns document's URL.- Returns:
- a
Stringobject.
-
getDomain
String getDomain()Sets or gets the security domain of the document.- Returns:
- a
Stringobject.
-
setDomain
setDomain.
- Parameters:
domain- aStringobject.
-
getEmbeds
HTMLCollection getEmbeds()Retrieves a collection of all embed objects in the document.- Returns:
- a
HTMLCollectionobject.
-
getFgColor
Deprecated.Sets or gets the foreground (text) color of the document.- Returns:
- a
Stringobject.
-
setFgColor
setFgColor.
- Parameters:
fgColor- aStringobject.
-
getForms
HTMLCollection getForms()Retrieves a collection, in source order, of all form objects in the document.- Returns:
- a
HTMLCollectionobject.
-
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
HTMLHeadElementobject.
-
isHidden
boolean isHidden()isHidden.
- Returns:
- a boolean.
-
getImages
HTMLCollection getImages()Retrieves a collection, in source order, of img objects in the document.- Returns:
- a
HTMLCollectionobject.
-
getImplementation
DOMImplementation getImplementation()Gets the implementation object of the current document.- Returns:
- a
DOMImplementationobject.
-
getInputEncoding
String getInputEncoding()Returns the character encoding used to create the webpage that is loaded into the document object.- Returns:
- a
Stringobject.
-
getLastModified
String getLastModified()Gets the date that the page was last modified, if the page supplies one.- Returns:
- a
Stringobject.
-
getLinks
HTMLCollection getLinks()Retrieves a collection of all a objects that specify the href property and all area objects in the document.- Returns:
- a
HTMLCollectionobject.
-
getLocation
Location getLocation()Contains information about the current URL.- Returns:
- a
Locationobject.
-
setLocation
setLocation.
- Parameters:
location- aLocationobject.
-
getOrigin
String getOrigin()Returns document's origin.- Returns:
- a
Stringobject.
-
getPlugins
HTMLCollection getPlugins()Return an HTMLCollection of the embed elements in the Document.- Returns:
- a
HTMLCollectionobject.
-
getReadyState
DocumentReadyState getReadyState()Retrieves a value that indicates the current state of the object.- Returns:
- a
DocumentReadyStateobject.
-
getReferrer
String getReferrer()Gets the URL of the location that referred the user to the current page.- Returns:
- a
Stringobject.
-
getScripts
HTMLCollection getScripts()Retrieves a collection of all script objects in the document.- Returns:
- a
HTMLCollectionobject.
-
getScrollingElement
Element getScrollingElement()getScrollingElement.
- Returns:
- a
Elementobject.
-
getTitle
String getTitle()Contains the title of the document.- Returns:
- a
Stringobject.
-
setTitle
setTitle.
- Parameters:
title- aStringobject.
-
getVisibilityState
VisibilityState getVisibilityState()getVisibilityState.
- Returns:
- a
VisibilityStateobject.
-
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
Rangeobject.
-
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
Attrobject.
-
createAttributeNS
createAttributeNS.
-
createCDATASection
Returns a CDATASection node whose data is data.- Parameters:
data- aStringobject.- Returns:
- a
CDATASectionobject.
-
createComment
Creates a comment object with the specified data.- Parameters:
data- Sets the comment object's data.- Returns:
- a
Commentobject.
-
createDocumentFragment
DocumentFragment createDocumentFragment()Creates a new document.- Returns:
- a
DocumentFragmentobject.
-
createElement
Creates an instance of the element for the specified tag.- Parameters:
tagName- The name of an element.- Returns:
- a
Elementobject.
-
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- aStringobject.data- aStringobject.- Returns:
- a
ProcessingInstructionobject.
-
createTextNode
Creates a text string from the specified value.- Parameters:
data- String that specifies the nodeValue property of the text node.- Returns:
- a
Textobject. - 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
Elementobject.
-
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- aStringobject.showUI- a boolean.- Returns:
- a boolean.
-
execCommand
execCommand.
- Parameters:
commandId- aStringobject.- 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:
getElementByIdin interfaceNonElementParentNode- Parameters:
elementId- aStringobject.- Returns:
- a
Elementobject.
-
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- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
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
HTMLCollectionobject.
-
getElementsByTagName
Retrieves a collection of objects based on the specified element name.- Parameters:
qualifiedName- Specifies the name of an element.- Returns:
- a
HTMLCollectionobject.
-
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- aStringobject.localName- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
getSelection
Selection getSelection()Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.- Returns:
- a
Selectionobject.
-
getXmlEncoding
String getXmlEncoding()getXmlEncoding.
- Returns:
- a
Stringobject.
-
getXmlVersion
String getXmlVersion()getXmlVersion.
- Returns:
- a
Stringobject.
-
getXmlStandalone
boolean getXmlStandalone()getXmlStandalone.
- Returns:
- a boolean.
-
getStrictErrorChecking
boolean getStrictErrorChecking()getStrictErrorChecking.
- Returns:
- a boolean.
-
getDomConfig
DOMConfiguration getDomConfig()getDomConfig.
- Returns:
- a
DOMConfigurationobject.
-
setDocumentURI
setDocumentURI.
- Parameters:
documentURI- aStringobject.
-
setStrictErrorChecking
void setStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.
- Parameters:
strictErrorChecking- a boolean.
-
setXmlStandalone
void setXmlStandalone(boolean xmlStandalone) setXmlStandalone.
- Parameters:
xmlStandalone- a boolean.
-
setXmlVersion
setXmlVersion.
- Parameters:
xmlVersion- aStringobject.
-
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
Documentobject.
-
open
open.
-
open
open.
-
open
open.
-
open
Document open()open.
- Returns:
- a
Documentobject.
-
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
Stringobject.
-
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
XPathExpressionobject.
-
createNSResolver
createNSResolver.
- Parameters:
nodeResolver- aNodeobject.- Returns:
- a
XPathNSResolverobject.
-
evaluate
XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.
- Parameters:
expression- aStringobject.contextNode- aNodeobject.resolver- aXPathNSResolverobject.type- a short.result- aObjectobject.- Returns:
- a
XPathResultobject.
-
createEntityReference
-
renameNode
-
isXml
boolean isXml() -
setXml
void setXml(boolean xml)
-