org.apache.ibatis.ibator.internal
Class DomWriter

java.lang.Object
  extended by org.apache.ibatis.ibator.internal.DomWriter

public class DomWriter
extends java.lang.Object

This class is used to generate a String representation of an XML document. It is very much based on the class dom.Writer from the Apache Xerces examples, but I've simplified and updated it for use with ibator.

Author:
Andy Clark, IBM (Original work), Jeff Butler (derivation)

Field Summary
protected  boolean isXML11
           
protected  java.io.PrintWriter printWriter
           
 
Constructor Summary
DomWriter()
           
 
Method Summary
protected  java.lang.String getVersion(org.w3c.dom.Document document)
          Extracts the XML version from the Document.
protected  void normalizeAndPrint(char c, boolean isAttValue)
          Normalizes and print the given character.
protected  void normalizeAndPrint(java.lang.String s, boolean isAttValue)
          Normalizes and prints the given string.
protected  org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
          Returns a sorted list of attributes.
 java.lang.String toString(org.w3c.dom.Document document)
           
protected  void write(org.w3c.dom.CDATASection node)
           
protected  void write(org.w3c.dom.Comment node)
           
protected  void write(org.w3c.dom.Document node)
           
protected  void write(org.w3c.dom.DocumentType node)
           
protected  void write(org.w3c.dom.Element node)
           
protected  void write(org.w3c.dom.EntityReference node)
           
protected  void write(org.w3c.dom.ProcessingInstruction node)
           
protected  void write(org.w3c.dom.Text node)
           
protected  void writeAnyNode(org.w3c.dom.Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printWriter

protected java.io.PrintWriter printWriter

isXML11

protected boolean isXML11
Constructor Detail

DomWriter

public DomWriter()
Method Detail

toString

public java.lang.String toString(org.w3c.dom.Document document)
                          throws ShellException
Throws:
ShellException

sortAttributes

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


normalizeAndPrint

protected void normalizeAndPrint(java.lang.String s,
                                 boolean isAttValue)
Normalizes and prints the given string.


normalizeAndPrint

protected void normalizeAndPrint(char c,
                                 boolean isAttValue)
Normalizes and print the given character.


getVersion

protected java.lang.String getVersion(org.w3c.dom.Document document)
Extracts the XML version from the Document.


writeAnyNode

protected void writeAnyNode(org.w3c.dom.Node node)
                     throws ShellException
Throws:
ShellException

write

protected void write(org.w3c.dom.Document node)
              throws ShellException
Throws:
ShellException

write

protected void write(org.w3c.dom.DocumentType node)
              throws ShellException
Throws:
ShellException

write

protected void write(org.w3c.dom.Element node)
              throws ShellException
Throws:
ShellException

write

protected void write(org.w3c.dom.EntityReference node)

write

protected void write(org.w3c.dom.CDATASection node)

write

protected void write(org.w3c.dom.Text node)

write

protected void write(org.w3c.dom.ProcessingInstruction node)

write

protected void write(org.w3c.dom.Comment node)