XmlWriter)
is used if the destination is byte-based java.io.OutputStream .
Further, all existing implementations are for encodings that are 7-bit ascii compatible. This is important since this means that marker and separator characters are identical independent of actual encoding. This would not hold if support for encodings like EBCDIC were supported using this class.
| Modifier and Type | Field and Description |
|---|---|
| protected final XmlCharTypes | _charTypes
Validation tables used for verifying validity (and need for quoting) |
| protected OutputStream | _out
Actual Writer to use for outputting buffered data as appropriate. |
| protected byte[] | |
| protected final int | |
| protected int | |
| protected int | _surrogate
In case a split surrogate pair is output (which can occur for only some of the methods, possibly depending on encoding), the first part is temporarily stored within this member variable. |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final int | DEFAULT_COPY_BUFFER_SIZE
Default intermediate copy buffer size, to be used for efficient access to String content. |
| pack-priv static final int | DEFAULT_FULL_BUFFER_SIZE
And this value determines size of the intermediate copy buffer to use. |
| pack-priv static final int | SMALL_WRITE
Let's try avoid short writes, since some output streams have high per-call penalty (like network streams). |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| protected final int | |
| public final WName | |
| public WName | constructName(String prefix, String localName)
Implements abstract com. |
| protected abstract WName | |
| protected abstract WName | |
| protected final int | fastWriteAttrValue(char[] vbuf, int offset, int len, byte[] bbuf, int ptr)
Method called to copy given attribute value, when it's known that it will completely fit in the output buffer without further checks |
| public final void | |
| protected final void | |
| protected static final byte[] | |
| protected static final void | |
| protected static final void | |
| protected final int | |
| private final void | |
| protected abstract void | |
| protected abstract int | outputMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen)
Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above); possibly using character entities, if necessary |
| protected abstract int | outputStrictMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen)
Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above), without being able to use character entities |
| protected abstract void | outputSurrogates(int surr1, int surr2)
Method called to output a composite character, result of combining 2 surrogate characters. |
| protected final void | |
| protected final void | |
| protected void | verifyNameComponent(String part)
Method used to verify that a name component (prefix, local name) is a legal as per xml 1.0 specification. |
| protected final void | |
| public final void | writeAttribute(WName name, String value)
Implements abstract com. Note can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations) |
| public final void | writeAttribute(WName name, char[] vbuf, int offset, int vlen)
Implements abstract com. |
| public final void | writeAttribute(WName name, AsciiValueEncoder enc)
Implements abstract com. |
| private final void | |
| protected final void | |
| public int | Returns: -1 to indicate succesful write, or index of the problematic character in input (first ']' from "]]>" sequence, in non-fixing mode)Contents of the CDATA section to write out data)Implements abstract com. |
| public int | writeCData(char[] cbuf, int offset, int len)
Implements abstract com. |
| protected int | |
| protected final void | |
| protected final void | |
| public final void | |
| public final void | writeCharacters(char[] cbuf, int offset, int len)
Implements abstract com. |
| public int | writeComment(String data)
Implements abstract com. |
| protected int | writeCommentContents(char[] cbuf, int offset, int len)
Note the only way to fix comment contents is to inject a space to split up consequtive '--' (or '-' that ends a comment). |
| protected final void | |
| protected final void | |
| public void | writeDTD(String data)
Implements abstract com. |
| public void | |
| public final void | |
| public void | writeEntityReference(WName name)
Implements abstract com. |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | |
| public int | |
| protected int | |
| public final void | writeRaw(String text, int offset, int len)
Implements abstract com. |
| public abstract void | writeRaw(char[] cbuf, int offset, int len)
Implements abstract com. |
| protected final void | |
| protected final void | |
| protected final void | |
| protected final void | |
| public final void | |
| public void | writeSpace(char[] cbuf, int offset, int len)
Implements abstract com. |
| private final void | writeSplitCharacters(char[] cbuf, int offset, int len)
This method is called when it is possible that the output may cross the output buffer boundary. |
| public void | |
| public final void | |
| public final void | writeStartTagStart(WName name)
Implements abstract com. Note can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations) |
| public void | writeTypedValue(AsciiValueEncoder enc)
Implements abstract com. |
| public void | writeXmlDeclaration(String version, String encoding, String standalone)
Implements abstract com. |
| _charTypes | back to summary |
|---|---|
| protected final XmlCharTypes _charTypes Validation tables used for verifying validity (and need for quoting) | |
| _out | back to summary |
|---|---|
| protected OutputStream _out Actual Writer to use for outputting buffered data as appropriate. During active usage, remains as the writer initially set; set to null when this writer is closed. | |
| _outputBuffer | back to summary |
|---|---|
| protected byte[] _outputBuffer | |
| _outputBufferLen | back to summary |
|---|---|
| protected final int _outputBufferLen | |
| _outputPtr | back to summary |
|---|---|
| protected int _outputPtr | |
| _surrogate | back to summary |
|---|---|
| protected int _surrogate In case a split surrogate pair is output (which can occur for only some of the methods, possibly depending on encoding), the first part is temporarily stored within this member variable. | |
| BYTE_A | back to summary |
|---|---|
| pack-priv static final byte BYTE_A | |
| BYTE_AMP | back to summary |
|---|---|
| pack-priv static final byte BYTE_AMP | |
| BYTE_APOS | back to summary |
|---|---|
| pack-priv static final byte BYTE_APOS | |
| BYTE_COLON | back to summary |
|---|---|
| pack-priv static final byte BYTE_COLON | |
| BYTE_EQ | back to summary |
|---|---|
| pack-priv static final byte BYTE_EQ | |
| BYTE_G | back to summary |
|---|---|
| pack-priv static final byte BYTE_G | |
| BYTE_GT | back to summary |
|---|---|
| pack-priv static final byte BYTE_GT | |
| BYTE_HASH | back to summary |
|---|---|
| pack-priv static final byte BYTE_HASH | |
| BYTE_HYPHEN | back to summary |
|---|---|
| pack-priv static final byte BYTE_HYPHEN | |
| BYTE_L | back to summary |
|---|---|
| pack-priv static final byte BYTE_L | |
| BYTE_LBRACKET | back to summary |
|---|---|
| pack-priv static final byte BYTE_LBRACKET | |
| BYTE_LT | back to summary |
|---|---|
| pack-priv static final byte BYTE_LT | |
| BYTE_M | back to summary |
|---|---|
| pack-priv static final byte BYTE_M | |
| BYTE_O | back to summary |
|---|---|
| pack-priv static final byte BYTE_O | |
| BYTE_P | back to summary |
|---|---|
| pack-priv static final byte BYTE_P | |
| BYTE_Q | back to summary |
|---|---|
| pack-priv static final byte BYTE_Q | |
| BYTE_QMARK | back to summary |
|---|---|
| pack-priv static final byte BYTE_QMARK | |
| BYTE_QUOT | back to summary |
|---|---|
| pack-priv static final byte BYTE_QUOT | |
| BYTE_RBRACKET | back to summary |
|---|---|
| pack-priv static final byte BYTE_RBRACKET | |
| BYTE_S | back to summary |
|---|---|
| pack-priv static final byte BYTE_S | |
| BYTE_SEMICOLON | back to summary |
|---|---|
| pack-priv static final byte BYTE_SEMICOLON | |
| BYTE_SLASH | back to summary |
|---|---|
| pack-priv static final byte BYTE_SLASH | |
| BYTE_SPACE | back to summary |
|---|---|
| pack-priv static final byte BYTE_SPACE | |
| BYTE_T | back to summary |
|---|---|
| pack-priv static final byte BYTE_T | |
| BYTE_U | back to summary |
|---|---|
| pack-priv static final byte BYTE_U | |
| BYTE_X | back to summary |
|---|---|
| pack-priv static final byte BYTE_X | |
| BYTES_CDATA_END | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_CDATA_END | |
| BYTES_CDATA_START | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_CDATA_START | |
| BYTES_COMMENT_END | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_COMMENT_END | |
| BYTES_COMMENT_START | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_COMMENT_START | |
| BYTES_XMLDECL_ENCODING | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_XMLDECL_ENCODING | |
| BYTES_XMLDECL_STANDALONE | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_XMLDECL_STANDALONE | |
| BYTES_XMLDECL_START | back to summary |
|---|---|
| pack-priv static final byte[] BYTES_XMLDECL_START | |
| DEFAULT_COPY_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_COPY_BUFFER_SIZE Default intermediate copy buffer size, to be used for efficient access to String content. Smaller, since it's in characters, plus will not be used for actual write operations | |
| DEFAULT_FULL_BUFFER_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_FULL_BUFFER_SIZE And this value determines size of the intermediate copy buffer to use. | |
| SMALL_WRITE | back to summary |
|---|---|
| pack-priv static final int SMALL_WRITE Let's try avoid short writes, since some output streams have high per-call penalty (like network streams). | |
| ByteXmlWriter | back to summary |
|---|---|
| protected ByteXmlWriter(WriterConfig cfg, OutputStream out, XmlCharTypes charTypes) | |
| _closeTarget | back to summary |
|---|---|
| public void _closeTarget(boolean doClose) throws IOException Implements abstract com.
| |
| _releaseBuffers | back to summary |
|---|---|
| public void _releaseBuffers() Overrides com.
| |
| calcSurrogate | back to summary |
|---|---|
| protected final int calcSurrogate(int surr1, int surr2, String context) throws XMLStreamException | |
| constructName | back to summary |
|---|---|
| public final WName constructName(String localName) throws XMLStreamException Implements abstract com.
| |
| constructName | back to summary |
|---|---|
| public WName constructName(String prefix, String localName) throws XMLStreamException Implements abstract com.
| |
| doConstructName | back to summary |
|---|---|
| protected abstract WName doConstructName(String localName) throws XMLStreamException | |
| doConstructName | back to summary |
|---|---|
| protected abstract WName doConstructName(String prefix, String localName) throws XMLStreamException | |
| fastWriteAttrValue | back to summary |
|---|---|
| protected final int fastWriteAttrValue(char[] vbuf, int offset, int len, byte[] bbuf, int ptr) throws IOException, XMLStreamException Method called to copy given attribute value, when it's known that it will completely fit in the output buffer without further checks | |
| flush | back to summary |
|---|---|
| public final void flush() throws IOException Implements abstract com.
| |
| flushBuffer | back to summary |
|---|---|
| protected final void flushBuffer() throws IOException | |
| getAscii | back to summary |
|---|---|
| protected static final byte[] getAscii(String str) | |
| getAscii | back to summary |
|---|---|
| protected static final void getAscii(String str, byte[] result) | |
| getAscii | back to summary |
|---|---|
| protected static final void getAscii(String str, byte[] result, int offset) | |
| getOutputPtr | back to summary |
|---|---|
| protected final int getOutputPtr() Implements abstract com.
| |
| longWriteCharacters | back to summary |
|---|---|
| private final void longWriteCharacters(String text) throws IOException, XMLStreamException | |
| output2ByteChar | back to summary |
|---|---|
| protected abstract void output2ByteChar(int ch) throws IOException, XMLStreamException | |
| outputMultiByteChar | back to summary |
|---|---|
| protected abstract int outputMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen) throws IOException, XMLStreamException Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above); possibly using character entities, if necessary | |
| outputStrictMultiByteChar | back to summary |
|---|---|
| protected abstract int outputStrictMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen) throws IOException, XMLStreamException Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above), without being able to use character entities | |
| outputSurrogates | back to summary |
|---|---|
| protected abstract void outputSurrogates(int surr1, int surr2) throws IOException, XMLStreamException Method called to output a composite character, result of combining 2 surrogate characters. | |
| throwUnpairedSurrogate | back to summary |
|---|---|
| protected final void throwUnpairedSurrogate() throws IOException | |
| throwUnpairedSurrogate | back to summary |
|---|---|
| protected final void throwUnpairedSurrogate(int code) throws IOException | |
| verifyNameComponent | back to summary |
|---|---|
| protected void verifyNameComponent(String part) throws XMLStreamException Method used to verify that a name component (prefix, local name) is a legal as per xml 1.0 specification.
| |
| writeAsEntity | back to summary |
|---|---|
| protected final void writeAsEntity(int c) throws IOException | |
| writeAttribute | back to summary |
|---|---|
| public final void writeAttribute(WName name, String value) throws IOException, XMLStreamException Implements abstract com. Doc from com. Note can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)
| |
| writeAttribute | back to summary |
|---|---|
| public final void writeAttribute(WName name, char[] vbuf, int offset, int vlen) throws IOException, XMLStreamException Implements abstract com.
| |
| writeAttribute | back to summary |
|---|---|
| public final void writeAttribute(WName name, AsciiValueEncoder enc) throws IOException, XMLStreamException Implements abstract com.
| |
| writeAttrNameEqQ | back to summary |
|---|---|
| private final void writeAttrNameEqQ(WName name) throws IOException, XMLStreamException | |
| writeAttrValue | back to summary |
|---|---|
| protected final void writeAttrValue(char[] vbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeCData | back to summary |
|---|---|
| public int writeCData(String data) throws IOException, XMLStreamException Implements abstract com.
| |
| writeCData | back to summary |
|---|---|
| public int writeCData(char[] cbuf, int offset, int len) throws IOException, XMLStreamException Implements abstract com.
| |
| writeCDataContents | back to summary |
|---|---|
| protected int writeCDataContents(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeCDataEnd | back to summary |
|---|---|
| protected final void writeCDataEnd() throws IOException | |
| writeCDataStart | back to summary |
|---|---|
| protected final void writeCDataStart() throws IOException | |
| writeCharacters | back to summary |
|---|---|
| public final void writeCharacters(String text) throws IOException, XMLStreamException Implements abstract com.
| |
| writeCharacters | back to summary |
|---|---|
| public final void writeCharacters(char[] cbuf, int offset, int len) throws IOException, XMLStreamException Implements abstract com.
| |
| writeComment | back to summary |
|---|---|
| public int writeComment(String data) throws IOException, XMLStreamException Implements abstract com. Method that will try to output the content as specified. If the content passed in has embedded "--" in it, it will either add an intervening space between consequtive hyphens (if content fixing is enabled), or return the offset of the first hyphen in multi-hyphen sequence.
| |
| writeCommentContents | back to summary |
|---|---|
| protected int writeCommentContents(char[] cbuf, int offset, int len) throws IOException, XMLStreamException Note the only way to fix comment contents is to inject a space to split up consequtive '--' (or '-' that ends a comment). | |
| writeCommentEnd | back to summary |
|---|---|
| protected final void writeCommentEnd() throws IOException | |
| writeCommentStart | back to summary |
|---|---|
| protected final void writeCommentStart() throws IOException | |
| writeDTD | back to summary |
|---|---|
| public void writeDTD(String data) throws IOException, XMLStreamException Implements abstract com. Doc from com. Older "legacy" output method for outputting DOCTYPE declaration. Assumes that the passed-in String contains a complete DOCTYPE declaration properly quoted.
| |
| writeDTD | back to summary |
|---|---|
| public void writeDTD(WName rootName, String systemId, String publicId, String internalSubset) throws IOException, XMLStreamException Implements abstract com.
| |
| writeEndTag | back to summary |
|---|---|
| public final void writeEndTag(WName name) throws IOException, XMLStreamException Implements abstract com.
| |
| writeEntityReference | back to summary |
|---|---|
| public void writeEntityReference(WName name) throws IOException, XMLStreamException Implements abstract com.
| |
| writeLongAttribute | back to summary |
|---|---|
| protected final void writeLongAttribute(WName name, String value, int vlen) throws IOException, XMLStreamException | |
| writeName | back to summary |
|---|---|
| protected final void writeName(WName name) throws IOException | |
| writeName | back to summary |
|---|---|
| protected final void writeName(byte preChar, WName name) throws IOException | |
| writeName | back to summary |
|---|---|
| protected final void writeName(WName name, byte postChar) throws IOException | |
| writePI | back to summary |
|---|---|
| public int writePI(WName target, String data) throws IOException, XMLStreamException Implements abstract com.
| |
| writePIData | back to summary |
|---|---|
| protected int writePIData(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeRaw | back to summary |
|---|---|
| public final void writeRaw(String text, int offset, int len) throws IOException, XMLStreamException Implements abstract com.
| |
| writeRaw | back to summary |
|---|---|
| public abstract void writeRaw(char[] cbuf, int offset, int len) throws IOException, XMLStreamException Implements abstract com. This method is heavily encoding-dependant, so it needs to be deferred to sub-classes
| |
| writeRaw | back to summary |
|---|---|
| protected final void writeRaw(byte b) throws IOException | |
| writeRaw | back to summary |
|---|---|
| protected final void writeRaw(byte b1, byte b2) throws IOException | |
| writeRaw | back to summary |
|---|---|
| protected final void writeRaw(byte[] buf) throws IOException | |
| writeRaw | back to summary |
|---|---|
| protected final void writeRaw(byte[] buf, int offset, int len) throws IOException | |
| writeSpace | back to summary |
|---|---|
| public final void writeSpace(String data) throws IOException, XMLStreamException Implements abstract com.
| |
| writeSpace | back to summary |
|---|---|
| public void writeSpace(char[] cbuf, int offset, int len) throws IOException, XMLStreamException Implements abstract com.
| |
| writeSplitCharacters | back to summary |
|---|---|
| private final void writeSplitCharacters(char[] cbuf, int offset, int len) throws IOException, XMLStreamException This method is called when it is possible that the output may cross the output buffer boundary. Because of this, code has to add more boundary checks. | |
| writeStartTagEmptyEnd | back to summary |
|---|---|
| public void writeStartTagEmptyEnd() throws IOException Implements abstract com.
| |
| writeStartTagEnd | back to summary |
|---|---|
| public final void writeStartTagEnd() throws IOException, XMLStreamException Implements abstract com.
| |
| writeStartTagStart | back to summary |
|---|---|
| public final void writeStartTagStart(WName name) throws IOException, XMLStreamException Implements abstract com. Doc from com. Note can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)
| |
| writeTypedValue | back to summary |
|---|---|
| public void writeTypedValue(AsciiValueEncoder enc) throws IOException, XMLStreamException Implements abstract com.
| |
| writeXmlDeclaration | back to summary |
|---|---|
| public void writeXmlDeclaration(String version, String encoding, String standalone) throws IOException, XMLStreamException Implements abstract com.
| |