jd.xml.util
Class XmlWriter

java.lang.Object
  extended byjava.io.Writer
      extended byjava.io.PrintWriter
          extended byjd.io.TabWriter
              extended byjd.xml.util.XmlWriter

public class XmlWriter
extends TabWriter

A Writer class to produce pretty printed xml files. "0xA" is used to separate lines.


Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
XmlWriter(OutputStream out, Encoding encoding, boolean autoFlush)
          Create a new XmlWriter.
XmlWriter(OutputStream out, String xmlEncoding, boolean autoFlush)
          Create a new XmlWriter.
XmlWriter(Writer out, Encoding encoding, boolean autoFlush)
          Create a new XmlWriter.
XmlWriter(Writer out, String xmlEncoding, boolean autoFlush)
          Create a new XmlWriter.
 
Method Summary
 Encoding getEncoding()
          Return the used xml encoding.
 void printAttribute(String name, String value)
          Print an attribute.
 void printAttributeValue(String value)
          Print a attribute value.
 void printClose()
          Print '>'.
 void printCloseSlash()
          Print "/>".
 void printEqualsQuote()
          Print '="'.
 void printOpen()
          Print '<'.
 void printOpenSlash()
          Print "
 void printQuote()
          Print '"'.
 void printSpace()
          Print a single space character.
 void printText(String text)
          Print XML text.
 
Methods inherited from class jd.io.TabWriter
checkError, close, decreaseTab, flush, getBufferUsed, getTabCount, increaseTab, newLineStarted, print, println, println, println, println, println, println, println, println, println, println, resetBuffer, setError, setLineSeparator, setTabChars, write, write, write, write, write, writeNewLineTab
 
Methods inherited from class java.io.PrintWriter
print, print, print, print, print, print, print, print, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlWriter

public XmlWriter(OutputStream out,
                 String xmlEncoding,
                 boolean autoFlush)
          throws UnsupportedEncodingException
Create a new XmlWriter.

Parameters:
out - a OutputStream
xmlEncoding - the used encoding
autoFlush - - if true the println() methods will flush the output buffer

XmlWriter

public XmlWriter(OutputStream out,
                 Encoding encoding,
                 boolean autoFlush)
          throws UnsupportedEncodingException
Create a new XmlWriter.

Parameters:
out - an OutputStream
autoFlush - - if true the println() methods will flush the output buffer

XmlWriter

public XmlWriter(Writer out,
                 String xmlEncoding,
                 boolean autoFlush)
Create a new XmlWriter.

Parameters:
out - a Writer
xmlEncoding - the encoding
autoFlush - - if true the println() methods will flush the output buffer

XmlWriter

public XmlWriter(Writer out,
                 Encoding encoding,
                 boolean autoFlush)
Create a new XmlWriter.

Parameters:
out - a Writer
autoFlush - - if true the println() methods will flush the output buffer
Method Detail

getEncoding

public Encoding getEncoding()
Return the used xml encoding.


printAttribute

public void printAttribute(String name,
                           String value)
Print an attribute.


printAttributeValue

public void printAttributeValue(String value)
Print a attribute value.


printText

public void printText(String text)
Print XML text.


printSpace

public void printSpace()
Print a single space character.


printOpen

public void printOpen()
Print '<'.


printOpenSlash

public void printOpenSlash()
Print "

printClose

public void printClose()
Print '>'.


printCloseSlash

public void printCloseSlash()
Print "/>".


printEqualsQuote

public void printEqualsQuote()
Print '="'.


printQuote

public void printQuote()
Print '"'.