XmlWriter, used if
the destination is a character based, like a java.io.Writer .
| Modifier and Type | Field and Description |
|---|---|
| protected Writer | _out
Actual Writer to use for outputting buffered data as appropriate. |
| protected char[] | |
| protected final int | |
| protected int | |
| 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 | DEFAULT_SMALL_SIZE
This value determines a threshold to choose how much data do we want to buffer at minimum, before output. |
| pack-priv final XmlCharTypes | mCharTypes
Validation tables used for verifying validity (and need for quoting) |
| private final int | mEncHighChar
First Unicode character (one with lowest value) after (and including) which character entities have to be used. |
| protected final int | mSmallWriteSize
This is the threshold used to check what is considered a "small" write; small writes will be buffered until resulting size will be above the threshold. |
| private final int | mTableCheckEnd
First Unicode character that is NOT to be checked against static validity table. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public WName | |
| public WName | constructName(String prefix, String localName)
Implements abstract com. |
| private final void | |
| private final void | |
| private final void | |
| public final void | |
| private final void | |
| public int | getHighestEncodable()
Implements abstract com. |
| protected int | |
| protected int | Returns: Index at which a problem was found, if any; -1 if there's no problem.
|
| protected int | |
| protected int | |
| protected final void | |
| public 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 void | writeAttribute(WName name, char[] value, int offset, int vlen)
Implements abstract com. |
| public final void | writeAttribute(WName name, AsciiValueEncoder enc)
Implements abstract com. |
| private final void | |
| private 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. |
| private int | |
| public final void | |
| public final void | |
| public void | |
| public void | writeCharacters(char[] cbuf, int offset, int len)
Implements abstract com. |
| public int | writeComment(String data)
Implements abstract com. |
| private int | writeCommentContents(char[] cbuf, int offset, int len, boolean last)
Note the only way to fix comment contents is to inject a space to split up consequtive '--' (or '-' that ends a comment). |
| public final void | |
| public final void | |
| public void | writeDTD(String data)
Implements abstract com. |
| public void | |
| public void | |
| public void | writeEntityReference(WName name)
Implements abstract com. |
| protected final void | |
| public int | |
| private int | |
| public void | writeRaw(char[] cbuf, int offset, int len)
Implements abstract com. |
| public void | writeRaw(String str, int offset, int len)
Implements abstract com. |
| protected void | |
| protected void | |
| protected void | |
| public void | |
| public void | writeSpace(char[] cbuf, int offset, int len)
Implements abstract com. |
| private final void | |
| public void | |
| public void | |
| public 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. |
| _out | back to summary |
|---|---|
| protected Writer _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 char[] _outputBuffer | |
| _outputBufferLen | back to summary |
|---|---|
| protected final int _outputBufferLen | |
| _outputPtr | back to summary |
|---|---|
| protected int _outputPtr | |
| 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. | |
| DEFAULT_SMALL_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_SMALL_SIZE This value determines a threshold to choose how much data do we want to buffer at minimum, before output. This is done since actual underlying writer may have significant per-call overhead, and if so, it is much cheaper to coalesce content. But on the other hand, this extra buffering has overhead of its own, so we'll try to find a sweet spot. | |
| mCharTypes | back to summary |
|---|---|
| pack-priv final XmlCharTypes mCharTypes Validation tables used for verifying validity (and need for quoting) | |
| mEncHighChar | back to summary |
|---|---|
| private final int mEncHighChar First Unicode character (one with lowest value) after (and including) which character entities have to be used. | |
| mSmallWriteSize | back to summary |
|---|---|
| protected final int mSmallWriteSize This is the threshold used to check what is considered a "small" write; small writes will be buffered until resulting size will be above the threshold. | |
| mTableCheckEnd | back to summary |
|---|---|
| private final int mTableCheckEnd First Unicode character that is NOT to be checked against static validity table. Usually the size of check table, but lower for some encodings (like ascii) | |
| CharXmlWriter | back to summary |
|---|---|
| public CharXmlWriter(WriterConfig cfg, Writer out) | |
| _closeTarget | back to summary |
|---|---|
| public void _closeTarget(boolean doClose) throws IOException Implements abstract com.
| |
| _releaseBuffers | back to summary |
|---|---|
| public void _releaseBuffers() Overrides com.
| |
| constructName | back to summary |
|---|---|
| public WName constructName(String localName) Implements abstract com.
| |
| constructName | back to summary |
|---|---|
| public WName constructName(String prefix, String localName) Implements abstract com.
| |
| fastWriteRaw | back to summary |
|---|---|
| private final void fastWriteRaw(char c) throws IOException | |
| fastWriteRaw | back to summary |
|---|---|
| private final void fastWriteRaw(char c1, char c2) throws IOException | |
| fastWriteRaw | back to summary |
|---|---|
| private final void fastWriteRaw(String str) throws IOException | |
| flush | back to summary |
|---|---|
| public final void flush() throws IOException Implements abstract com.
| |
| flushBuffer | back to summary |
|---|---|
| private final void flushBuffer() throws IOException | |
| getHighestEncodable | back to summary |
|---|---|
| public int getHighestEncodable() Implements abstract com. Doc from com. Method called by error reporting code, to figure out if a given character is encodable (without using character entities) with the current encoding or not.
| |
| getOutputPtr | back to summary |
|---|---|
| protected int getOutputPtr() Implements abstract com.
| |
| verifyCDataContent | back to summary |
|---|---|
protected int verifyCDataContent(String content)
| |
| verifyCDataContent | back to summary |
|---|---|
| protected int verifyCDataContent(char[] c, int start, int end) | |
| verifyCommentContent | back to summary |
|---|---|
| protected int verifyCommentContent(String content) | |
| writeAsEntity | back to summary |
|---|---|
| protected final void writeAsEntity(int c) throws IOException | |
| writeAttribute | back to summary |
|---|---|
| public 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 void writeAttribute(WName name, char[] value, 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.
| |
| writeAttrValue | back to summary |
|---|---|
| private final void writeAttrValue(String value, int len) throws IOException, XMLStreamException | |
| writeAttrValue | back to summary |
|---|---|
| private final void writeAttrValue(char[] cbuf, 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 |
|---|---|
| private int writeCDataContents(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeCDataEnd | back to summary |
|---|---|
| public final void writeCDataEnd() throws IOException | |
| writeCDataStart | back to summary |
|---|---|
| public final void writeCDataStart() throws IOException | |
| writeCharacters | back to summary |
|---|---|
| public void writeCharacters(String text) throws IOException, XMLStreamException Implements abstract com.
| |
| writeCharacters | back to summary |
|---|---|
| public 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 |
|---|---|
| private int writeCommentContents(char[] cbuf, int offset, int len, boolean last) 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 |
|---|---|
| public final void writeCommentEnd() throws IOException | |
| writeCommentStart | back to summary |
|---|---|
| public 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 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.
| |
| writeName | back to summary |
|---|---|
| protected final void writeName(WName name) throws IOException | |
| writePI | back to summary |
|---|---|
| public int writePI(WName target, String data) throws IOException, XMLStreamException Implements abstract com.
| |
| writePIContents | back to summary |
|---|---|
| private int writePIContents(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(char[] cbuf, int offset, int len) throws IOException Implements abstract com.
| |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String str, int offset, int len) throws IOException Implements abstract com.
| |
| writeSegmentedCData | back to summary |
|---|---|
| protected void writeSegmentedCData(String content, int index) throws IOException | |
| writeSegmentedCData | back to summary |
|---|---|
| protected void writeSegmentedCData(char[] c, int start, int len, int index) throws IOException | |
| writeSegmentedComment | back to summary |
|---|---|
| protected void writeSegmentedComment(String content, int index) throws IOException | |
| writeSpace | back to summary |
|---|---|
| public 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.
| |
| writeSplitAttrValue | back to summary |
|---|---|
| private final void writeSplitAttrValue(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeStartTagEmptyEnd | back to summary |
|---|---|
| public void writeStartTagEmptyEnd() throws IOException Implements abstract com.
| |
| writeStartTagEnd | back to summary |
|---|---|
| public void writeStartTagEnd() throws IOException, XMLStreamException Implements abstract com.
| |
| writeStartTagStart | back to summary |
|---|---|
| public 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.
| |