|
Nux 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nux.xom.sandbox.StaxFilteredStreamWriter nux.xom.sandbox.StaxFragmentStreamWriter
public final class StaxFragmentStreamWriter
StAX XMLStreamWriter that delegates all calls to the given underlying child
writer, except that calls to all close
,
writeStartDocument
and writeEndDocument
flavours are silently ignored.
Consider SOAP frameworks (or similar), where the framework writes the SOAP
header to an XMLStreamWriter, and the application writes the SOAP body (i.e.
a fragment aka element subtree) via a StreamingSerializer
to the same XMLStreamWriter. The application needs a way to write a fragment
without writing START_DOCUMENT and END_DOCUMENT events, but
StreamingSerializer doesn't really allow that, in order to ensure
wellformedness.
This class enables StreamingSerializer applications to do just that, without requiring weird and unsafe extensions to the StreamingSerializer interface.
Constructor Summary | |
---|---|
StaxFragmentStreamWriter(XMLStreamWriter child)
Constructs an instance that delegates to the given child writer. |
Method Summary | |
---|---|
void |
close()
|
void |
writeEndDocument()
|
void |
writeStartDocument()
|
void |
writeStartDocument(String version)
|
void |
writeStartDocument(String encoding,
String version)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StaxFragmentStreamWriter(XMLStreamWriter child)
child
- the writer to delegate toMethod Detail |
---|
public void close() throws XMLStreamException
StaxFilteredStreamWriter
close
in interface XMLStreamWriter
close
in class StaxFilteredStreamWriter
XMLStreamException
public void writeEndDocument() throws XMLStreamException
StaxFilteredStreamWriter
writeEndDocument
in interface XMLStreamWriter
writeEndDocument
in class StaxFilteredStreamWriter
XMLStreamException
public void writeStartDocument() throws XMLStreamException
StaxFilteredStreamWriter
writeStartDocument
in interface XMLStreamWriter
writeStartDocument
in class StaxFilteredStreamWriter
XMLStreamException
public void writeStartDocument(String version) throws XMLStreamException
StaxFilteredStreamWriter
writeStartDocument
in interface XMLStreamWriter
writeStartDocument
in class StaxFilteredStreamWriter
XMLStreamException
public void writeStartDocument(String encoding, String version) throws XMLStreamException
StaxFilteredStreamWriter
writeStartDocument
in interface XMLStreamWriter
writeStartDocument
in class StaxFilteredStreamWriter
XMLStreamException
|
Nux 1.6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |