|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.utils.XmlPlainPrinter
public class XmlPlainPrinter
An implementation of XmlPrinter
that produces compact XML.
This implementation avoids uses line breaks and any indentation. As a result this implementation produces relatively efficient XML at the cost of readability.
Constructor Summary | |
---|---|
XmlPlainPrinter(java.io.OutputStream out)
|
Method Summary | |
---|---|
void |
closeTag(java.lang.String name)
Invoked when a tag is closed. |
void |
finishDocument()
Invoked as the final call to an instance of this interface. |
void |
openTag(java.lang.String name)
Invoked when a tag is opened. |
void |
writeHeader(java.lang.String version,
java.nio.charset.Charset charSet)
Invoked as the first method on an instance of this interface. |
void |
writeValue(java.lang.String value)
Invoked when a value is being output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlPlainPrinter(java.io.OutputStream out)
Method Detail |
---|
public void writeHeader(java.lang.String version, java.nio.charset.Charset charSet) throws java.io.IOException
XmlPrinter
Implementations should produce an appropriate XML header, ideally including the information provided.
Implementations are not required to act on this call
until XmlPrinter.finishDocument()
is invoked.
writeHeader
in interface XmlPrinter
version
- The XML version this document should comply with.charSet
- The character encoding this document is being
encoded with.
java.io.IOException
public void openTag(java.lang.String name) throws java.io.IOException
XmlPrinter
Implementations are not required to act on this call
until XmlPrinter.finishDocument()
is invoked.
openTag
in interface XmlPrinter
name
- The name of the tag being opened.
java.io.IOException
public void writeValue(java.lang.String value) throws java.io.IOException
XmlPrinter
Implementations are not required to act on this call
until XmlPrinter.finishDocument()
is invoked.
writeValue
in interface XmlPrinter
value
- The value associated with the most recently
opened tag.
java.io.IOException
public void closeTag(java.lang.String name) throws java.io.IOException
XmlPrinter
Implementations are not required to act on this call
until XmlPrinter.finishDocument()
is invoked.
closeTag
in interface XmlPrinter
name
- The name of the tag being closed.
java.io.IOException
public void finishDocument() throws java.io.IOException
XmlPrinter
This gives implementations a chance to flush any cached information.
finishDocument
in interface XmlPrinter
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |