public abstract class XmlWriter extends WNameFactory
Modifier and Type | Field and Description |
---|---|
protected boolean |
_cfgNsAware |
protected boolean |
_checkContent |
protected boolean |
_checkNames |
protected WriterConfig |
_config |
protected char[] |
_copyBuffer
Intermediate buffer, in which content (esp.
|
protected int |
_copyBufferLen |
protected int |
_locPastChars
Number of characters output prior to currently buffered output
|
protected int |
_locRowNr |
protected int |
_locRowStartOffset
Offset of the first character on this line.
|
protected boolean |
_xml11
Indicates whether output is to be compliant; if false, is to be
xml 1.0 compliant, if true, xml 1.1 compliant.
|
protected static int |
ATTR_MIN_ARRAYCOPY |
protected static int |
DEFAULT_COPYBUFFER_LEN |
protected static int |
MIN_ARRAYCOPY |
protected static int |
SURR1_FIRST |
protected static int |
SURR1_LAST |
protected static int |
SURR2_FIRST |
protected static int |
SURR2_LAST |
Modifier | Constructor and Description |
---|---|
protected |
XmlWriter(WriterConfig cfg) |
Modifier and Type | Method and Description |
---|---|
abstract void |
_closeTarget(boolean doClose) |
void |
_releaseBuffers() |
void |
close(boolean forceTargetClose)
Method called to flush the buffer(s), and close the output
sink (stream or writer).
|
abstract WName |
constructName(String localName) |
abstract WName |
constructName(String prefix,
String localName) |
void |
enableXml11() |
abstract void |
flush() |
int |
getAbsOffset() |
int |
getColumn() |
abstract 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 abstract int |
getOutputPtr() |
int |
getRow() |
static int |
guessEncodingBitSize(WriterConfig cfg)
Method used to figure out which part of the Unicode char set the
encoding can natively support.
|
protected void |
reportFailedEscaping(String type,
int ch) |
protected void |
reportInvalidChar(int c) |
protected void |
reportInvalidEmptyName() |
protected void |
reportNwfContent(String msg) |
protected void |
reportNwfContent(String format,
Object arg1,
Object arg2) |
protected void |
reportNwfName(String msg)
This is the method called when an output method call violates
name well-formedness checks
and name validation is enabled.
|
protected void |
reportNwfName(String msg,
Object arg) |
protected void |
throwOutputError(String msg) |
protected void |
throwOutputError(String format,
Object arg) |
abstract void |
writeAttribute(WName name,
org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) |
abstract void |
writeAttribute(WName name,
char[] value,
int offset,
int len) |
abstract void |
writeAttribute(WName name,
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)
|
abstract int |
writeCData(char[] cbuf,
int offset,
int len) |
abstract int |
writeCData(String data) |
abstract void |
writeCharacters(char[] cbuf,
int offset,
int len) |
abstract void |
writeCharacters(String data) |
abstract int |
writeComment(String data)
Method that will try to output the content as specified.
|
abstract void |
writeDTD(String data)
Older "legacy" output method for outputting DOCTYPE declaration.
|
abstract void |
writeDTD(WName rootName,
String systemId,
String publicId,
String internalSubset) |
abstract void |
writeEndTag(WName name) |
abstract void |
writeEntityReference(WName name) |
abstract int |
writePI(WName target,
String data) |
abstract void |
writeRaw(char[] cbuf,
int offset,
int len) |
abstract void |
writeRaw(String str,
int offset,
int len) |
abstract void |
writeSpace(char[] cbuf,
int offset,
int len) |
abstract void |
writeSpace(String data) |
abstract void |
writeStartTagEmptyEnd() |
abstract void |
writeStartTagEnd() |
abstract 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)
|
abstract void |
writeTypedValue(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) |
abstract void |
writeXmlDeclaration(String version,
String enc,
String standalone) |
protected static final int SURR1_FIRST
protected static final int SURR1_LAST
protected static final int SURR2_FIRST
protected static final int SURR2_LAST
protected static final int MIN_ARRAYCOPY
protected static final int ATTR_MIN_ARRAYCOPY
protected static final int DEFAULT_COPYBUFFER_LEN
protected final WriterConfig _config
protected char[] _copyBuffer
protected final int _copyBufferLen
protected boolean _xml11
protected final boolean _cfgNsAware
protected int _locPastChars
protected int _locRowNr
protected int _locRowStartOffset
protected final boolean _checkContent
protected final boolean _checkNames
protected XmlWriter(WriterConfig cfg)
public abstract WName constructName(String localName) throws XMLStreamException
constructName
in class WNameFactory
XMLStreamException
public abstract WName constructName(String prefix, String localName) throws XMLStreamException
constructName
in class WNameFactory
XMLStreamException
public void enableXml11()
protected abstract int getOutputPtr()
public abstract int getHighestEncodable()
public final void close(boolean forceTargetClose) throws IOException
IOException
public void _releaseBuffers()
public abstract void _closeTarget(boolean doClose) throws IOException
IOException
public abstract void flush() throws IOException
IOException
public abstract int writeCData(String data) throws IOException, XMLStreamException
data
- Contents of the CDATA section to write outIOException
XMLStreamException
public abstract int writeCData(char[] cbuf, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeCharacters(String data) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeCharacters(char[] cbuf, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeSpace(String data) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeSpace(char[] cbuf, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract int writeComment(String data) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeDTD(String data) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeDTD(WName rootName, String systemId, String publicId, String internalSubset) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeEntityReference(WName name) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract int writePI(WName target, String data) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeRaw(String str, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeRaw(char[] cbuf, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeXmlDeclaration(String version, String enc, String standalone) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeStartTagStart(WName name) 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)
IOException
XMLStreamException
public abstract void writeStartTagEnd() throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeStartTagEmptyEnd() throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeEndTag(WName name) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeAttribute(WName name, 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)
IOException
XMLStreamException
public abstract void writeAttribute(WName name, char[] value, int offset, int len) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeTypedValue(org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws IOException, XMLStreamException
IOException
XMLStreamException
public abstract void writeAttribute(WName name, org.codehaus.stax2.ri.typed.AsciiValueEncoder enc) throws IOException, XMLStreamException
IOException
XMLStreamException
public int getRow()
public int getColumn()
public int getAbsOffset()
public static final int guessEncodingBitSize(WriterConfig cfg)
protected void reportNwfName(String msg) throws XMLStreamException
XMLStreamException
protected void reportNwfName(String msg, Object arg) throws XMLStreamException
XMLStreamException
protected void reportNwfContent(String msg) throws XMLStreamException
XMLStreamException
protected void reportNwfContent(String format, Object arg1, Object arg2) throws XMLStreamException
XMLStreamException
protected void reportFailedEscaping(String type, int ch) throws XMLStreamException
XMLStreamException
protected void reportInvalidEmptyName() throws XMLStreamException
XMLStreamException
protected void reportInvalidChar(int c) throws XMLStreamException
XMLStreamException
protected void throwOutputError(String msg) throws XMLStreamException
XMLStreamException
protected void throwOutputError(String format, Object arg) throws XMLStreamException
XMLStreamException
Copyright © 2018 FasterXML. All rights reserved.