public final class WriterConfig extends CommonConfig
Modifier and Type | Class and Description |
---|---|
(package private) static class |
WriterConfig.EncodingContext
This is a simple container class that is used to encapsulate
per-factory encoding-dependant information like symbol tables.
|
Modifier and Type | Field and Description |
---|---|
(package private) BufferRecycler |
_currRecycler
This is the actually container of the recyclable buffers.
|
private java.lang.String |
_encoding
Encoding passed in either during construction, or via xml
declaration write.
|
private WriterConfig.EncodingContext |
_encodingContext
A single encoding context instance is shared between all WriterConfig
instances created for readers by an output factory.
|
private java.lang.String |
_propAutoNsPrefix |
protected static java.lang.String |
DEFAULT_AUTOMATIC_NS_PREFIX |
(package private) static int |
DEFAULT_FLAGS |
(package private) static int |
F_AUTO_CLOSE_OUTPUT |
(package private) static int |
F_AUTO_EMPTY_ELEMS |
(package private) static int |
F_NS_AWARE |
(package private) static int |
F_NS_REPAIRING |
(package private) static java.lang.ThreadLocal<java.lang.ref.SoftReference<BufferRecycler>> |
mRecyclerRef
This
ThreadLocal contains a SoftRerefence
to a BufferRecycler used to provide a low-cost
buffer recycling between Reader instances. |
(package private) static int |
PROP_AUTO_NS_PREFIX |
private static java.util.HashMap<java.lang.String,java.lang.Integer> |
sProperties |
_flagMods, _flags, IMPL_NAME, IMPL_VERSION
Modifier | Constructor and Description |
---|---|
|
WriterConfig() |
private |
WriterConfig(java.lang.String encoding,
int flags,
int flagMods,
WriterConfig.EncodingContext encCtxt,
java.lang.String autoNsPrefix) |
Modifier and Type | Method and Description |
---|---|
byte[] |
allocFullBBuffer(int minSize) |
char[] |
allocFullCBuffer(int minSize) |
char[] |
allocMediumCBuffer(int minSize) |
char[] |
allocSmallCBuffer(int minSize) |
void |
configureForRobustness() |
void |
configureForSpeed()
For Woodstox, setting this profile disables most checks for validity;
specifically anything that can have measurable performance impact.
|
void |
configureForXmlConformance() |
WriterConfig |
createNonShared() |
private BufferRecycler |
createRecycler() |
void |
doAutoCloseOutput(boolean state) |
void |
enableXml11() |
void |
freeFullBBuffer(byte[] buffer) |
void |
freeFullCBuffer(char[] buffer) |
void |
freeMediumCBuffer(char[] buffer) |
void |
freeSmallCBuffer(char[] buffer) |
java.lang.String |
getActualEncoding() |
WNameTable |
getAsciiSymbols(WNameFactory f) |
java.lang.String |
getAutomaticNsPrefix() |
WNameTable |
getCharSymbols(WNameFactory f) |
java.lang.String |
getExternalEncoding()
This method returns name of encoding that has been passed
explicitly to the reader or writer, from outside.
|
WNameTable |
getLatin1Symbols(WNameFactory f) |
java.lang.String |
getPreferredEncoding() |
java.lang.Object |
getProperty(java.lang.String name,
boolean isMandatory) |
WNameTable |
getUtf8Symbols(WNameFactory f) |
boolean |
isNamespaceAware() |
boolean |
isPropertySupported(java.lang.String propName) |
boolean |
isXml11() |
void |
setActualEncodingIfNotSet(java.lang.String enc) |
boolean |
setProperty(java.lang.String name,
java.lang.Object value) |
boolean |
willAutoCloseOutput() |
boolean |
willCheckAttributes() |
boolean |
willCheckContent() |
boolean |
willCheckNames() |
boolean |
willCheckStructure() |
boolean |
willEscapeCR() |
boolean |
willFixContent() |
boolean |
willRepairNamespaces() |
hasExplicitFlag, hasFlag, hasFlagBeenModified, setFlag
protected static final java.lang.String DEFAULT_AUTOMATIC_NS_PREFIX
static final int F_NS_REPAIRING
static final int F_AUTO_CLOSE_OUTPUT
static final int F_NS_AWARE
static final int F_AUTO_EMPTY_ELEMS
static final int PROP_AUTO_NS_PREFIX
static final int DEFAULT_FLAGS
private static final java.util.HashMap<java.lang.String,java.lang.Integer> sProperties
private java.lang.String _propAutoNsPrefix
private final WriterConfig.EncodingContext _encodingContext
private java.lang.String _encoding
static final java.lang.ThreadLocal<java.lang.ref.SoftReference<BufferRecycler>> mRecyclerRef
ThreadLocal
contains a SoftRerefence
to a BufferRecycler
used to provide a low-cost
buffer recycling between Reader instances.BufferRecycler _currRecycler
private WriterConfig(java.lang.String encoding, int flags, int flagMods, WriterConfig.EncodingContext encCtxt, java.lang.String autoNsPrefix)
public WriterConfig()
public void setActualEncodingIfNotSet(java.lang.String enc)
public void doAutoCloseOutput(boolean state)
public void enableXml11()
public WriterConfig createNonShared()
public boolean isXml11()
isXml11
in class CommonConfig
public java.lang.String getExternalEncoding()
CommonConfig
getExternalEncoding
in class CommonConfig
public java.lang.String getActualEncoding()
getActualEncoding
in class CommonConfig
public java.lang.String getPreferredEncoding()
public java.lang.Object getProperty(java.lang.String name, boolean isMandatory)
getProperty
in class CommonConfig
isMandatory
- If true, unrecognized property should
result in IllegalArgumentException
public boolean setProperty(java.lang.String name, java.lang.Object value)
setProperty
in class CommonConfig
public boolean isPropertySupported(java.lang.String propName)
isPropertySupported
in class CommonConfig
public boolean willRepairNamespaces()
public boolean isNamespaceAware()
public boolean willAutoCloseOutput()
public java.lang.String getAutomaticNsPrefix()
public void configureForXmlConformance()
public void configureForRobustness()
public void configureForSpeed()
public boolean willCheckStructure()
public boolean willCheckContent()
public boolean willCheckNames()
public boolean willCheckAttributes()
public boolean willFixContent()
public boolean willEscapeCR()
public char[] allocSmallCBuffer(int minSize)
public void freeSmallCBuffer(char[] buffer)
public char[] allocMediumCBuffer(int minSize)
public void freeMediumCBuffer(char[] buffer)
public char[] allocFullCBuffer(int minSize)
public void freeFullCBuffer(char[] buffer)
public byte[] allocFullBBuffer(int minSize)
public void freeFullBBuffer(byte[] buffer)
private BufferRecycler createRecycler()
public WNameTable getUtf8Symbols(WNameFactory f)
public WNameTable getLatin1Symbols(WNameFactory f)
public WNameTable getAsciiSymbols(WNameFactory f)
public WNameTable getCharSymbols(WNameFactory f)