org.sonatype.maven.polyglot.groovy
Class Dom2Groovy

java.lang.Object
  extended by org.sonatype.maven.polyglot.groovy.Dom2Groovy

public class Dom2Groovy
extends java.lang.Object

A SAX handler for turning XML into Groovy scripts

Since:
0.7
Author:
James Strachan, paulk, Jason Dillon

Field Summary
protected  boolean inMixed
           
protected  java.util.List<java.lang.String> keywords
           
protected  groovy.util.IndentPrinter out
           
protected  java.lang.String qt
           
 
Constructor Summary
Dom2Groovy(groovy.util.IndentPrinter out)
           
Dom2Groovy(java.io.PrintWriter out)
           
 
Method Summary
protected  boolean checkEscaping(java.lang.String localName)
           
protected  void defineNamespace(java.util.Map namespaces, java.lang.String prefix, java.lang.String uri)
           
protected  java.util.Map defineNamespaces(org.w3c.dom.Element element, java.util.Map namespaces)
           
protected  java.lang.String escapeQuote(java.lang.String text)
           
protected  java.lang.String getAttributeValue(org.w3c.dom.Attr attribute)
           
protected  java.lang.String getLocalName(org.w3c.dom.Node node)
           
protected  java.lang.String getTextNodeData(org.w3c.dom.Text node)
           
protected  boolean mixedContent(org.w3c.dom.NodeList list)
           
 void print(org.w3c.dom.Document document)
           
protected  void print(org.w3c.dom.Node node, java.util.Map namespaces, boolean endWithComma)
           
 void print(java.io.Reader input)
           
protected  void print(java.lang.String text)
           
protected  boolean printAttributes(org.w3c.dom.Element element)
           
protected  boolean printAttributeWithoutPrefix(org.w3c.dom.Attr attribute, boolean hasAttribute)
           
protected  void printAttributeWithPrefix(org.w3c.dom.Attr attribute, java.lang.StringBuffer buffer)
           
protected  void printChildren(org.w3c.dom.Node parent, java.util.Map namespaces)
           
protected  void printComment(org.w3c.dom.Comment comment, boolean endWithComma)
           
protected  void printElement(org.w3c.dom.Element element, java.util.Map namespaces, boolean endWithComma)
           
protected  void printEnd(java.lang.String text, boolean endWithComma)
           
protected  void printIndent()
           
protected  void println(java.lang.String text)
           
protected  void printPI(org.w3c.dom.ProcessingInstruction instruction, boolean endWithComma)
           
protected  void printQuoted(java.lang.String text)
           
protected  void printText(org.w3c.dom.Text node, boolean endWithComma)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keywords

protected final java.util.List<java.lang.String> keywords

out

protected final groovy.util.IndentPrinter out

inMixed

protected boolean inMixed

qt

protected java.lang.String qt
Constructor Detail

Dom2Groovy

public Dom2Groovy(java.io.PrintWriter out)

Dom2Groovy

public Dom2Groovy(groovy.util.IndentPrinter out)
Method Detail

print

public void print(org.w3c.dom.Document document)

print

public void print(java.io.Reader 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()