ca.infoway.messagebuilder.util.xml
Class DOMWriter

Package class diagram package DOMWriter
java.lang.Object
  extended by ca.infoway.messagebuilder.util.xml.DOMWriter

public class DOMWriter
extends Object


Field Summary
protected  boolean canonical
          Canonical output.
protected  boolean needNormalize
           
protected  PrintWriter out
          Print writer.
 
Constructor Summary
DOMWriter()
          Default constructor
DOMWriter(boolean canonical)
          Default constructor.
DOMWriter(boolean canonical, boolean needNormalize)
          Default constructor.
DOMWriter(String encoding, boolean canonical)
           
DOMWriter(String encoding, boolean canonical, boolean needNormalize)
           
 
Method Summary
static String getWriterEncoding()
           
static boolean isValidJavaEncoding(String encoding)
           
protected  String normalize(String s)
          Normalizes the given string.
 void print(Node node)
          Prints the specified node, recursively.
static String renderAsString(Node node)
           
static String renderAsString(Node node, boolean canonical)
           
static String renderAsString(Node node, boolean canonical, boolean needNormalize)
           
 void setPrintWriter(PrintWriter printWriter)
           
static void setWriterEncoding(String encoding)
           
protected  Attr[] sortAttributes(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 PrintWriter out
Print writer.


canonical

protected boolean canonical
Canonical output.


needNormalize

protected boolean needNormalize
Constructor Detail

DOMWriter

public DOMWriter(String encoding,
                 boolean canonical)
          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

DOMWriter

public DOMWriter()
          throws UnsupportedEncodingException
Default constructor

Throws:
UnsupportedEncodingException

DOMWriter

public DOMWriter(boolean canonical,
                 boolean needNormalize)
          throws UnsupportedEncodingException
Default constructor.

Throws:
UnsupportedEncodingException

DOMWriter

public DOMWriter(boolean canonical)
          throws UnsupportedEncodingException
Default constructor.

Throws:
UnsupportedEncodingException

DOMWriter

public DOMWriter(String encoding,
                 boolean canonical,
                 boolean needNormalize)
          throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException
Method Detail

sortAttributes

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


renderAsString

public static String renderAsString(Node node,
                                    boolean canonical,
                                    boolean needNormalize)
                             throws IOException
Throws:
IOException

print

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


normalize

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


renderAsString

public static String renderAsString(Node node,
                                    boolean canonical)
                             throws IOException
Throws:
IOException

renderAsString

public static String renderAsString(Node node)
                             throws IOException
Throws:
IOException

getWriterEncoding

public static String getWriterEncoding()

setPrintWriter

public void setPrintWriter(PrintWriter printWriter)

setWriterEncoding

public static void setWriterEncoding(String encoding)

isValidJavaEncoding

public static boolean isValidJavaEncoding(String encoding)


Copyright © 2013. All Rights Reserved.