| Modifier and Type | Field and Description |
|---|---|
protected java.io.Writer |
_out
Actual Writer to use for outputting buffered data as appropriate.
|
protected char[] |
_outputBuffer |
protected int |
_outputBufferLen |
protected int |
_outputPtr |
(package private) static int |
DEFAULT_FULL_BUFFER_SIZE
And this value determines size of the intermediate copy buffer
to use.
|
(package private) static int |
DEFAULT_SMALL_SIZE
This value determines a threshold to choose how much data do
we want to buffer at minimum, before output.
|
(package private) XmlCharTypes |
mCharTypes
Validation tables used for verifying validity (and need for quoting)
|
private int |
mEncHighChar
First Unicode character (one with lowest value) after (and including)
which character entities have to be used.
|
protected 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 int |
mTableCheckEnd
First Unicode character that is NOT to be checked against static
validity table.
|
_cfgNsAware, _checkContent, _checkNames, _config, _copyBuffer, _copyBufferLen, _locPastChars, _locRowNr, _locRowStartOffset, _xml11, ATTR_MIN_ARRAYCOPY, DEFAULT_COPYBUFFER_LEN, MIN_ARRAYCOPY, SURR1_FIRST, SURR1_LAST, SURR2_FIRST, SURR2_LAST| Constructor and Description |
|---|
CharXmlWriter(WriterConfig cfg,
java.io.Writer out) |
| Modifier and Type | Method and Description |
|---|---|
void |
_closeTarget(boolean doClose) |
void |
_releaseBuffers() |
WName |
constructName(java.lang.String localName) |
WName |
constructName(java.lang.String prefix,
java.lang.String localName) |
private void |
fastWriteRaw(char c) |
private void |
fastWriteRaw(char c1,
char c2) |
private void |
fastWriteRaw(java.lang.String str) |
void |
flush() |
private void |
flushBuffer() |
int |
getHighestEncodable()
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.
|
protected int |
getOutputPtr() |
protected int |
verifyCDataContent(char[] c,
int start,
int end) |
protected int |
verifyCDataContent(java.lang.String content) |
protected int |
verifyCommentContent(java.lang.String content) |
protected void |
writeAsEntity(int c) |
void |
writeAttribute(WName name,
org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) |
void |
writeAttribute(WName name,
char[] value,
int offset,
int vlen) |
void |
writeAttribute(WName name,
java.lang.String value)
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)
|
private void |
writeAttrValue(char[] cbuf,
int offset,
int len) |
private void |
writeAttrValue(java.lang.String value,
int len) |
int |
writeCData(char[] cbuf,
int offset,
int len) |
int |
writeCData(java.lang.String data) |
private int |
writeCDataContents(char[] cbuf,
int offset,
int len) |
void |
writeCDataEnd() |
void |
writeCDataStart() |
void |
writeCharacters(char[] cbuf,
int offset,
int len) |
void |
writeCharacters(java.lang.String text) |
int |
writeComment(java.lang.String data)
Method that will try to output the content as specified.
|
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).
|
void |
writeCommentEnd() |
void |
writeCommentStart() |
void |
writeDTD(java.lang.String data)
Older "legacy" output method for outputting DOCTYPE declaration.
|
void |
writeDTD(WName rootName,
java.lang.String systemId,
java.lang.String publicId,
java.lang.String internalSubset) |
void |
writeEndTag(WName name) |
void |
writeEntityReference(WName name) |
protected void |
writeName(WName name) |
int |
writePI(WName target,
java.lang.String data) |
private int |
writePIContents(char[] cbuf,
int offset,
int len) |
void |
writeRaw(char[] cbuf,
int offset,
int len) |
void |
writeRaw(java.lang.String str,
int offset,
int len) |
protected void |
writeSegmentedCData(char[] c,
int start,
int len,
int index) |
protected void |
writeSegmentedCData(java.lang.String content,
int index) |
protected void |
writeSegmentedComment(java.lang.String content,
int index) |
void |
writeSpace(char[] cbuf,
int offset,
int len) |
void |
writeSpace(java.lang.String data) |
private void |
writeSplitAttrValue(char[] cbuf,
int offset,
int len) |
void |
writeStartTagEmptyEnd() |
void |
writeStartTagEnd() |
void |
writeStartTagStart(WName name)
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)
|
void |
writeTypedValue(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) |
void |
writeXmlDeclaration(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone) |
close, enableXml11, getAbsOffset, getColumn, getRow, guessEncodingBitSize, reportFailedEscaping, reportInvalidChar, reportInvalidEmptyName, reportNwfContent, reportNwfContent, reportNwfName, reportNwfName, throwOutputError, throwOutputErrorstatic final int DEFAULT_SMALL_SIZE
static final int DEFAULT_FULL_BUFFER_SIZE
protected final int mSmallWriteSize
protected java.io.Writer _out
protected char[] _outputBuffer
protected int _outputPtr
protected final int _outputBufferLen
private final int mEncHighChar
private final int mTableCheckEnd
final XmlCharTypes mCharTypes
public CharXmlWriter(WriterConfig cfg, java.io.Writer out)
protected int getOutputPtr()
getOutputPtr in class XmlWriterpublic int getHighestEncodable()
XmlWritergetHighestEncodable in class XmlWriterpublic WName constructName(java.lang.String localName)
constructName in class XmlWriterpublic WName constructName(java.lang.String prefix, java.lang.String localName)
constructName in class XmlWriterpublic void _releaseBuffers()
_releaseBuffers in class XmlWriterpublic void _closeTarget(boolean doClose)
throws java.io.IOException
_closeTarget in class XmlWriterjava.io.IOExceptionpublic final void flush()
throws java.io.IOException
public void writeRaw(char[] cbuf,
int offset,
int len)
throws java.io.IOException
public void writeRaw(java.lang.String str,
int offset,
int len)
throws java.io.IOException
public final void writeCDataStart()
throws java.io.IOException
java.io.IOExceptionpublic final void writeCDataEnd()
throws java.io.IOException
java.io.IOExceptionpublic final void writeCommentStart()
throws java.io.IOException
java.io.IOExceptionpublic final void writeCommentEnd()
throws java.io.IOException
java.io.IOExceptionpublic int writeCData(java.lang.String data)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeCData in class XmlWriterdata - Contents of the CDATA section to write outjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic int writeCData(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeCData in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate int writeCDataContents(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeCharacters(java.lang.String text)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeCharacters in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeCharacters(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeCharacters in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeSpace(java.lang.String data)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeSpace in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeSpace(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeSpace in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic int writeComment(java.lang.String data)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeComment in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate int writeCommentContents(char[] cbuf,
int offset,
int len,
boolean last)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeDTD(java.lang.String data)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
XmlWriterpublic void writeDTD(WName rootName, java.lang.String systemId, java.lang.String publicId, java.lang.String internalSubset) throws java.io.IOException, javax.xml.stream.XMLStreamException
public void writeEntityReference(WName name) throws java.io.IOException, javax.xml.stream.XMLStreamException
writeEntityReference in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeXmlDeclaration(java.lang.String version,
java.lang.String encoding,
java.lang.String standalone)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeXmlDeclaration in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic int writePI(WName target, java.lang.String data) throws java.io.IOException, javax.xml.stream.XMLStreamException
private int writePIContents(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeStartTagStart(WName name) throws java.io.IOException, javax.xml.stream.XMLStreamException
XmlWriterNote: 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)
writeStartTagStart in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeStartTagEnd()
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeStartTagEnd in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeStartTagEmptyEnd()
throws java.io.IOException
writeStartTagEmptyEnd in class XmlWriterjava.io.IOExceptionpublic void writeEndTag(WName name) throws java.io.IOException, javax.xml.stream.XMLStreamException
writeEndTag in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeAttribute(WName name, java.lang.String value) throws java.io.IOException, javax.xml.stream.XMLStreamException
XmlWriterNote: 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 in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeAttribute(WName name, char[] value, int offset, int vlen) throws java.io.IOException, javax.xml.stream.XMLStreamException
writeAttribute in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate final void writeAttrValue(java.lang.String value,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate final void writeAttrValue(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate final void writeSplitAttrValue(char[] cbuf,
int offset,
int len)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic void writeTypedValue(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
writeTypedValue in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionpublic final void writeAttribute(WName name, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws java.io.IOException, javax.xml.stream.XMLStreamException
writeAttribute in class XmlWriterjava.io.IOExceptionjavax.xml.stream.XMLStreamExceptionprivate final void flushBuffer()
throws java.io.IOException
java.io.IOExceptionprotected final void writeName(WName name) throws java.io.IOException
java.io.IOExceptionprivate final void fastWriteRaw(char c)
throws java.io.IOException
java.io.IOExceptionprivate final void fastWriteRaw(char c1,
char c2)
throws java.io.IOException
java.io.IOExceptionprivate final void fastWriteRaw(java.lang.String str)
throws java.io.IOException
java.io.IOExceptionprotected int verifyCDataContent(java.lang.String content)
protected int verifyCDataContent(char[] c,
int start,
int end)
protected int verifyCommentContent(java.lang.String content)
protected void writeSegmentedCData(java.lang.String content,
int index)
throws java.io.IOException
java.io.IOExceptionprotected void writeSegmentedCData(char[] c,
int start,
int len,
int index)
throws java.io.IOException
java.io.IOExceptionprotected void writeSegmentedComment(java.lang.String content,
int index)
throws java.io.IOException
java.io.IOExceptionprotected final void writeAsEntity(int c)
throws java.io.IOException
java.io.IOException