org.mybatis.generator.internal
Class DomWriter

java.lang.Object
  extended by org.mybatis.generator.internal.DomWriter

public class DomWriter
extends 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.

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

Field Summary
protected  boolean isXML11
           
protected  PrintWriter printWriter
           
 
Constructor Summary
DomWriter()
           
 
Method Summary
protected  String getVersion(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(String s, boolean isAttValue)
          Normalizes and prints the given string.
protected  Attr[] sortAttributes(NamedNodeMap attrs)
          Returns a sorted list of attributes.
 String toString(Document document)
           
protected  void write(CDATASection node)
           
protected  void write(Comment node)
           
protected  void write(Document node)
           
protected  void write(DocumentType node)
           
protected  void write(Element node)
           
protected  void write(EntityReference node)
           
protected  void write(ProcessingInstruction node)
           
protected  void write(Text node)
           
protected  void writeAnyNode(Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printWriter

protected PrintWriter printWriter

isXML11

protected boolean isXML11
Constructor Detail

DomWriter

public DomWriter()
Method Detail

toString

public String toString(Document document)
                throws ShellException
Throws:
ShellException

sortAttributes

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


normalizeAndPrint

protected void normalizeAndPrint(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 String getVersion(Document document)
Extracts the XML version from the Document.


writeAnyNode

protected void writeAnyNode(Node node)
                     throws ShellException
Throws:
ShellException

write

protected void write(Document node)
              throws ShellException
Throws:
ShellException

write

protected void write(DocumentType node)
              throws ShellException
Throws:
ShellException

write

protected void write(Element node)
              throws ShellException
Throws:
ShellException

write

protected void write(EntityReference node)

write

protected void write(CDATASection node)

write

protected void write(Text node)

write

protected void write(ProcessingInstruction node)

write

protected void write(Comment node)


Copyright © 2010-2012 MyBatis.org. All Rights Reserved.