Note that implementations can have different operating modes:
specifically, when dealing with illegal content (such as "--"
in a comment, "?>" in processing instruction, or "]]>" within
CDATA section), implementations can do one of 3 things:
| Modifier and Type | Field and Description |
|---|---|
| protected static final char | |
| pack-priv final boolean | mAddSpaceAfterEmptyElem
Whether to add a space after empty element (before closing "/>") or not. |
| protected Writer | mAttrValueWriter
Optional escaping writer used for escaping characters like '"' '&' and '<' in attribute values. |
| protected final boolean | mAutoCloseOutput
Flag that defines whether close() on this writer should call close on the underlying output object (stream, writer) |
| protected final boolean | |
| protected final boolean | |
| protected final boolean | |
| protected final WriterConfig | |
| protected final String | |
| pack-priv final boolean | mEscapeCR
Whether to escape CR (\r) character. |
| protected final boolean | |
| protected int | mLocPastChars
Number of characters output prior to currently buffered output |
| protected int | |
| protected int | mLocRowStartOffset
Offset of the first character on this line. |
| protected final boolean | |
| protected XmlWriterWrapper | mRawWrapper
Lazy-constructed wrapper object, which will route all calls to
Writer API, to matching |
| protected XmlWriterWrapper | mTextWrapper
Lazy-constructed wrapper object, which will route all calls to
Writer API, to matching |
| protected Writer | mTextWriter
Optional escaping writer used for escaping characters like '<' '&' and '>' in textual content. |
| pack-priv final boolean | mUseDoubleQuotesInXmlDecl
Whether to use double quotes in XML declaration or not. |
| protected boolean | mXml11
Indicates whether output is to be compliant; if false, is to be xml 1.0 compliant, if true, xml 1.1 compliant. |
| protected static final int | |
| protected static final int | |
| protected static final int | |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | close(boolean forceRealClose)
Method called to flush the buffer(s), and close the output sink (stream or writer) if enabled (auto-closing) or forced. |
| public void | |
| public abstract void | |
| public int | |
| public int | |
| protected abstract int | |
| protected abstract OutputStream | Returns: Underlying OutputStream used for physical output, if the writer was constructed using one
|
| public int | |
| protected abstract Writer | Returns: Underlying Writer used for physical output, if the writer was constructed with one, or one was created to be used with an OutputStream.
|
| protected char | handleInvalidChar(int c)
Method called to handle invalid character in textual content requested to be output. |
| protected void | |
| protected void | reportNwfName(String msg)
This is the method called when an output method call violates
name well-formedness checks
and |
| protected void | |
| protected void | |
| public final void | verifyNameValidity(String name, boolean checkNs)
Method called to verify that the name is a legal XML name. |
| public final Writer | wrapAsRawWriter()
Method that can be called to get a wrapper instance that
can be used to essentially call the |
| public final Writer | |
| public abstract void | writeAttribute(String localName, 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) |
| public abstract void | |
| public abstract void | writeAttribute(String prefix, String localName, 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) |
| public abstract void | |
| public abstract int | Returns: offset of the (first) illegal content segment ("]]>") in passed content and not in repairing mode; or -1 if none or is repairingContents of the CDATA section to write out data)
|
| public abstract int | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract int | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public abstract int | |
| public abstract void | |
| public abstract void | |
| public abstract void | |
| public void | |
| public abstract void | |
| public abstract void | writeRawAscii(char[] cbuf, int offset, int len)
Like |
| public abstract void | |
| public abstract void | |
| public abstract void | writeStartTagStart(String localName)
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 abstract void | writeStartTagStart(String prefix, String localName)
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 abstract void | writeTypedAttribute(String localName, AsciiValueEncoder enc)
Method similar to |
| public abstract void | writeTypedAttribute(String prefix, String localName, AsciiValueEncoder enc)
Method similar to |
| public abstract void | writeTypedAttribute(String prefix, String localName, String nsURI, AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer)
Method similar to |
| public abstract void | writeTypedElement(AsciiValueEncoder
Encoder that will produce content enc)Like |
| public abstract void | writeTypedElement(AsciiValueEncoder
Encoder that will produce content enc, XMLValidator Validator to use for validating serialized textual
content (can not be null) validator, char[] Temporary buffer that writer can use for temporary
copies as necessary copyBuffer)Like |
| public abstract void |
| DEFAULT_QUOTE_CHAR | back to summary |
|---|---|
| protected static final char DEFAULT_QUOTE_CHAR | |
| mAddSpaceAfterEmptyElem | back to summary |
|---|---|
| pack-priv final boolean mAddSpaceAfterEmptyElem Whether to add a space after empty element (before closing "/>") or not. | |
| mAttrValueWriter | back to summary |
|---|---|
| protected Writer mAttrValueWriter Optional escaping writer used for escaping characters like '"' '&' and '<' in attribute values. Constructed if calling code has installed a special escaping writer factory for text content. Null if the default escaper is to be used. | |
| mAutoCloseOutput | back to summary |
|---|---|
| protected final boolean mAutoCloseOutput Flag that defines whether close() on this writer should call close on the underlying output object (stream, writer) | |
| mCheckContent | back to summary |
|---|---|
| protected final boolean mCheckContent | |
| mCheckNames | back to summary |
|---|---|
| protected final boolean mCheckNames | |
| mCheckStructure | back to summary |
|---|---|
| protected final boolean mCheckStructure | |
| mConfig | back to summary |
|---|---|
| protected final WriterConfig mConfig | |
| mEncoding | back to summary |
|---|---|
| protected final String mEncoding | |
| mEscapeCR | back to summary |
|---|---|
| pack-priv final boolean mEscapeCR Whether to escape CR (\r) character. | |
| mFixContent | back to summary |
|---|---|
| protected final boolean mFixContent | |
| mLocPastChars | back to summary |
|---|---|
| protected int mLocPastChars Number of characters output prior to currently buffered output | |
| mLocRowNr | back to summary |
|---|---|
| protected int mLocRowNr | |
| mLocRowStartOffset | back to summary |
|---|---|
| protected int mLocRowStartOffset Offset of the first character on this line. May be negative, if the offset was in a buffer that has been flushed out. | |
| mNsAware | back to summary |
|---|---|
| protected final boolean mNsAware | |
| mRawWrapper | back to summary |
|---|---|
| protected XmlWriterWrapper mRawWrapper Lazy-constructed wrapper object, which will route all calls to
Writer API, to matching | |
| mTextWrapper | back to summary |
|---|---|
| protected XmlWriterWrapper mTextWrapper Lazy-constructed wrapper object, which will route all calls to
Writer API, to matching | |
| mTextWriter | back to summary |
|---|---|
| protected Writer mTextWriter Optional escaping writer used for escaping characters like '<' '&' and '>' in textual content. Constructed if calling code has installed a special escaping writer factory for text content. Null if the default escaper is to be used. | |
| mUseDoubleQuotesInXmlDecl | back to summary |
|---|---|
| pack-priv final boolean mUseDoubleQuotesInXmlDecl Whether to use double quotes in XML declaration or not. | |
| mXml11 | back to summary |
|---|---|
| protected boolean mXml11 Indicates whether output is to be compliant; if false, is to be xml 1.0 compliant, if true, xml 1.1 compliant. | |
| SURR1_FIRST | back to summary |
|---|---|
| protected static final int SURR1_FIRST | |
| SURR1_LAST | back to summary |
|---|---|
| protected static final int SURR1_LAST | |
| SURR2_FIRST | back to summary |
|---|---|
| protected static final int SURR2_FIRST | |
| SURR2_LAST | back to summary |
|---|---|
| protected static final int SURR2_LAST | |
| XmlWriter | back to summary |
|---|---|
| protected XmlWriter(WriterConfig cfg, String encoding, boolean autoclose) throws IOException | |
| close | back to summary |
|---|---|
| public abstract void close(boolean forceRealClose) throws IOException Method called to flush the buffer(s), and close the output sink (stream or writer) if enabled (auto-closing) or forced. | |
| enableXml11 | back to summary |
|---|---|
| public void enableXml11() | |
| flush | back to summary |
|---|---|
| public abstract void flush() throws IOException | |
| getAbsOffset | back to summary |
|---|---|
| public int getAbsOffset() | |
| getColumn | back to summary |
|---|---|
| public int getColumn() | |
| getOutputPtr | back to summary |
|---|---|
| protected abstract int getOutputPtr() | |
| getOutputStream | back to summary |
|---|---|
protected abstract OutputStream getOutputStream()
| |
| getRow | back to summary |
|---|---|
| public int getRow() | |
| getWriter | back to summary |
|---|---|
protected abstract Writer getWriter()
| |
| handleInvalidChar | back to summary |
|---|---|
| protected char handleInvalidChar(int c) throws IOException Method called to handle invalid character in textual content requested
to be output. Content may be part of textual events (CHARACTER, CDATA),
attribute value, COMMENT content or PROCESSING_INSTRUCTION data.
The default behavior is to just throw an exception, but this can
be configured via property | |
| reportNwfContent | back to summary |
|---|---|
| protected void reportNwfContent(String msg) throws XMLStreamException | |
| reportNwfName | back to summary |
|---|---|
| protected void reportNwfName(String msg) throws XMLStreamException This is the method called when an output method call violates
name well-formedness checks
and | |
| throwOutputError | back to summary |
|---|---|
| protected void throwOutputError(String msg) throws XMLStreamException | |
| throwOutputError | back to summary |
|---|---|
| protected void throwOutputError(String format, Object arg) throws XMLStreamException | |
| verifyNameValidity | back to summary |
|---|---|
| public final void verifyNameValidity(String name, boolean checkNs) throws XMLStreamException Method called to verify that the name is a legal XML name. | |
| wrapAsRawWriter | back to summary |
|---|---|
| public final Writer wrapAsRawWriter() Method that can be called to get a wrapper instance that
can be used to essentially call the | |
| wrapAsTextWriter | back to summary |
|---|---|
| public final Writer wrapAsTextWriter() | |
| writeAttribute | back to summary |
|---|---|
| public abstract void writeAttribute(String localName, String value) throws IOException, XMLStreamException 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 abstract void writeAttribute(String localName, char[] value, int offset, int len) throws IOException, XMLStreamException | |
| writeAttribute | back to summary |
|---|---|
| public abstract void writeAttribute(String prefix, String localName, String value) throws IOException, XMLStreamException 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 abstract void writeAttribute(String prefix, String localName, char[] value, int offset, int len) throws IOException, XMLStreamException | |
| writeCData | back to summary |
|---|---|
public abstract int writeCData(String data) throws IOException, XMLStreamException
| |
| writeCData | back to summary |
|---|---|
| public abstract int writeCData(char[] cbuf, int offset, int len) throws IOException, XMLStreamException | |
| writeCDataEnd | back to summary |
|---|---|
| public abstract void writeCDataEnd() throws IOException | |
| writeCDataStart | back to summary |
|---|---|
| public abstract void writeCDataStart() throws IOException | |
| writeCharacters | back to summary |
|---|---|
| public abstract void writeCharacters(String data) throws IOException | |
| writeCharacters | back to summary |
|---|---|
| public abstract void writeCharacters(char[] cbuf, int offset, int len) throws IOException | |
| writeComment | back to summary |
|---|---|
| public abstract int writeComment(String data) throws IOException, XMLStreamException 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. | |
| writeCommentEnd | back to summary |
|---|---|
| public abstract void writeCommentEnd() throws IOException | |
| writeCommentStart | back to summary |
|---|---|
| public abstract void writeCommentStart() throws IOException | |
| writeDTD | back to summary |
|---|---|
| public abstract void writeDTD(String data) throws IOException, XMLStreamException 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 abstract void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws IOException, XMLStreamException | |
| writeEndTag | back to summary |
|---|---|
| public abstract void writeEndTag(String localName) throws IOException | |
| writeEndTag | back to summary |
|---|---|
| public abstract void writeEndTag(String prefix, String localName) throws IOException | |
| writeEntityReference | back to summary |
|---|---|
| public abstract void writeEntityReference(String name) throws IOException, XMLStreamException | |
| writePI | back to summary |
|---|---|
| public abstract int writePI(String target, String data) throws IOException, XMLStreamException | |
| writePIEnd | back to summary |
|---|---|
| public abstract void writePIEnd() throws IOException | |
| writePIStart | back to summary |
|---|---|
| public abstract void writePIStart(String target, boolean addSpace) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public abstract void writeRaw(String str, int offset, int len) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String str) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public abstract void writeRaw(char[] cbuf, int offset, int len) throws IOException | |
| writeRawAscii | back to summary |
|---|---|
| public abstract void writeRawAscii(char[] cbuf, int offset, int len) throws IOException Like | |
| writeStartTagEmptyEnd | back to summary |
|---|---|
| public abstract void writeStartTagEmptyEnd() throws IOException | |
| writeStartTagEnd | back to summary |
|---|---|
| public abstract void writeStartTagEnd() throws IOException | |
| writeStartTagStart | back to summary |
|---|---|
| public abstract void writeStartTagStart(String localName) throws IOException, XMLStreamException 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) | |
| writeStartTagStart | back to summary |
|---|---|
| public abstract void writeStartTagStart(String prefix, String localName) throws IOException, XMLStreamException 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) | |
| writeTypedAttribute | back to summary |
|---|---|
| public abstract void writeTypedAttribute(String localName, AsciiValueEncoder enc) throws IOException, XMLStreamException Method similar to | |
| writeTypedAttribute | back to summary |
|---|---|
| public abstract void writeTypedAttribute(String prefix, String localName, AsciiValueEncoder enc) throws IOException, XMLStreamException Method similar to | |
| writeTypedAttribute | back to summary |
|---|---|
| public abstract void writeTypedAttribute(String prefix, String localName, String nsURI, AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer) throws IOException, XMLStreamException Method similar to | |
| writeTypedElement | back to summary |
|---|---|
| public abstract void writeTypedElement(AsciiValueEncoder enc) throws IOException Like
| |
| writeTypedElement | back to summary |
|---|---|
| public abstract void writeTypedElement(AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer) throws IOException, XMLStreamException Like
| |
| writeXmlDeclaration | back to summary |
|---|---|
| public abstract void writeXmlDeclaration(String version, String enc, String standalone) throws IOException | |