groovy.xml
Class XmlUtil

java.lang.Object
  extended by groovy.xml.XmlUtil

public class XmlUtil
extends java.lang.Object

Used for pretty printing XML content.


Constructor Summary
XmlUtil()
           
 
Method Summary
private static javax.xml.transform.stream.StreamSource asStreamSource(java.lang.String xmlString)
           
private static java.lang.String asString(Writable writable)
           
static java.lang.String serialize(org.w3c.dom.Element element)
          Return a pretty String version of the Element.
static void serialize(org.w3c.dom.Element element, java.io.OutputStream os)
          Write a pretty version of the Element to the OutputStream.
private static void serialize(javax.xml.transform.Source source, java.io.OutputStream os)
           
private static void serialize(javax.xml.transform.Source source, javax.xml.transform.stream.StreamResult target)
           
private static void serialize(javax.xml.transform.Source source, java.io.Writer w)
           
static java.lang.String serialize(java.lang.String xmlString)
          Return a pretty version of the XML content contained in the given String.
static void serialize(java.lang.String xmlString, java.io.OutputStream os)
          Write a pretty version of the given XML string to the OutputStream.
static java.lang.String serialize(Writable writable)
          Return a pretty String version of the XML content produced by the Writable.
static void serialize(Writable writable, java.io.OutputStream os)
          Write a pretty version of the XML content produced by the Writable to the OutputStream.
private static void setIndent(javax.xml.transform.TransformerFactory factory, int indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlUtil

public XmlUtil()
Method Detail

serialize

public static java.lang.String serialize(org.w3c.dom.Element element)
Return a pretty String version of the Element.

Parameters:
element - the element to serialize
Returns:
the pretty String representation of the element

serialize

public static void serialize(org.w3c.dom.Element element,
                             java.io.OutputStream os)
Write a pretty version of the Element to the OutputStream.

Parameters:
element - the element to serialize
os - the outputstream to write to

serialize

public static java.lang.String serialize(Writable writable)
Return a pretty String version of the XML content produced by the Writable.

Parameters:
writable - the writable to serialize
Returns:
the pretty String representation of the element

serialize

public static void serialize(Writable writable,
                             java.io.OutputStream os)
Write a pretty version of the XML content produced by the Writable to the OutputStream.

Parameters:
writable - the writable to serialize
os - the outputstream to write to

serialize

public static java.lang.String serialize(java.lang.String xmlString)
Return a pretty version of the XML content contained in the given String.

Parameters:
xmlString - the string to serialize
Returns:
the pretty String representation of the element

serialize

public static void serialize(java.lang.String xmlString,
                             java.io.OutputStream os)
Write a pretty version of the given XML string to the OutputStream.

Parameters:
xmlString - the string to serialize
os - the outputstream to write to

asString

private static java.lang.String asString(Writable writable)

asStreamSource

private static javax.xml.transform.stream.StreamSource asStreamSource(java.lang.String xmlString)

serialize

private static void serialize(javax.xml.transform.Source source,
                              java.io.OutputStream os)

serialize

private static void serialize(javax.xml.transform.Source source,
                              java.io.Writer w)

serialize

private static void serialize(javax.xml.transform.Source source,
                              javax.xml.transform.stream.StreamResult target)

setIndent

private static void setIndent(javax.xml.transform.TransformerFactory factory,
                              int indent)


Copyright © ${year} The Codehaus. All Rights Reserved.