org.lobobrowser.html.domimpl

Class HTMLDocumentImpl

Implemented Interfaces:
Document, HTMLDocument, Node, ModelNode, ScriptableDelegate

public class HTMLDocumentImpl
extends NodeImpl
implements HTMLDocument

Field Summary

Fields inherited from class org.lobobrowser.html.domimpl.NodeImpl

document, logger, nodeList, notificationsSuspended, parentNode, treeLock, uiNode

Constructor Summary

HTMLDocumentImpl(HtmlRendererContext rcontext)
HTMLDocumentImpl(UserAgentContext ucontext)
HTMLDocumentImpl(UserAgentContext ucontext, HtmlRendererContext rcontext, WritableLineReader reader, String documentURI)

Method Summary

void
addDocumentNotificationListener(DocumentNotificationListener listener)
Node
adoptNode(Node source)
void
allInvalidated()
void
close()
Attr
createAttribute(String name)
Attr
createAttributeNS(String namespaceURI, String qualifiedName)
CDATASection
createCDATASection(String data)
Comment
createComment(String data)
DocumentFragment
createDocumentFragment()
Element
createElement(String tagName)
Element
createElementNS(String namespaceURI, String qualifiedName)
EntityReference
createEntityReference(String name)
ProcessingInstruction
createProcessingInstruction(String target, String data)
protected RenderState
createRenderState(RenderState prevRenderState)
protected Node
createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.
Text
createTextNode(String data)
void
externalScriptLoading(NodeImpl node)
HTMLCollection
getAnchors()
HTMLCollection
getApplets()
String
getBaseURI()
HTMLElement
getBody()
String
getCookie()
String
getDefaultTarget()
DocumentType
getDoctype()
Element
getDocumentElement()
String
getDocumentURI()
URL
getDocumentURL()
DOMConfiguration
getDomConfig()
String
getDomain()
Element
getElementById(String elementId)
NodeList
getElementsByName(String elementName)
Gets the collection of elements whose name attribute is elementName.
NodeList
getElementsByTagName(String tagname)
Gets all elements that match the given tag name.
NodeList
getElementsByTagNameNS(String namespaceURI, String localName)
HTMLCollection
getForms()
HTMLCollection
getFrames()
URL
getFullURL(String uri)
HtmlRendererContext
getHtmlRendererContext()
HTMLCollection
getImages()
DOMImplementation
getImplementation()
String
getInputEncoding()
HTMLCollection
getLinks()
String
getLocalName()
Location
getLocation()
String
getNodeName()
short
getNodeType()
String
getNodeValue()
Function
getOnloadHandler()
String
getReferrer()
boolean
getStrictErrorChecking()
String
getTextContent()
Gets the text content of this node and its descendents.
String
getTitle()
String
getURL()
UserAgentContext
getUserAgentContext()
String
getXmlEncoding()
boolean
getXmlStandalone()
String
getXmlVersion()
Node
importNode(Node importedNode, boolean deep)
void
invalidated(NodeImpl node)
This is called when the node has changed, but it is unclear if it's a size change or a look change.
void
load()
Loads the document from the reader provided when it was constructed.
void
load(boolean closeReader)
void
lookInvalidated(NodeImpl node)
Called if something such as a color or decoration has changed.
Element
namedItem(String name)
void
nodeLoaded(NodeImpl node)
void
normalizeDocument()
void
open()
void
positionInParentInvalidated(NodeImpl node)
Changed if the position of the node in a parent has changed.
void
removeDocumentNotificationListener(DocumentNotificationListener listener)
Node
renameNode(Node n, String namespaceURI, String qualifiedName)
void
setBaseURI(String value)
void
setBody(HTMLElement body)
void
setCookie(String cookie)
void
setDefaultTarget(String value)
void
setDoctype(DocumentType doctype)
void
setDocumentURI(String documentURI)
void
setDomain(String domain)
void
setLocation(String location)
void
setNodeValue(String nodeValue)
void
setOnloadHandler(Function onloadHandler)
void
setReferrer(String value)
void
setStrictErrorChecking(boolean strictErrorChecking)
void
setTextContent(String textContent)
void
setTitle(String title)
Object
setUserData(String key, Object data, UserDataHandler handler)
void
setXmlStandalone(boolean xmlStandalone)
void
setXmlVersion(String xmlVersion)
void
sizeInvalidated(NodeImpl node)
void
write(String text)
void
writeln(String text)

Methods inherited from class org.lobobrowser.html.domimpl.NodeImpl

