|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.util.BuilderSupport groovy.xml.DOMBuilder
public class DOMBuilder extends BuilderSupport
A helper class for creating a W3C DOM tree
Constructor Summary | |
DOMBuilder(Document document)
|
|
DOMBuilder(DocumentBuilder documentBuilder)
|
Method Summary | |
---|---|
protected void
|
appendNamespaceAttributes(Element element, Map attributes)
|
protected Document
|
createDocument()
|
protected Object
|
createNode(Object name)
|
protected Object
|
createNode(Object name, Object value)
|
protected Object
|
createNode(Object name, Map attributes, Object value)
|
protected Object
|
createNode(Object name, Map attributes)
|
static DOMBuilder
|
newInstance()
|
static DOMBuilder
|
newInstance(boolean validating, boolean namespaceAware)
|
static Document
|
parse(Reader reader)
Creates a DocumentBuilder and uses it to parse the XML text read from the given reader. |
static Document
|
parse(Reader reader, boolean validating, boolean namespaceAware)
Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation and namespace awareness to be controlled. |
static Document
|
parse(Reader reader, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration)
Creates a DocumentBuilder and uses it to parse the XML text read from the given reader, allowing parser validation, namespace awareness and permission of DOCTYPE declarations to be controlled. |
Document
|
parseText(String text)
A helper method to parse the given text as XML. |
protected void
|
setParent(Object parent, Object child)
|
Methods inherited from class BuilderSupport | |
---|---|
createNode, createNode, createNode, createNode, doInvokeMethod, getCurrent, getName, invokeMethod, invokeMethod, nodeCompleted, postNodeCompletion, setClosureDelegate, setCurrent, setParent |
Methods inherited from class GroovyObjectSupport | |
---|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Constructor Detail |
---|
public DOMBuilder(Document document)
public DOMBuilder(DocumentBuilder documentBuilder)
Method Detail |
---|
protected void appendNamespaceAttributes(Element element, Map attributes)
protected Document createDocument()
protected Object createNode(Object name)
protected Object createNode(Object name, Object value)
protected Object createNode(Object name, Map attributes, Object value)
protected Object createNode(Object name, Map attributes)
public static DOMBuilder newInstance()
public static DOMBuilder newInstance(boolean validating, boolean namespaceAware)
public static Document parse(Reader reader)
reader
- the reader to read the XML text from
public static Document parse(Reader reader, boolean validating, boolean namespaceAware)
reader
- the reader to read the XML text fromvalidating
- whether to validate the XMLnamespaceAware
- whether the parser should be namespace aware
public static Document parse(Reader reader, boolean validating, boolean namespaceAware, boolean allowDocTypeDeclaration)
reader
- the reader to read the XML text fromvalidating
- whether to validate the XMLnamespaceAware
- whether the parser should be namespace awareallowDocTypeDeclaration
- whether the parser should allow DOCTYPE declarations
public Document parseText(String text)
text
- the XML text to parse
protected void setParent(Object parent, Object child)
Copyright © 2003-2013 The Codehaus. All rights reserved.