Class DomWriter

java.lang.Object
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.
  • Field Details

    • printWriter

      protected PrintWriter printWriter
    • isXML11

      protected boolean isXML11
  • Constructor Details

    • DomWriter

      public DomWriter()
  • Method Details

    • toString

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

      protected Attr[] sortAttributes(NamedNodeMap attrs)
    • normalizeAndPrint

      protected void normalizeAndPrint(String s, boolean isAttValue)
    • normalizeAndPrint

      protected void normalizeAndPrint(char c, boolean isAttValue)
    • handleDefault

      private void handleDefault(char c, boolean isAttValue)
    • handleLineFeed

      private void handleLineFeed()
    • handleCarriageReturn

      private void handleCarriageReturn()
    • handleDoubleQuote

      private void handleDoubleQuote(boolean isAttValue)
    • handleAmpersand

      private void handleAmpersand()
    • handleGreaterThan

      private void handleGreaterThan()
    • handleLessThan

      private void handleLessThan()
    • getVersion

      protected String getVersion(Document document)
      Extracts the XML version from the Document.
      Parameters:
      document - the document
      Returns:
      the version
    • 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)
    • 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)