|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jdesktop.dom.SimpleDocument
public class SimpleDocument extends Object
A DOM org.w3c.dom.Document that makes it easier to work with DOM
documents. This class simply wraps a delegate DOM Document and
delegates all calls to the Document. This allows this class to work with
any DOM Document.
| Field Summary | |
|---|---|
private Map |
cachedExpressions
|
private org.w3c.dom.Document |
dom
|
private XPath |
xpath
|
| Constructor Summary | |
SimpleDocument()
Create a new, empty, SimpleDocument |
|
SimpleDocument(org.w3c.dom.Document dom)
Creates a new instance of SimpleDocument. |
|
SimpleDocument(String xml)
Creates a new instance of SimpleDocument with the given XML. |
|
| 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)
|
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)
|
org.w3c.dom.NamedNodeMap
|
getAttributes()
|
String
|
getBaseURI()
|
int
|
getChildElementCount(org.w3c.dom.Node node)
Returns the number of child elements for the given node. |
SimpleNodeList
|
getChildElements(org.w3c.dom.Node node)
|
SimpleNodeList
|
getChildNodes()
|
org.w3c.dom.DocumentType
|
getDoctype()
@inheritDoc |
org.w3c.dom.Element
|
getDocumentElement()
|
String
|
getDocumentURI()
|
org.w3c.dom.DOMConfiguration
|
getDomConfig()
|
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
|
getElementsByTagName(String tagname)
|
SimpleNodeList
|
getElementsByTagNameNS(String namespaceURI, String localName)
|
Object
|
getFeature(String feature, String version)
|
org.w3c.dom.Node
|
getFirstChild()
|
org.w3c.dom.DOMImplementation
|
getImplementation()
|
String
|
getInputEncoding()
|
org.w3c.dom.Node
|
getLastChild()
|
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()
|
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()
|
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()
|
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
|
setDocumentURI(String documentURI)
|
void
|
setNodeValue(String nodeValue)
|
void
|
setPrefix(String prefix)
|
void
|
setStrictErrorChecking(boolean strictErrorChecking)
|
void
|
setTextContent(String textContent)
|
Object
|
setUserData(String key, Object data, org.w3c.dom.UserDataHandler handler)
|
void
|
setXmlStandalone(boolean xmlStandalone)
|
void
|
setXmlVersion(String xmlVersion)
|
String
|
toString()
|
String
|
toXML()
Exports this DOM as a String |
String
|
toXML(org.w3c.dom.Node n)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private Map cachedExpressions
private org.w3c.dom.Document dom
private XPath xpath
| Constructor Detail |
|---|
public SimpleDocument()
public SimpleDocument(org.w3c.dom.Document dom)
Document - the DOM document to wrap within this SimpleDocument.
public SimpleDocument(String xml)
| 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 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 org.w3c.dom.NamedNodeMap getAttributes()
public String getBaseURI()
public int getChildElementCount(org.w3c.dom.Node node)
parent - the parent node
public SimpleNodeList getChildElements(org.w3c.dom.Node node)
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 org.w3c.dom.DocumentType getDoctype()
public org.w3c.dom.Element getDocumentElement()
public String getDocumentURI()
public org.w3c.dom.DOMConfiguration getDomConfig()
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 getElementsByTagName(String tagname)
public SimpleNodeList getElementsByTagNameNS(String namespaceURI, String localName)
public Object getFeature(String feature, String version)
public org.w3c.dom.Node getFirstChild()
public org.w3c.dom.DOMImplementation getImplementation()
public String getInputEncoding()
public org.w3c.dom.Node getLastChild()
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 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 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 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 setDocumentURI(String documentURI)
public void setNodeValue(String nodeValue)
public void setPrefix(String prefix)
public void setStrictErrorChecking(boolean strictErrorChecking)
public void setTextContent(String textContent)
public Object setUserData(String key, Object data, org.w3c.dom.UserDataHandler handler)
public void setXmlStandalone(boolean xmlStandalone)
public void setXmlVersion(String xmlVersion)
public String toString()
public String toXML()
public String toXML(org.w3c.dom.Node n)
Groovy Documentation