appendChild, cloneNode, compareDocumentPosition, createRenderState, createSimilarNode, equalAttributes, findUINode, forgetRenderState, getAlignmentX, getAlignmentY, getAttributes, getBaseURI, getChildNodes, getChildren, getChildrenArray, getDescendents, getDocumentItem, getDocumentURL, getFeature, getFirstChild, getFullURL, getHtmlRendererContext, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeList, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousSibling, getRenderState, getTextContent, getUINode, getUserAgentContext, getUserData, hasAttributes, hasChildNodes, informExternalScriptLoading, informInvalid, informLayoutInvalid, informLookInvalid, informNodeLoaded, informPositionInvalid, informSizeInvalid, insertAfter, insertAt, insertBefore, isDefaultNamespace, isEqualNode, isEqualOrDescendentOf, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeAllChildren, removeAllChildrenImpl, removeChild, removeChildAt, removeChildren, removeChildrenImpl, replaceAdjacentTextNodes, replaceAdjacentTextNodes, replaceChild, setDocumentItem, setNodeValue, setPrefix, setTextContent, setUINode, setUserData, toString, warn, warn

Methods inherited from class org.lobobrowser.js.AbstractScriptableDelegate

getScriptable, setScriptable

Constructor Details

HTMLDocumentImpl

public HTMLDocumentImpl(HtmlRendererContext rcontext)

HTMLDocumentImpl

public HTMLDocumentImpl(UserAgentContext ucontext)

HTMLDocumentImpl

public HTMLDocumentImpl(UserAgentContext ucontext,
                        HtmlRendererContext rcontext,
                        WritableLineReader reader,
                        String documentURI)

Method Details

addDocumentNotificationListener

public void addDocumentNotificationListener(DocumentNotificationListener listener)

adoptNode

public Node adoptNode(Node source)
            throws DOMException

allInvalidated

public void allInvalidated()

close

public void close()
Specified by:
close in interface HTMLDocument

createAttribute

public Attr createAttribute(String name)
            throws DOMException

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
            throws DOMException

createCDATASection

public CDATASection createCDATASection(String data)
            throws DOMException

createComment

public Comment createComment(String data)

createDocumentFragment

public DocumentFragment createDocumentFragment()

createElement

public Element createElement(String tagName)
            throws DOMException

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
            throws DOMException

createEntityReference

public EntityReference createEntityReference(String name)
            throws DOMException

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
            throws DOMException

createRenderState

protected RenderState createRenderState(RenderState prevRenderState)
Overrides:
createRenderState in interface NodeImpl

createSimilarNode

protected Node createSimilarNode()
Should create a node with some cloned properties, like the node name, but not attributes or children.
Overrides:
createSimilarNode in interface NodeImpl

createTextNode

public Text createTextNode(String data)

externalScriptLoading

public void externalScriptLoading(NodeImpl node)

getAnchors

public HTMLCollection getAnchors()
Specified by:
getAnchors in interface HTMLDocument

getApplets

public HTMLCollection getApplets()
Specified by:
getApplets in interface HTMLDocument

getBaseURI

public String getBaseURI()
Overrides:
getBaseURI in interface NodeImpl

getBody

public HTMLElement getBody()
Specified by:
getBody in interface HTMLDocument

getCookie

public String getCookie()
Specified by:
getCookie in interface HTMLDocument

getDefaultTarget

public String getDefaultTarget()

getDoctype

public DocumentType getDoctype()

getDocumentElement

public Element getDocumentElement()

getDocumentURI

public String getDocumentURI()

getDocumentURL

public URL getDocumentURL()
Overrides:
getDocumentURL in interface NodeImpl

getDomConfig

public DOMConfiguration getDomConfig()

getDomain

public String getDomain()
Specified by:
getDomain in interface HTMLDocument

getElementById

public Element getElementById(String elementId)

getElementsByName

public NodeList getElementsByName(String elementName)
Gets the collection of elements whose name attribute is elementName.
Specified by:
getElementsByName in interface HTMLDocument

getElementsByTagName

public NodeList getElementsByTagName(String tagname)
Gets all elements that match the given tag name.
Parameters:
tagname - The element tag name or an asterisk character (*) to match all elements.

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)

getForms

public HTMLCollection getForms()
Specified by:
getForms in interface HTMLDocument

getFrames

public HTMLCollection getFrames()

getFullURL

public final URL getFullURL(String uri)
Specified by:
getFullURL in interface ModelNode
Overrides:
getFullURL in interface NodeImpl

