scone.util
Class DOMWriter

java.lang.Object
  extended by scone.util.DOMWriter

public class DOMWriter
extends java.lang.Object

converts a DOM into a text document. This class is basically the DOMWriter example from Xerces


Field Summary
protected  boolean canonical
          Canonical output.
protected  java.io.PrintWriter out
          Print writer.
 
Constructor Summary
DOMWriter(boolean canonical)
          Default constructor.
DOMWriter(java.lang.String encoding, boolean canonical)
          put your documentation comment here
DOMWriter(java.io.Writer writer, boolean canonical)
          put your documentation comment here
 
Method Summary
static java.lang.String getWriterEncoding()
          put your documentation comment here
static boolean isValidJavaEncoding(java.lang.String encoding)
           
protected  java.lang.String normalize(java.lang.String s)
          Normalizes the given string.
 void print(org.w3c.dom.Node node)
          Prints the specified node, recursively.
static void setWriterEncoding(java.lang.String encoding)
          put your documentation comment here
protected  org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
          Returns a sorted list of attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected java.io.PrintWriter out
Print writer.


canonical

protected boolean canonical
Canonical output.

Constructor Detail

DOMWriter

public DOMWriter(java.io.Writer writer,
                 boolean canonical)
          throws java.io.UnsupportedEncodingException
put your documentation comment here

Parameters:
Writer - writer
boolean - canonical
Throws:
java.io.UnsupportedEncodingException

DOMWriter

public DOMWriter(java.lang.String encoding,
                 boolean canonical)
          throws java.io.UnsupportedEncodingException
put your documentation comment here

Parameters:
String - encoding
boolean - canonical
Throws:
java.io.UnsupportedEncodingException

DOMWriter

public DOMWriter(boolean canonical)
          throws java.io.UnsupportedEncodingException
Default constructor.

Throws:
java.io.UnsupportedEncodingException
Method Detail

getWriterEncoding

public static java.lang.String getWriterEncoding()
put your documentation comment here

Returns:
the encoding the DOMWriter is using: UTF8

setWriterEncoding

public static void setWriterEncoding(java.lang.String encoding)
put your documentation comment here

Parameters:
encoding -

isValidJavaEncoding

public static boolean isValidJavaEncoding(java.lang.String encoding)
Parameters:
encoding -
Returns:
true if Mime2Java encoding is used

print

public void print(org.w3c.dom.Node node)
Prints the specified node, recursively.


sortAttributes

protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes.


normalize

protected java.lang.String normalize(java.lang.String s)
Normalizes the given string.