|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.virtuosotechnologies.lib.xml.XMLUnparser com.virtuosotechnologies.lib.xml.XMLDocumentUnparser
Helper for XML unparsing. This extends XMLUnparser by automatically outputting the XML header and DOCTYPE. It also automatically starts the root element. Therefore, you cannot call makeDefunct() directly. Instead, call finishDocument() when done unparsing.
This class is not thread-safe. Access should be serialized into one thread.
Constructor Summary | |
protected |
XMLDocumentUnparser(Writer writer,
String encoding,
boolean escape16BitChars,
String publicDTD,
String systemDTD,
String rootElement)
Constructor |
Method Summary | |
static XMLDocumentUnparser |
create(OutputStream stream,
String encoding,
String systemDTD,
String rootElement)
pseudo-Constructor |
static XMLDocumentUnparser |
create(Writer writer,
String encoding,
String systemDTD,
String rootElement)
pseudo-Constructor Does not check that the writer matches the given encoding name |
void |
finishDocument(String rootElement)
End the document. |
Methods inherited from class com.virtuosotechnologies.lib.xml.XMLUnparser |
addAttribute, addString, createIndentString, endElement, getWriter, isDefunct, makeDefunct, startMultiLineElement, startSingleLineElement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected XMLDocumentUnparser(Writer writer, String encoding, boolean escape16BitChars, String publicDTD, String systemDTD, String rootElement) throws IOException
writer
- writer to write toencoding
- name of text encoding used by the writersystemDTD
- url for system dtdrootElement
- root element nameMethod Detail |
public static XMLDocumentUnparser create(OutputStream stream, String encoding, String systemDTD, String rootElement) throws IOException
stream
- OutputStream to write toencoding
- name of text encoding to usesystemDTD
- url for system dtdrootElement
- root element name
IOException
public static XMLDocumentUnparser create(Writer writer, String encoding, String systemDTD, String rootElement) throws IOException
writer
- Writer to write toencoding
- name of text encoding to usesystemDTD
- url for system dtdrootElement
- root element name
IOException
public void finishDocument(String rootElement) throws IOException
rootElement
- element name, which must match the original root element
IOException
- i/o error
IllegalStateException
- unparser is defunct
IllegalArgumentException
- element name mismatch
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |