de.pdark.decentxml
Class XMLWriter

java.lang.Object
  extended by java.io.Writer
      extended by de.pdark.decentxml.XMLWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class XMLWriter
extends java.io.Writer


Field Summary
protected  Node current
           
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
XMLWriter(java.io.Writer writer)
           
 
Method Summary
 void close()
           
 void flush()
           
 java.lang.String getIndent()
           
 boolean hasSingleTextChild(Element e)
           
 void indent()
           
 boolean isCompact(Element e)
           
 boolean isPadCompact()
          If this is true, the writer makes sure that there is a single space before "/>"
 void nl()
           
 void setIndent(java.lang.String indent)
           
 void setPadCompact(boolean padCompact)
           
 void write(char[] cbuf, int off, int len)
           
 void write(Element e)
          Write an element with all attributes and children
 void write(Node node, java.lang.String s)
          If you want to see every node written to the underlying writer, this is the place.
 void writeAttributes(Element e)
           
 void writeAttributeValue(Node node, java.lang.String value, char quoteChar)
           
 void writeBeginElement(Element e)
          Write the start tag of an element including the attributes.
 void writeChildNodes(NodeWithChildren node)
          Write all children of a node
 void writeEndElement(Element e)
          Write the end tag of an element
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

protected Node current
Constructor Detail

XMLWriter

public XMLWriter(java.io.Writer writer)
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Specified by:
write in class java.io.Writer
Throws:
java.io.IOException

write

public void write(Node node,
                  java.lang.String s)
           throws java.io.IOException
If you want to see every node written to the underlying writer, this is the place.

Parameters:
node -
s -
Throws:
java.io.IOException

writeAttributeValue

public void writeAttributeValue(Node node,
                                java.lang.String value,
                                char quoteChar)
                         throws java.io.IOException
Throws:
java.io.IOException

writeChildNodes

public void writeChildNodes(NodeWithChildren node)
                     throws java.io.IOException
Write all children of a node

Throws:
java.io.IOException

write

public void write(Element e)
           throws java.io.IOException
Write an element with all attributes and children

Throws:
java.io.IOException

writeEndElement

public void writeEndElement(Element e)
                     throws java.io.IOException
Write the end tag of an element

Throws:
java.io.IOException

writeBeginElement

public void writeBeginElement(Element e)
                       throws java.io.IOException
Write the start tag of an element including the attributes.

Throws:
java.io.IOException

isCompact

public boolean isCompact(Element e)

hasSingleTextChild

public boolean hasSingleTextChild(Element e)

indent

public void indent()
            throws java.io.IOException
Throws:
java.io.IOException

nl

public void nl()
        throws java.io.IOException
Throws:
java.io.IOException

writeAttributes

public void writeAttributes(Element e)
                     throws java.io.IOException
Throws:
java.io.IOException

setIndent

public void setIndent(java.lang.String indent)

getIndent

public java.lang.String getIndent()

setPadCompact

public void setPadCompact(boolean padCompact)

isPadCompact

public boolean isPadCompact()
If this is true, the writer makes sure that there is a single space before "/>"



Copyright © 2008-2011. All Rights Reserved.