XMLStreamWriter2, the
extended stream writer defined by Stax2 extension, by wrapping
a vanilla Stax 1.0 XMLStreamReader implementation.
Note: the implementation is incomplete as-is, since not all features needed are accessible via basic Stax 1.0 interface. As such, two main use cases for this wrapper are:
| Modifier and Type | Field and Description |
|---|---|
| protected String | mEncoding
Encoding we have determined to be used, according to method calls (write start document etc.) |
| protected final boolean | |
| protected SimpleValueEncoder |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | closeCompletely()
Implements org. javax.,
except that this method also does close the underlying output
destination (stream) if it has not yet been closed.
|
| public void | copyEventFromReader(XMLStreamReader2
Reader to use for accessing event to copy sr, 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)Implements org. |
| protected void | |
| public String | getEncoding()
Implements org. |
| public XMLStreamLocation2 | getLocation()
Implements org. |
| protected SimpleValueEncoder | |
| public boolean | isPropertySupported(String name)
Implements org. javax., used
to determine whether a property is supported by the Writer
instance.
|
| protected String | serializeQNameValue(QName name)
Method called to serialize given qualified name into valid String serialization, taking into account existing namespace bindings. |
| public boolean | setProperty(String
Name of the property to set name, Object Value to set property to. value)Implements org. org.
instance.
|
| public ValidationProblemHandler | setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be used h)Implements org. |
| public XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Implements org. validateAgainst
was called earlier.
|
| public XMLValidator | stopValidatingAgainst(XMLValidator validator)
Implements org. |
| public XMLValidator | validateAgainst(XMLValidationSchema schema)
Implements org. XMLValidator instance from the
given schema (unless a validator for that schema has already been
added),
initialize it if necessary, and make validatable object (reader,
writer)
call appropriate validation methods from this point on until the
end of the document (that is, it's not scoped with sub-trees), or until
validator is removed by an explicit call to
stopValidatingAgainst.
|
| public static XMLStreamWriter2 | wrapIfNecessary(XMLStreamWriter sw)
Method that should be used to add dynamic support for
|
| public void | writeBinary(Base64Variant v, byte[] value, int from, int length)
Implements org. |
| public void | writeBinary(byte[]
The array from which to write the bytes. value, int The index in the array from which writing starts. from, int The number of bytes to write. length)Implements org. Write binary content as base64 encoded characters to the output. |
| public void | writeBinaryAttribute(String
The attribute's prefix. prefix, String The attribute's URI. nsURI, String The attribute's local name. localName, byte[] The array from which to write the bytes. value)Implements org. Write a byte array attribute. |
| public void | writeBinaryAttribute(Base64Variant v, String prefix, String nsURI, String localName, byte[] value)
Implements org. |
| public void | writeBoolean(boolean
The boolean value to write. b)Implements org. |
| public void | writeBooleanAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") nsURI, String The attribute's local name localName, boolean The boolean value to write. b)Implements org. |
| public void | writeCData(char[] text, int start, int len)
Implements org. |
| public void | writeDecimal(BigDecimal value)
Implements org. |
| public void | writeDecimalAttribute(String prefix, String nsURI, String localName, BigDecimal value)
Implements org. |
| public void | writeDouble(double value)
Implements org. |
| public void | writeDoubleArray(double[] value, int from, int length)
Implements org. |
| public void | writeDoubleArrayAttribute(String prefix, String nsURI, String localName, double[] value)
Implements org. |
| public void | writeDoubleAttribute(String prefix, String nsURI, String localName, double value)
Implements org. |
| public void | |
| public void | writeFloat(float value)
Implements org. |
| public void | writeFloatArray(float[] value, int from, int length)
Implements org. |
| public void | writeFloatArrayAttribute(String prefix, String nsURI, String localName, float[] value)
Implements org. |
| public void | writeFloatAttribute(String prefix, String nsURI, String localName, float value)
Implements org. |
| public void | writeFullEndElement()
Implements org. writeEndElement, but that will always
write the full end element, instead of empty element.
|
| public void | writeInt(int value)
Implements org. |
| public void | writeIntArray(int[]
The array from which to write the ints. value, int The index in the array from which writing starts. from, int The number of ints to write. length)Implements org. Write int array to the output. |
| public void | writeIntArrayAttribute(String
The attribute's prefix. prefix, String The attribute's URI. nsURI, String The attribute's local name. localName, int[] The array from which to write the ints. value)Implements org. Write int array attribute. |
| public void | writeIntAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") nsURI, String The attribute's local name localName, int The integer value to write. value)Implements org. |
| public void | writeInteger(BigInteger value)
Implements org. |
| public void | writeIntegerAttribute(String prefix, String nsURI, String localName, BigInteger value)
Implements org. |
| public void | writeLong(long value)
Implements org. |
| public void | writeLongArray(long[] value, int from, int length)
Implements org. |
| public void | writeLongArrayAttribute(String prefix, String nsURI, String localName, long[] value)
Implements org. |
| public void | writeLongAttribute(String
The attribute's prefix. Null or "" if no prefix is to be used prefix, String The attribute's URI (can be either null or empty String for "no namespace") nsURI, String The attribute's local name localName, long The long value to write. value)Implements org. |
| public void | |
| public void | writeQNameAttribute(String prefix, String nsURI, String localName, QName name)
Implements org. |
| public void | writeRaw(String text)
Implements org. |
| public void | writeRaw(String text, int offset, int len)
Implements org. |
| public void | writeRaw(char[] text, int offset, int length)
Implements org. |
| public void | writeSpace(String text)
Implements org. |
| public void | writeSpace(char[] text, int offset, int length)
Implements org. |
| public void | writeStartDocument(String version, String encoding, boolean standAlone)
Implements org. |