|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XmlPrinter
A simple interface encapsulating methods for "printing" an XML document.
This interface makes no attempt to cater for attributes or anything more advanced than is required for XML-RPC.
Implementations will typically be backed by a stream of some sort.
The form the output takes is entirely at the discretion of an implementation, as long as it is logically equivalent to an XML document that would be produced if each method immediately output the relevant string literal.
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. |
Method Detail |
---|
void writeHeader(java.lang.String version, java.nio.charset.Charset charSet) throws java.io.IOException
Implementations should produce an appropriate XML header, ideally including the information provided.
Implementations are not required to act on this call
until finishDocument()
is invoked.
version
- The XML version this document should comply with.charSet
- The character encoding this document is being
encoded with.
java.io.IOException
void openTag(java.lang.String name) throws java.io.IOException
Implementations are not required to act on this call
until finishDocument()
is invoked.
name
- The name of the tag being opened.
java.io.IOException
void writeValue(java.lang.String value) throws java.io.IOException
Implementations are not required to act on this call
until finishDocument()
is invoked.
value
- The value associated with the most recently
opened tag.
java.io.IOException
void closeTag(java.lang.String name) throws java.io.IOException
Implementations are not required to act on this call
until finishDocument()
is invoked.
name
- The name of the tag being closed.
java.io.IOException
void finishDocument() throws java.io.IOException
This gives implementations a chance to flush any cached information.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |