com.mindoo.remote.api.tools.xml
Class DOMPrinter

java.lang.Object
  extended by com.mindoo.remote.api.tools.xml.DOMPrinter

public class DOMPrinter
extends java.lang.Object

Class offering methods to pring XML from DOM-nodes.

Internal utility class. Not part of the public API.


Constructor Summary
DOMPrinter()
           
 
Method Summary
static java.lang.String formatDOMNodeAsXML(org.w3c.dom.Node node)
          Standard way to format a node as XML into a String.
static java.lang.String formatDOMNodeAsXML(org.w3c.dom.Node node, java.lang.String encoding, boolean omitdeclaration)
          Formats the given node as XML into a String.
static void printDOMNodeAsXML(org.w3c.dom.Node node, java.io.OutputStream result, boolean omitdeclaration)
          Prints the given node as XML to the given stream with UTF-8 encoding.
static void printDOMNodeAsXML(org.w3c.dom.Node node, java.io.OutputStream result, java.lang.String encoding, boolean omitdeclaration)
          Prints the given node as XML to the given stream, applying the given encoding.
static void printDOMNodeAsXML(org.w3c.dom.Node node, java.io.Writer result, boolean omitdeclaration)
          Prints the given node as XML to a given writer.
static void printDOMNodeAsXML(org.w3c.dom.Node node, java.io.Writer result, java.lang.String encoding, boolean omitdeclaration)
          Prints the given node as XML to a given writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMPrinter

public DOMPrinter()
Method Detail

printDOMNodeAsXML

public static void printDOMNodeAsXML(org.w3c.dom.Node node,
                                     java.io.OutputStream result,
                                     boolean omitdeclaration)
                              throws javax.xml.transform.TransformerException
Prints the given node as XML to the given stream with UTF-8 encoding.

Parameters:
node - the node
result - receiving the result
omitdeclaration - indicates of the declaration should be ommitted
Throws:
javax.xml.transform.TransformerException - thrown if an error occures

printDOMNodeAsXML

public static void printDOMNodeAsXML(org.w3c.dom.Node node,
                                     java.io.OutputStream result,
                                     java.lang.String encoding,
                                     boolean omitdeclaration)
                              throws javax.xml.transform.TransformerException
Prints the given node as XML to the given stream, applying the given encoding.

Parameters:
node - the node
result - receiving the result
encoding - encoding (std. UTF-8)
omitdeclaration - indicates of the declaration should be ommitted
Throws:
javax.xml.transform.TransformerException - thrown if an error occures

printDOMNodeAsXML

public static void printDOMNodeAsXML(org.w3c.dom.Node node,
                                     java.io.Writer result,
                                     boolean omitdeclaration)
                              throws javax.xml.transform.TransformerException
Prints the given node as XML to a given writer. If the xml-declaration is not ommitted, it will contain "UTF-8"-encoding.

Parameters:
node - the node
result - receiving the result
omitdeclaration - indicates of the declaration should be ommitted
Throws:
javax.xml.transform.TransformerException - thrown if an error occures

printDOMNodeAsXML

public static void printDOMNodeAsXML(org.w3c.dom.Node node,
                                     java.io.Writer result,
                                     java.lang.String encoding,
                                     boolean omitdeclaration)
                              throws javax.xml.transform.TransformerException
Prints the given node as XML to a given writer. By using a writer, this method cannot perform any encoding. If the xml-declaration is not ommitted, it will contain "UTF-8"-encoding.

Parameters:
node - the node
result - receiving the result
encoding - encoding (std. UTF-8)
omitdeclaration - indicates of the declaration should be ommitted
Throws:
javax.xml.transform.TransformerException - thrown if an error occures

formatDOMNodeAsXML

public static java.lang.String formatDOMNodeAsXML(org.w3c.dom.Node node,
                                                  java.lang.String encoding,
                                                  boolean omitdeclaration)
                                           throws javax.xml.transform.TransformerException
Formats the given node as XML into a String. If the xml-declaration is not ommitted, it will contain the given encoding.

Parameters:
node - the node
encoding - encoding (std. UTF-8)
omitdeclaration - indicates of the declaration should be ommitted
Throws:
javax.xml.transform.TransformerException - thrown if an error occures

formatDOMNodeAsXML

public static java.lang.String formatDOMNodeAsXML(org.w3c.dom.Node node)
                                           throws javax.xml.transform.TransformerException
Standard way to format a node as XML into a String. The xml-declaration will not be ommitted and contains "UTF-8"-encoding.

Parameters:
node - the node
Throws:
javax.xml.transform.TransformerException - thrown if an error occures