Top Description Fields Constructors Methods
org.apache.groovy.xml.tools

public Class DomToGroovy

extends Object
Class Inheritance
Imports
groovy.util.IndentPrinter, org.codehaus.groovy.syntax.Types, org.w3c.dom.Attr, .Comment, .Document, .Element, .NamedNodeMap, .Node, .NodeList, .ProcessingInstruction, .Text, org.xml.sax.InputSource, javax.xml.parsers.DocumentBuilder, .DocumentBuilderFactory, java.io.BufferedReader, .File, .FileReader, .FileWriter, .IOException, .InputStream, .PrintWriter, .Reader, java.util.Collection, .HashMap, .Map

A SAX handler for turning XML into Groovy scripts

Field Summary

Modifier and TypeField and Description
protected boolean
protected Collection<String>
protected IndentPrinter
protected String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
checkEscaping(String localName)

protected void
defineNamespace(Map<K, V> namespaces, String prefix, String uri)

protected Map<K, V>
defineNamespaces(Element element, Map<K, V> namespaces)

protected String
protected String
protected String
protected String
public static void
main(String[] args)

protected boolean
protected static Document
parse(final String fileName)

public static Document
parse(final File file)

public static Document
parse(final Reader input)

public static Document
parse(final InputStream input)

protected boolean
protected boolean
printAttributeWithoutPrefix(Attr attribute, boolean hasAttribute)

protected void
protected void
printChildren(Node parent, Map<K, V> namespaces)

protected void
printComment(Comment comment, boolean endWithComma)

protected void
printElement(Element element, Map<K, V> namespaces, boolean endWithComma)

protected void
printEnd(String text, boolean endWithComma)

protected void
protected void
protected void
printPI(ProcessingInstruction instruction, boolean endWithComma)

protected void
protected void
printText(Text node, boolean endWithComma)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inMixedback to summary
protected boolean inMixed
keywordsback to summary
protected Collection<String> keywords
outback to summary
protected IndentPrinter out
qtback to summary
protected String qt

Constructor Detail

DomToGroovyback to summary
public DomToGroovy(PrintWriter out)
DomToGroovyback to summary
public DomToGroovy(IndentPrinter out)

Method Detail

checkEscapingback to summary
protected boolean checkEscaping(String localName)
defineNamespaceback to summary
protected void defineNamespace(Map<K, V> namespaces, String prefix, String uri)
defineNamespacesback to summary
protected Map<K, V> defineNamespaces(Element element, Map<K, V> namespaces)
escapeQuoteback to summary
protected String escapeQuote(String text)
getAttributeValueback to summary
protected String getAttributeValue(Attr attribute)
getLocalNameback to summary
protected String getLocalName(Node node)
getTextNodeDataback to summary
protected String getTextNodeData(Text node)
mainback to summary
public static void main(String[] args)
mixedContentback to summary
protected boolean mixedContent(NodeList list)
parseback to summary
protected static Document parse(final String fileName) throws Exception
parseback to summary
public static Document parse(final File file) throws Exception
parseback to summary
public static Document parse(final Reader input) throws Exception
parseback to summary
public static Document parse(final InputStream input) throws Exception
printAttributesback to summary
protected boolean printAttributes(Element element)
printAttributeWithoutPrefixback to summary
protected boolean printAttributeWithoutPrefix(Attr attribute, boolean hasAttribute)
printAttributeWithPrefixback to summary
protected void printAttributeWithPrefix(Attr attribute, StringBuffer buffer)
printChildrenback to summary
protected void printChildren(Node parent, Map<K, V> namespaces)
printCommentback to summary
protected void printComment(Comment comment, boolean endWithComma)
printElementback to summary
protected void printElement(Element element, Map<K, V> namespaces, boolean endWithComma)
printEndback to summary
protected void printEnd(String text, boolean endWithComma)
printIndentback to summary
protected void printIndent()
printlnback to summary
protected void println(String text)
printPIback to summary
protected void printPI(ProcessingInstruction instruction, boolean endWithComma)
printQuotedback to summary
protected void printQuoted(String text)
printTextback to summary
protected void printText(Text node, boolean endWithComma)