org.activemath.util
Class PrettyUTF8XMLWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.activemath.util.MyUTF8XMLWriter
          extended by org.activemath.util.ProtectedUTF8XMLWriter
              extended by org.activemath.util.PrettyUTF8XMLWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class PrettyUTF8XMLWriter
extends ProtectedUTF8XMLWriter

A class to write indented XML documents.


Field Summary
 int level
          The current nesting level
 int numSpaces
          The number of spaces per indentation.
 
Fields inherited from class org.activemath.util.ProtectedUTF8XMLWriter
nullString
 
Fields inherited from class org.activemath.util.MyUTF8XMLWriter
escapedLineSeparator, lineSeparator, MINIMIZE_EMPTY_ELEMENTS, MINIMIZE_EMPTY_ELEMENTS_HTML, sysLineSeparator
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
PrettyUTF8XMLWriter(OutputStream s)
           
 
Method Summary
 void attribute(String name, String content)
           
 void endElement(String el)
           
 String indentSpace()
           
 void newLine()
          Adds up a newLine as defined by the lineSeparator variable.
 void startElement(String el)
           
 
Methods inherited from class org.activemath.util.ProtectedUTF8XMLWriter
markup
 
Methods inherited from class org.activemath.util.MyUTF8XMLWriter
cdataSection, characterReference, close, comment, endAttribute, endReplacementText, entityReference, flush, processingInstruction, startAttribute, startReplacementText, write, write, write, write, writeRaw, writeUTF8
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

public int level
The current nesting level


numSpaces

public final int numSpaces
The number of spaces per indentation.

See Also:
Constant Field Values
Constructor Detail

PrettyUTF8XMLWriter

public PrettyUTF8XMLWriter(OutputStream s)
Method Detail

attribute

public void attribute(String name,
                      String content)
               throws IOException
Overrides:
attribute in class ProtectedUTF8XMLWriter
Throws:
IOException

startElement

public void startElement(String el)
                  throws IOException
Overrides:
startElement in class MyUTF8XMLWriter
Throws:
IOException

endElement

public void endElement(String el)
                throws IOException
Overrides:
endElement in class MyUTF8XMLWriter
Throws:
IOException

newLine

public void newLine()
             throws IOException
Description copied from class: MyUTF8XMLWriter
Adds up a newLine as defined by the lineSeparator variable. This method is also called by any newLine printing as all newLines transmitted are escaped (at least the escaped ones).

Overrides:
newLine in class MyUTF8XMLWriter
Throws:
IOException

indentSpace

public String indentSpace()