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