br.com.oncast.dev.lobo.io
Class XMLWriter

java.lang.Object
  extended by br.com.oncast.dev.lobo.io.XMLWriter

public class XMLWriter
extends java.lang.Object

Writer for simple XML files.
Does not support character nor CDATA output.


Constructor Summary
XMLWriter(javax.xml.stream.XMLStreamWriter writer)
          Creates a new instance of XMLWriter.
 
Method Summary
 void close()
          Closes the document.
Note that this method won't close the XMLStreamWriter.
 XMLWriter writeAttribute(java.lang.String name, java.lang.String value)
          Writes an attribute to the current tag.
 XMLWriter writeEmptyTag(java.lang.String node)
          Writes an empty tag with the given name.
 XMLWriter writeEndTag()
          Ends the current tag.
 XMLWriter writeTag(java.lang.String node)
          Writes a tag with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLWriter

public XMLWriter(javax.xml.stream.XMLStreamWriter writer)
Creates a new instance of XMLWriter.

Parameters:
writer - the nested XMLStreamWriter.
Method Detail

writeTag

public XMLWriter writeTag(java.lang.String node)
Writes a tag with the given name.

Parameters:
node - the name of the tag.
Returns:
the self XMLWriter for convenience.

writeEmptyTag

public XMLWriter writeEmptyTag(java.lang.String node)
Writes an empty tag with the given name.

Parameters:
node - the name of the tag.
Returns:
the self XMLWriter for convenience.

writeAttribute

public XMLWriter writeAttribute(java.lang.String name,
                                java.lang.String value)
Writes an attribute to the current tag.

Parameters:
name - the name of the attribute.
value - the attribute's value.
Returns:
the self XMLWriter for convenience.

writeEndTag

public XMLWriter writeEndTag()
Ends the current tag.

Returns:
the self XMLWriter for convenience.

close

public void close()
Closes the document.
Note that this method won't close the XMLStreamWriter.