Package org.codehaus.groovy.tools.xml

## Class DomToGroovy

- java.lang.Object
- - org.codehaus.groovy.tools.xml.DomToGroovy

-     public class DomToGroovy
      extends Object

  A SAX handler for turning XML into Groovy scripts

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected boolean` | `inMixed` |
    `protected Collection<String>` | `keywords` |
    `protected IndentPrinter` | `out` |
    `protected String` | `qt` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DomToGroovy​(IndentPrinter out)` |
    `DomToGroovy​(PrintWriter out)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `checkEscaping​(String localName)` |
    `protected void` | `defineNamespace​(Map namespaces, String prefix, String uri)` |
    `protected Map` | `defineNamespaces​(Element element, Map namespaces)` |
    `protected String` | `escapeQuote​(String text)` |
    `protected String` | `getAttributeValue​(Attr attribute)` |
    `protected String` | `getLocalName​(Node node)` |
    `protected String` | `getTextNodeData​(Text node)` |
    `static void` | `main​(String[] args)` |
    `protected boolean` | `mixedContent​(NodeList list)` |
    `static Document` | `parse​(File file)` |
    `static Document` | `parse​(InputStream input)` |
    `static Document` | `parse​(Reader input)` |
    `protected static Document` | `parse​(String fileName)` |
    `protected void` | `print​(String text)` |
    `void` | `print​(Document document)` |
    `protected void` | `print​(Node node, Map namespaces, boolean endWithComma)` |
    `protected boolean` | `printAttributes​(Element element)` |
    `protected boolean` | `printAttributeWithoutPrefix​(Attr attribute, boolean hasAttribute)` |
    `protected void` | `printAttributeWithPrefix​(Attr attribute, StringBuffer buffer)` |
    `protected void` | `printChildren​(Node parent, Map namespaces)` |
    `protected void` | `printComment​(Comment comment, boolean endWithComma)` |
    `protected void` | `printElement​(Element element, Map namespaces, boolean endWithComma)` |
    `protected void` | `printEnd​(String text, boolean endWithComma)` |
    `protected void` | `printIndent()` |
    `protected void` | `println​(String text)` |
    `protected void` | `printPI​(ProcessingInstruction instruction, boolean endWithComma)` |
    `protected void` | `printQuoted​(String text)` |
    `protected void` | `printText​(Text node, boolean endWithComma)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### out

          protected IndentPrinter out

    - #### inMixed

          protected boolean inMixed

    - #### qt

          protected String qt

    - #### keywords

          protected Collection<String> keywords

  - ### Constructor Detail

    - #### DomToGroovy

          public DomToGroovy​(PrintWriter out)

    - #### DomToGroovy

          public DomToGroovy​(IndentPrinter out)

  - ### Method Detail

    - #### print

          public void print​(Document document)

    - #### main

          public static void main​(String[] args)

    - #### parse

          protected static Document parse​(String fileName)
                                   throws Exception

      Throws:
        `Exception`

    - #### parse

          public static Document parse​(File file)
                                throws Exception

      Throws:
        `Exception`

    - #### parse

          public static Document parse​(Reader input)
                                throws Exception

      Throws:
        `Exception`

    - #### parse

          public static Document parse​(InputStream input)
                                throws Exception

      Throws:
        `Exception`

    - #### print

          protected void print​(Node node,
                               Map namespaces,
                               boolean endWithComma)

    - #### printElement

          protected void printElement​(Element element,
                                      Map namespaces,
                                      boolean endWithComma)

    - #### printQuoted

          protected void printQuoted​(String text)

    - #### printPI

          protected void printPI​(ProcessingInstruction instruction,
                                 boolean endWithComma)

    - #### printComment

          protected void printComment​(Comment comment,
                                      boolean endWithComma)

    - #### printText

          protected void printText​(Text node,
                                   boolean endWithComma)

    - #### escapeQuote

          protected String escapeQuote​(String text)

    - #### defineNamespaces

          protected Map defineNamespaces​(Element element,
                                         Map namespaces)

    - #### defineNamespace

          protected void defineNamespace​(Map namespaces,
                                         String prefix,
                                         String uri)

    - #### printAttributes

          protected boolean printAttributes​(Element element)

    - #### printAttributeWithPrefix

          protected void printAttributeWithPrefix​(Attr attribute,
                                                  StringBuffer buffer)

    - #### getAttributeValue

          protected String getAttributeValue​(Attr attribute)

    - #### printAttributeWithoutPrefix

          protected boolean printAttributeWithoutPrefix​(Attr attribute,
                                                        boolean hasAttribute)

    - #### checkEscaping

          protected boolean checkEscaping​(String localName)

    - #### getTextNodeData

          protected String getTextNodeData​(Text node)

    - #### mixedContent

          protected boolean mixedContent​(NodeList list)

    - #### printChildren

          protected void printChildren​(Node parent,
                                       Map namespaces)

    - #### getLocalName

          protected String getLocalName​(Node node)

    - #### printEnd

          protected void printEnd​(String text,
                                  boolean endWithComma)

    - #### println

          protected void println​(String text)

    - #### print

          protected void print​(String text)

    - #### printIndent

          protected void printIndent()