Groovy 1.7.0

## groovy.xml
Class DOMBuilder

    java.lang.Object
      groovy.lang.GroovyObjectSupport
          groovy.util.BuilderSupport
              groovy.xml.DOMBuilder

    class DOMBuilder
    extends BuilderSupport

A helper class for creating a W3C DOM tree

author:
  James Strachan

version:
  $Revision: 14076 $

Field Summary
`Document` | `document`
`DocumentBuilder` | `documentBuilder`

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.
`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, hashCode, getClass, equals, toString, notify, notifyAll

Field Detail

### document

    Document document

### documentBuilder

    DocumentBuilder documentBuilder

Constructor Detail

### DOMBuilder

    public DOMBuilder(Document document)

### DOMBuilder

    public DOMBuilder(DocumentBuilder documentBuilder)

Method Detail

### appendNamespaceAttributes

    protected void appendNamespaceAttributes(Element element, Map attributes)

### createDocument

    protected Document createDocument()

### createNode

    protected Object createNode(Object name)

### createNode

    protected Object createNode(Object name, Object value)

### createNode

    protected Object createNode(Object name, Map attributes, Object value)

### createNode

    protected Object createNode(Object name, Map attributes)

### newInstance

    public static DOMBuilder newInstance()

### newInstance

    public static DOMBuilder newInstance(boolean validating, boolean namespaceAware)

### parse

    public static Document parse(Reader reader)

  Creates a DocumentBuilder and uses it to parse the XML text read from the given reader. A non-validating, namespace aware parser is used.
  param:
    reader the reader to read the XML text from
  return:
    the root node of the parsed tree of Nodes
  throws:
    SAXException Any SAX exception, possibly wrapping another exception.
  throws:
    IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
  throws:
    ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the configuration requested.
  see:
    #parse(Reader, boolean, boolean)

### parse

    public 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.
  param:
    reader the reader to read the XML text from
  param:
    validating whether to validate the XML
  param:
    namespaceAware whether the parser should be namespace aware
  return:
    the root node of the parsed tree of Nodes
  throws:
    SAXException Any SAX exception, possibly wrapping another exception.
  throws:
    IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
  throws:
    ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the configuration requested.

### parseText

    public Document parseText(String text)

  A helper method to parse the given text as XML.
  param:
    text the XML text to parse
  return:
    the root node of the parsed tree of Nodes
  throws:
    SAXException Any SAX exception, possibly wrapping another exception.
  throws:
    IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
  throws:
    ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the configuration requested.
  see:
    #parse(Reader)

### setParent

    protected void setParent(Object parent, Object child)

Copyright © 2003-2009 The Codehaus. All rights reserved.