com.ibm.as400.ui.tools
Class XMLWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.OutputStreamWriter
          extended by com.ibm.as400.ui.tools.XMLWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class XMLWriter
extends OutputStreamWriter


Field Summary
Modifier and Type Field and Description
static int COMPACT
           
static int DEFAULT
           
static int PRETTY
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
Constructor and Description
XMLWriter(OutputStream os)
           
 
Method Summary
Modifier and Type Method and Description
 void addIndent(int offset)
          Set the relative indenting level.
 int getOutputStyle()
          Return the current output style.
 void setOutputStyle(int style)
          Set the output style (PRETTY or COMPACT).
 void writeChars(String str)
          Write the given string.
 void writeIndent()
          Write the appropriate indent - given current indent level, or do nothing if output style is COMPACT.
 void writeNewLine()
          Write a new line or do nothing if output style is COMPACT.
 void writeQuotedString(String str)
          Write out the string with quotes around it.
 
Methods inherited from class java.io.OutputStreamWriter
close, flush, getEncoding, write, write, write
 
Methods inherited from class java.io.Writer
append, append, append, 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

DEFAULT

public static int DEFAULT

PRETTY

public static int PRETTY

COMPACT

public static int COMPACT
Constructor Detail

XMLWriter

public XMLWriter(OutputStream os)
Method Detail

writeChars

public void writeChars(String str)
                throws IOException
Write the given string.

Throws:
IOException

writeQuotedString

public void writeQuotedString(String str)
                       throws IOException
Write out the string with quotes around it. This method uses the quotes that are appropriate for the string. I.E. if the string contains a ' then it uses ", & vice versa.

Throws:
IOException

writeNewLine

public void writeNewLine()
                  throws IOException
Write a new line or do nothing if output style is COMPACT.

Throws:
IOException

addIndent

public void addIndent(int offset)
Set the relative indenting level. Eg indent(+1) or indent(-1). The indent level controls what writeIndent writes.


writeIndent

public void writeIndent()
                 throws IOException
Write the appropriate indent - given current indent level, or do nothing if output style is COMPACT.

Throws:
IOException

setOutputStyle

public void setOutputStyle(int style)
Set the output style (PRETTY or COMPACT).


getOutputStyle

public int getOutputStyle()
Return the current output style.