|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jdesktop.dom.SimpleHtmlDocument
public class SimpleHtmlDocument extends Object
A DOM org.w3c.dom.Document that makes it easier to work with DOM
documents. This class simply wraps a delegate HTMLDocument and
delegates all calls to the Document. This allows this class to work with
any HTMLDocument.
| Field Summary | |
|---|---|
private Map |
cachedExpressions
|
private org.w3c.dom.html.HTMLDocument |
dom
|
private XPath |
xpath
|
| Constructor Summary | |
SimpleHtmlDocument()
Create a new, empty, SimpleHtmlDocument |
|
SimpleHtmlDocument(org.w3c.dom.html.HTMLDocument dom)
Creates a new instance of SimpleHtmlDocument. |
|
| Method Summary | |
|---|---|
org.w3c.dom.Node
|
adoptNode(org.w3c.dom.Node source)
|
org.w3c.dom.Node
|
appendChild(org.w3c.dom.Node newChild)
|
org.w3c.dom.Node
|
cloneNode(boolean deep)
|
void
|
close()
|
short
|
compareDocumentPosition(org.w3c.dom.Node other)
|
private XPathExpression
|
compile(String expression)
Compiles the specified expression, and caches the expression in a SoftReference, so that under stress it can be reclaimed by the system. |
org.w3c.dom.Attr
|
createAttribute(String name)
|
org.w3c.dom.Attr
|
createAttributeNS(String namespaceURI, String qualifiedName)
|
org.w3c.dom.CDATASection
|
createCDATASection(String data)
|
org.w3c.dom.Comment
|
createComment(String data)
|
org.w3c.dom.DocumentFragment
|
createDocumentFragment()
|
org.w3c.dom.Element
|
createElement(String tagName)
|
org.w3c.dom.Element
|
createElementNS(String namespaceURI, String qualifiedName)
|
org.w3c.dom.EntityReference
|
createEntityReference(String name)
|
org.w3c.dom.ProcessingInstruction
|
createProcessingInstruction(String target, String data)
|
org.w3c.dom.Text
|
createTextNode(String data)
|
SimpleHtmlCollection
|
getAnchors()
|
SimpleHtmlCollection
|
getApplets()
|
org.w3c.dom.NamedNodeMap
|
getAttributes()
|
String
|
getBaseURI()
|
org.w3c.dom.html.HTMLElement
|
getBody()
|
int
|
getChildElementCount(org.w3c.dom.Node parent)
Returns the number of child elements for the given node. |
SimpleNodeList
|
getChildElements(org.w3c.dom.Node parent)
|
SimpleNodeList
|
getChildNodes()
|
String
|
getCookie()
|
org.w3c.dom.DocumentType
|
getDoctype()
@inheritDoc |
org.w3c.dom.Element
|
getDocumentElement()
|
String
|
getDocumentURI()
|
org.w3c.dom.DOMConfiguration
|
getDomConfig()
|
String
|
getDomain()
|
org.w3c.dom.Node
|
getElement(String expression)
Returns a Node matching the given expression. |
org.w3c.dom.Node
|
getElement(String expression, org.w3c.dom.Node node)
Returns a Node matching the given expression. |
org.w3c.dom.Element
|
getElementById(String elementId)
|
SimpleNodeList
|
getElements(String expression)
Returns a SimpleNodeList containing all the nodes that match the given expression. |
SimpleNodeList
|
getElements(String expression, org.w3c.dom.Node node)
Returns a SimpleNodeList containing all the nodes that match the given expression when executed on the given node (as opposed to the dom as a whole). |
SimpleNodeList
|
getElementsByName(String elementName)
|
SimpleNodeList
|
getElementsByTagName(String tagname)
|
SimpleNodeList
|
getElementsByTagNameNS(String namespaceURI, String localName)
|
Object
|
getFeature(String feature, String version)
|
org.w3c.dom.Node
|
getFirstChild()
|
SimpleHtmlCollection
|
getForms()
|
SimpleHtmlCollection
|
getImages()
|
org.w3c.dom.DOMImplementation
|
getImplementation()
|
String
|
getInputEncoding()
|
org.w3c.dom.Node
|
getLastChild()
|
SimpleHtmlCollection
|
getLinks()
|
String
|
getLocalName()
|
String
|
getNamespaceURI()
|
org.w3c.dom.Node
|
getNextSibling()
|
String
|
getNodeName()
|
short
|
getNodeType()
|
String
|
getNodeValue()
|
org.w3c.dom.Document
|
getOwnerDocument()
|
org.w3c.dom.Node
|
getParentNode()
|
String
|
getPrefix()
|
org.w3c.dom.Node
|
getPreviousSibling()
|
String
|
getReferrer()
|
boolean
|
getStrictErrorChecking()
|
String
|
getString(String expression)
Returns the text content of the Node matching the given expression. |
String
|
getString(String expression, org.w3c.dom.Node node)
Returns the text content of the Node matching the given expression. |
String
|
getTextContent()
|
String
|
getTitle()
|
String
|
getURL()
|
Object
|
getUserData(String key)
|
String
|
getXmlEncoding()
|
boolean
|
getXmlStandalone()
|
String
|
getXmlVersion()
|
boolean
|
hasAttributes()
|
boolean
|
hasChildNodes()
|
org.w3c.dom.Node
|
importNode(org.w3c.dom.Node importedNode, boolean deep)
|
org.w3c.dom.Node
|
insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
|
boolean
|
isDefaultNamespace(String namespaceURI)
|
boolean
|
isEqualNode(org.w3c.dom.Node arg)
|
boolean
|
isSameNode(org.w3c.dom.Node other)
|
boolean
|
isSupported(String feature, String version)
|
String
|
lookupNamespaceURI(String prefix)
|
String
|
lookupPrefix(String namespaceURI)
|
void
|
normalize()
|
void
|
normalizeDocument()
|
void
|
open()
|
org.w3c.dom.Node
|
removeChild(org.w3c.dom.Node oldChild)
|
org.w3c.dom.Node
|
renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName)
|
org.w3c.dom.Node
|
replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
|
void
|
setBody(org.w3c.dom.html.HTMLElement body)
|
void
|
setCookie(String cookie)
|
void
|
setDocumentURI(String documentURI)
|
void
|
setNodeValue(String nodeValue)
|
void
|
setPrefix(String prefix)
|
void
|
setStrictErrorChecking(boolean strictErrorChecking)
|
void
|
setTextContent(String textContent)
|
void
|
setTitle(String title)
|
Object
|
setUserData(String key, Object data, org.w3c.dom.UserDataHandler handler)
|
void
|
setXmlStandalone(boolean xmlStandalone)
|
void
|
setXmlVersion(String xmlVersion)
|
String
|
toXML()
Exports this DOM as a String |
String
|
toXML(org.w3c.dom.Node n)
|
void
|
write(String text)
|
void
|
writeln(String text)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private Map cachedExpressions
private org.w3c.dom.html.HTMLDocument dom
private XPath xpath
| Constructor Detail |
|---|
public SimpleHtmlDocument()
public SimpleHtmlDocument(org.w3c.dom.html.HTMLDocument dom)
Document - the HTML DOM document to wrap within this SimpleDocument.
| Method Detail |
|---|
public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
public org.w3c.dom.Node cloneNode(boolean deep)
public void close()
public short compareDocumentPosition(org.w3c.dom.Node other)
private XPathExpression compile(String expression)
expression - the expression to compile
public org.w3c.dom.Attr createAttribute(String name)
public org.w3c.dom.Attr createAttributeNS(String namespaceURI, String qualifiedName)
public org.w3c.dom.CDATASection createCDATASection(String data)
public org.w3c.dom.Comment createComment(String data)
public org.w3c.dom.DocumentFragment createDocumentFragment()
public org.w3c.dom.Element createElement(String tagName)
public org.w3c.dom.Element createElementNS(String namespaceURI, String qualifiedName)
public org.w3c.dom.EntityReference createEntityReference(String name)
public org.w3c.dom.ProcessingInstruction createProcessingInstruction(String target, String data)
public org.w3c.dom.Text createTextNode(String data)
public SimpleHtmlCollection getAnchors()
public SimpleHtmlCollection getApplets()
public org.w3c.dom.NamedNodeMap getAttributes()
public String getBaseURI()
public org.w3c.dom.html.HTMLElement getBody()
public int getChildElementCount(org.w3c.dom.Node parent)
parent - the parent node
public SimpleNodeList getChildElements(org.w3c.dom.Node parent)
Returns the child elements of the specified node. This returns only the immediate child Nodes of type ELEMENT_NODE.
parent - the parent node
public SimpleNodeList getChildNodes()
public String getCookie()
public org.w3c.dom.DocumentType getDoctype()
public org.w3c.dom.Element getDocumentElement()
public String getDocumentURI()
public org.w3c.dom.DOMConfiguration getDomConfig()
public String getDomain()
public org.w3c.dom.Node getElement(String expression)
expression - an XPath expression
public org.w3c.dom.Node getElement(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public org.w3c.dom.Element getElementById(String elementId)
public SimpleNodeList getElements(String expression)
expression - an XPath expression
public SimpleNodeList getElements(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public SimpleNodeList getElementsByName(String elementName)
public SimpleNodeList getElementsByTagName(String tagname)
public SimpleNodeList getElementsByTagNameNS(String namespaceURI, String localName)
public Object getFeature(String feature, String version)
public org.w3c.dom.Node getFirstChild()
public SimpleHtmlCollection getForms()
public SimpleHtmlCollection getImages()
public org.w3c.dom.DOMImplementation getImplementation()
public String getInputEncoding()
public org.w3c.dom.Node getLastChild()
public SimpleHtmlCollection getLinks()
public String getLocalName()
public String getNamespaceURI()
public org.w3c.dom.Node getNextSibling()
public String getNodeName()
public short getNodeType()
public String getNodeValue()
public org.w3c.dom.Document getOwnerDocument()
public org.w3c.dom.Node getParentNode()
public String getPrefix()
public org.w3c.dom.Node getPreviousSibling()
public String getReferrer()
public boolean getStrictErrorChecking()
public String getString(String expression)
expression - an XPath expression
public String getString(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public String getTextContent()
public String getTitle()
public String getURL()
public Object getUserData(String key)
public String getXmlEncoding()
public boolean getXmlStandalone()
public String getXmlVersion()
public boolean hasAttributes()
public boolean hasChildNodes()
public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
public boolean isDefaultNamespace(String namespaceURI)
public boolean isEqualNode(org.w3c.dom.Node arg)
public boolean isSameNode(org.w3c.dom.Node other)
public boolean isSupported(String feature, String version)
public String lookupNamespaceURI(String prefix)
public String lookupPrefix(String namespaceURI)
public void normalize()
public void normalizeDocument()
public void open()
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, String namespaceURI, String qualifiedName)
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
public void setBody(org.w3c.dom.html.HTMLElement body)
public void setCookie(String cookie)
public void setDocumentURI(String documentURI)
public void setNodeValue(String nodeValue)
public void setPrefix(String prefix)
public void setStrictErrorChecking(boolean strictErrorChecking)
public void setTextContent(String textContent)
public void setTitle(String title)
public Object setUserData(String key, Object data, org.w3c.dom.UserDataHandler handler)
public void setXmlStandalone(boolean xmlStandalone)
public void setXmlVersion(String xmlVersion)
public String toXML()
public String toXML(org.w3c.dom.Node n)
public void write(String text)
public void writeln(String text)
Groovy Documentation