XMLStreamWriter,
as well as to configure individual instances.
It also adds limited number of methods that are important for
efficient pass-through processing (such as one needed when routing
SOAP-messages).
Since version 3.0, stream writer will also implement "Typed Access API" on output side.
| Modifier and Type | Method and Description |
|---|---|
| public void | closeCompletely()
Method similar to
|
| public void | copyEventFromReader(XMLStreamReader2
Reader to use for accessing event to copy r, boolean If true, writer is not allowed to change
the state of the reader (so that all the data associated with the
current event has to be preserved); if false, writer is allowed
to use methods that may cause some data to be discarded. Setting
this to false may improve the performance, since it may allow
full no-copy streaming of data, especially textual contents. preserveEventData)Method that essentially copies event that the specified reader has just read. |
| public String | getEncoding()
Method that can be called to get information about encoding that this writer is using (or at least claims is using). |
| public XMLStreamLocation2 | getLocation()
Method that should return current output location, if the writer keeps track of it; null if it does not. |
| public boolean | isPropertySupported(String name)
Method similar to |
| public boolean | Returns: True, if the specified property was succesfully set to specified value; false if its value was not changedName of the property to set name, Object Value to set property to. value)Method that can be used to set per-writer properties; a subset of
properties one can set via matching
|
| public void | |
| public void | |
| public void | writeFullEndElement()
Method similar to |
| public void | |
| public void | |
| public void | writeRaw(char[] text, int offset, int length)
Method that writes specified content as is, without encoding or deciphering it in any way. |
| public void | |
| public void | writeSpace(char[] text, int offset, int length)
Method that can be called to write whitespace-only content. |
| public void |
| closeCompletely | back to summary |
|---|---|
| public void closeCompletely() throws XMLStreamException Method similar to
| |
| copyEventFromReader | back to summary |
|---|---|
| public void copyEventFromReader(XMLStreamReader2 r, boolean preserveEventData) throws XMLStreamException Method that essentially copies event that the specified reader has just read. This can be both more convenient (no need to worry about details) and more efficient than separately calling access methods of the reader and write methods of the writer, since writer may know more about reader than the application (and may be able to use non-public methods)
| |
| getEncoding | back to summary |
|---|---|
| public String getEncoding() Method that can be called to get information about encoding that this writer is using (or at least claims is using). That is, it returns name of encoding specified when (in order of priority):
| |
| getLocation | back to summary |
|---|---|
| public XMLStreamLocation2 getLocation() Method that should return current output location, if the writer keeps track of it; null if it does not. | |
| isPropertySupported | back to summary |
|---|---|
| public boolean isPropertySupported(String name) Method similar to | |
| setProperty | back to summary |
|---|---|
| public boolean setProperty(String name, Object value) Method that can be used to set per-writer properties; a subset of
properties one can set via matching
| |
| writeCData | back to summary |
|---|---|
| public void writeCData(char[] text, int start, int len) throws XMLStreamException | |
| writeDTD | back to summary |
|---|---|
| public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws XMLStreamException | |
| writeFullEndElement | back to summary |
|---|---|
| public void writeFullEndElement() throws XMLStreamException Method similar to | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String text) throws XMLStreamException Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes. | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String text, int offset, int length) throws XMLStreamException Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes. | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(char[] text, int offset, int length) throws XMLStreamException Method that writes specified content as is, without encoding or deciphering it in any way. It will not update state of the writer (except by possibly flushing output of previous writes, like finishing a start element), nor be validated in any way. As such, care must be taken, if this method is used. Method is usually used when encapsulating output from another writer as a sub-tree, or when passing through XML fragments. Note since text to be written may be anything, including markup, it can not be reliably validated. Because of this, validator(s) attached to the writer will NOT be informed about writes. | |
| writeSpace | back to summary |
|---|---|
| public void writeSpace(String text) throws XMLStreamException Method that can be called to write whitespace-only content. If so, it is to be written as is (with no escaping), and does not contain non-whitespace characters (writer may validate this, and throw an exception if it does). This method is useful for things like outputting indentation.
| |
| writeSpace | back to summary |
|---|---|
| public void writeSpace(char[] text, int offset, int length) throws XMLStreamException Method that can be called to write whitespace-only content. If so, it is to be written as is (with no escaping), and does not contain non-whitespace characters (writer may validate this, and throw an exception if it does). This method is useful for things like outputting indentation.
| |
| writeStartDocument | back to summary |
|---|---|
| public void writeStartDocument(String version, String encoding, boolean standAlone) throws XMLStreamException | |