Class XMLPrinter

java.lang.Object
java.io.Writer
java.io.PrintWriter
com.softsynth.util.IndentingWriter
com.softsynth.util.XMLPrinter
All Implemented Interfaces:
XMLListener, java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

public class XMLPrinter
extends com.softsynth.util.IndentingWriter
implements XMLListener
  • Constructor Summary

    Constructors
    Constructor Description
    XMLPrinter()  
    XMLPrinter​(java.io.OutputStream stream)  
  • Method Summary

    Modifier and Type Method Description
    void beginElement​(java.lang.String tag, java.util.Hashtable attributes, boolean ifEmpty)
    Handles the start of an element.
    void endElement​(java.lang.String tag)
    Handles the end of an element.
    void foundContent​(java.lang.String content)
    Handles the content of an element.
    static void main​(java.lang.String[] args)
    Print a file passed as a command line argument.

    Methods inherited from class com.softsynth.util.IndentingWriter

    getIndentation, indent, print, println, println, setIndentation, undent

    Methods inherited from class java.io.PrintWriter

    append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, write, write, write, write, write

    Methods inherited from class java.io.Writer

    nullWriter

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XMLPrinter

      public XMLPrinter()
    • XMLPrinter

      public XMLPrinter​(java.io.OutputStream stream)
  • Method Details

    • main

      public static void main​(java.lang.String[] args)
      Print a file passed as a command line argument.
    • beginElement

      public void beginElement​(java.lang.String tag, java.util.Hashtable attributes, boolean ifEmpty)
      Description copied from interface: XMLListener
      Handles the start of an element. The flag ifEmpty if there is no content or endTag.
      Specified by:
      beginElement in interface XMLListener
    • foundContent

      public void foundContent​(java.lang.String content)
      Description copied from interface: XMLListener
      Handles the content of an element.
      Specified by:
      foundContent in interface XMLListener
    • endElement

      public void endElement​(java.lang.String tag)
      Description copied from interface: XMLListener
      Handles the end of an element.
      Specified by:
      endElement in interface XMLListener