getHtmlRendererContext

public final HtmlRendererContext getHtmlRendererContext()
Overrides:
getHtmlRendererContext in interface NodeImpl

getImages

public HTMLCollection getImages()
Specified by:
getImages in interface HTMLDocument

getImplementation

public DOMImplementation getImplementation()

getInputEncoding

public String getInputEncoding()

getLinks

public HTMLCollection getLinks()
Specified by:
getLinks in interface HTMLDocument

getLocalName

public String getLocalName()
Overrides:
getLocalName in interface NodeImpl

getLocation

public final Location getLocation()

getNodeName

public String getNodeName()
Overrides:
getNodeName in interface NodeImpl

getNodeType

public short getNodeType()
Overrides:
getNodeType in interface NodeImpl

getNodeValue

public String getNodeValue()
            throws DOMException
Overrides:
getNodeValue in interface NodeImpl

getOnloadHandler

public Function getOnloadHandler()

getReferrer

public String getReferrer()
Specified by:
getReferrer in interface HTMLDocument

getStrictErrorChecking

public boolean getStrictErrorChecking()

getTextContent

public String getTextContent()
            throws DOMException
Gets the text content of this node and its descendents.
Overrides:
getTextContent in interface NodeImpl

getTitle

public String getTitle()
Specified by:
getTitle in interface HTMLDocument

getURL

public String getURL()
Specified by:
getURL in interface HTMLDocument

getUserAgentContext

public UserAgentContext getUserAgentContext()
Overrides:
getUserAgentContext in interface NodeImpl

getXmlEncoding

public String getXmlEncoding()

getXmlStandalone

public boolean getXmlStandalone()

getXmlVersion

public String getXmlVersion()

importNode

public Node importNode(Node importedNode,
                       boolean deep)
            throws DOMException

invalidated

public void invalidated(NodeImpl node)
This is called when the node has changed, but it is unclear if it's a size change or a look change.
Parameters:
node -

load

public void load()
            throws IOException,
                   SAXException,
                   UnsupportedEncodingException
Loads the document from the reader provided when it was constructed. It then closes the reader.

load

public void load(boolean closeReader)
            throws IOException,
                   SAXException,
                   UnsupportedEncodingException

lookInvalidated

public void lookInvalidated(NodeImpl node)
Called if something such as a color or decoration has changed. This would be something which does not affect the rendered size.
Parameters:
node -

namedItem

public Element namedItem(String name)

nodeLoaded

public void nodeLoaded(NodeImpl node)

normalizeDocument

public void normalizeDocument()

open

public void open()
Specified by:
open in interface HTMLDocument

positionInParentInvalidated

public void positionInParentInvalidated(NodeImpl node)
Changed if the position of the node in a parent has changed.
Parameters:
node -

removeDocumentNotificationListener

public void removeDocumentNotificationListener(DocumentNotificationListener listener)

renameNode

public Node renameNode(Node n,
                       String namespaceURI,
                       String qualifiedName)
            throws DOMException

setBaseURI

public void setBaseURI(String value)

setBody

public void setBody(HTMLElement body)
Specified by:
setBody in interface HTMLDocument

setCookie

public void setCookie(String cookie)
            throws DOMException
Specified by:
setCookie in interface HTMLDocument

setDefaultTarget

public void setDefaultTarget(String value)

setDoctype

public void setDoctype(DocumentType doctype)

setDocumentURI

public void setDocumentURI(String documentURI)

setDomain

public void setDomain(String domain)

setLocation

public void setLocation(String location)

setNodeValue

public void setNodeValue(String nodeValue)
            throws DOMException
Overrides:
setNodeValue in interface NodeImpl

setOnloadHandler

public void setOnloadHandler(Function onloadHandler)

setReferrer

public void setReferrer(String value)

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)

setTextContent

public void setTextContent(String textContent)
            throws DOMException
Overrides:
setTextContent in interface NodeImpl

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface HTMLDocument

setUserData

public Object setUserData(String key,
                          Object data,
                          UserDataHandler handler)
Overrides:
setUserData in interface NodeImpl

setXmlStandalone

public void setXmlStandalone(boolean xmlStandalone)
            throws DOMException

setXmlVersion

public void setXmlVersion(String xmlVersion)
            throws DOMException

sizeInvalidated

public void sizeInvalidated(NodeImpl node)

write

public void write(String text)
Specified by:
write in interface HTMLDocument

writeln

public void writeln(String text)
Specified by:
writeln in interface HTMLDocument