Package org.codehaus.groovy.tools.xml
Class DomToGroovy
- java.lang.Object
-
- org.codehaus.groovy.tools.xml.DomToGroovy
-
public class DomToGroovy extends java.lang.ObjectA SAX handler for turning XML into Groovy scripts
-
-
Field Summary
Fields Modifier and Type Field Description protected booleaninMixedprotected java.util.Collection<java.lang.String>keywordsprotected IndentPrinteroutprotected java.lang.Stringqt
-
Constructor Summary
Constructors Constructor Description DomToGroovy(IndentPrinter out)DomToGroovy(java.io.PrintWriter out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckEscaping(java.lang.String localName)protected voiddefineNamespace(java.util.Map namespaces, java.lang.String prefix, java.lang.String uri)protected java.util.MapdefineNamespaces(org.w3c.dom.Element element, java.util.Map namespaces)protected java.lang.StringescapeQuote(java.lang.String text)protected java.lang.StringgetAttributeValue(org.w3c.dom.Attr attribute)protected java.lang.StringgetLocalName(org.w3c.dom.Node node)protected java.lang.StringgetTextNodeData(org.w3c.dom.Text node)static voidmain(java.lang.String[] args)protected booleanmixedContent(org.w3c.dom.NodeList list)static org.w3c.dom.Documentparse(java.io.File file)static org.w3c.dom.Documentparse(java.io.InputStream input)static org.w3c.dom.Documentparse(java.io.Reader input)protected static org.w3c.dom.Documentparse(java.lang.String fileName)protected voidprint(java.lang.String text)voidprint(org.w3c.dom.Document document)protected voidprint(org.w3c.dom.Node node, java.util.Map namespaces, boolean endWithComma)protected booleanprintAttributes(org.w3c.dom.Element element)protected booleanprintAttributeWithoutPrefix(org.w3c.dom.Attr attribute, boolean hasAttribute)protected voidprintAttributeWithPrefix(org.w3c.dom.Attr attribute, java.lang.StringBuffer buffer)protected voidprintChildren(org.w3c.dom.Node parent, java.util.Map namespaces)protected voidprintComment(org.w3c.dom.Comment comment, boolean endWithComma)protected voidprintElement(org.w3c.dom.Element element, java.util.Map namespaces, boolean endWithComma)protected voidprintEnd(java.lang.String text, boolean endWithComma)protected voidprintIndent()protected voidprintln(java.lang.String text)protected voidprintPI(org.w3c.dom.ProcessingInstruction instruction, boolean endWithComma)protected voidprintQuoted(java.lang.String text)protected voidprintText(org.w3c.dom.Text node, boolean endWithComma)
-
-
-
Field Detail
-
out
protected IndentPrinter out
-
inMixed
protected boolean inMixed
-
qt
protected java.lang.String qt
-
keywords
protected java.util.Collection<java.lang.String> keywords
-
-
Constructor Detail
-
DomToGroovy
public DomToGroovy(java.io.PrintWriter out)
-
DomToGroovy
public DomToGroovy(IndentPrinter out)
-
-
Method Detail
-
print
public void print(org.w3c.dom.Document document)
-
main
public static void main(java.lang.String[] args)
-
parse
protected static org.w3c.dom.Document parse(java.lang.String fileName) throws java.lang.Exception- Throws:
java.lang.Exception
-
parse
public static org.w3c.dom.Document parse(java.io.File file) throws java.lang.Exception- Throws:
java.lang.Exception
-
parse
public static org.w3c.dom.Document parse(java.io.Reader input) throws java.lang.Exception- Throws:
java.lang.Exception
-
parse
public static org.w3c.dom.Document parse(java.io.InputStream input) throws java.lang.Exception- Throws:
java.lang.Exception
-
print
protected void print(org.w3c.dom.Node node, java.util.Map namespaces, boolean endWithComma)
-
printElement
protected void printElement(org.w3c.dom.Element element, java.util.Map namespaces, boolean endWithComma)
-
printQuoted
protected void printQuoted(java.lang.String text)
-
printPI
protected void printPI(org.w3c.dom.ProcessingInstruction instruction, boolean endWithComma)
-
printComment
protected void printComment(org.w3c.dom.Comment comment, boolean endWithComma)
-
printText
protected void printText(org.w3c.dom.Text node, boolean endWithComma)
-
escapeQuote
protected java.lang.String escapeQuote(java.lang.String text)
-
defineNamespaces
protected java.util.Map defineNamespaces(org.w3c.dom.Element element, java.util.Map namespaces)
-
defineNamespace
protected void defineNamespace(java.util.Map namespaces, java.lang.String prefix, java.lang.String uri)
-
printAttributes
protected boolean printAttributes(org.w3c.dom.Element element)
-
printAttributeWithPrefix
protected void printAttributeWithPrefix(org.w3c.dom.Attr attribute, java.lang.StringBuffer buffer)
-
getAttributeValue
protected java.lang.String getAttributeValue(org.w3c.dom.Attr attribute)
-
printAttributeWithoutPrefix
protected boolean printAttributeWithoutPrefix(org.w3c.dom.Attr attribute, boolean hasAttribute)
-
checkEscaping
protected boolean checkEscaping(java.lang.String localName)
-
getTextNodeData
protected java.lang.String getTextNodeData(org.w3c.dom.Text node)
-
mixedContent
protected boolean mixedContent(org.w3c.dom.NodeList list)
-
printChildren
protected void printChildren(org.w3c.dom.Node parent, java.util.Map namespaces)
-
getLocalName
protected java.lang.String getLocalName(org.w3c.dom.Node node)
-
printEnd
protected void printEnd(java.lang.String text, boolean endWithComma)
-
println
protected void println(java.lang.String text)
-
print
protected void print(java.lang.String text)
-
printIndent
protected void printIndent()
-
-