Package com.fasterxml.aalto.out
Class WriterConfig
java.lang.Object
com.fasterxml.aalto.impl.CommonConfig
com.fasterxml.aalto.out.WriterConfig
This is the shared configuration object passed by the factory to writer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
This is a simple container class that is used to encapsulate per-factory encoding-dependant information like symbol tables. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) BufferRecycler
This is the actually container of the recyclable buffers.private String
Encoding passed in either during construction, or via xml declaration write.private final WriterConfig.EncodingContext
A single encoding context instance is shared between all WriterConfig instances created for readers by an output factory.private String
protected static final String
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final ThreadLocal
<SoftReference<BufferRecycler>> ThisThreadLocal
contains ainvalid reference
SoftRerefence
BufferRecycler
used to provide a low-cost buffer recycling between Reader instances.(package private) static final int
Fields inherited from class com.fasterxml.aalto.impl.CommonConfig
_flagMods, _flags, IMPL_NAME, IMPL_VERSION
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
WriterConfig
(String encoding, int flags, int flagMods, WriterConfig.EncodingContext encCtxt, String autoNsPrefix) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
allocFullBBuffer
(int minSize) char[]
allocFullCBuffer
(int minSize) char[]
allocMediumCBuffer
(int minSize) void
void
For Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact.void
private BufferRecycler
void
doAutoCloseOutput
(boolean state) void
void
freeFullBBuffer
(byte[] buffer) void
freeFullCBuffer
(char[] buffer) void
freeMediumCBuffer
(char[] buffer) This method returns name of encoding that has been passed explicitly to the reader or writer, from outside.getProperty
(String name, boolean isMandatory) boolean
boolean
isPropertySupported
(String propName) boolean
isXml11()
void
boolean
setProperty
(String name, Object value) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Methods inherited from class com.fasterxml.aalto.impl.CommonConfig
hasExplicitFlag, hasFlag, hasFlagBeenModified, setFlag
-
Field Details
-
DEFAULT_AUTOMATIC_NS_PREFIX
- See Also:
-
F_NS_REPAIRING
static final int F_NS_REPAIRING- See Also:
-
F_AUTO_CLOSE_OUTPUT
static final int F_AUTO_CLOSE_OUTPUT- See Also:
-
F_NS_AWARE
static final int F_NS_AWARE- See Also:
-
F_AUTO_EMPTY_ELEMS
static final int F_AUTO_EMPTY_ELEMS- See Also:
-
PROP_AUTO_NS_PREFIX
static final int PROP_AUTO_NS_PREFIX- See Also:
-
DEFAULT_FLAGS
static final int DEFAULT_FLAGS- See Also:
-
sProperties
-
_propAutoNsPrefix
-
_encodingContext
A single encoding context instance is shared between all WriterConfig instances created for readers by an output factory. It is used for sharing symbol tables. -
_encoding
Encoding passed in either during construction, or via xml declaration write. -
mRecyclerRef
ThisThreadLocal
contains ainvalid reference
SoftRerefence
BufferRecycler
used to provide a low-cost buffer recycling between Reader instances. -
_currRecycler
BufferRecycler _currRecyclerThis is the actually container of the recyclable buffers. It is obtained via ThreadLocal/SoftReference combination, if one exists, when Config instance is created. If one does not exist, it will created first time a buffer is returned.
-
-
Constructor Details
-
WriterConfig
private WriterConfig(String encoding, int flags, int flagMods, WriterConfig.EncodingContext encCtxt, String autoNsPrefix) -
WriterConfig
public WriterConfig()
-
-
Method Details
-
setActualEncodingIfNotSet
-
doAutoCloseOutput
public void doAutoCloseOutput(boolean state) -
enableXml11
public void enableXml11() -
isXml11
public boolean isXml11()- Specified by:
isXml11
in classCommonConfig
- Returns:
- True, if the processing will be done according to Xml 1.1 rules; false if according to xml 1.0
-
getExternalEncoding
Description copied from class:CommonConfig
This method returns name of encoding that has been passed explicitly to the reader or writer, from outside. An example is that HTTP server may pass encoding as declared in HTTP headers. This should either be null (if none passed), or the same as actual encoding (which is determined from physical stream contents [for readers], or from encoder properties / configuration [for writers]- Specified by:
getExternalEncoding
in classCommonConfig
- Returns:
- Encoding that has been passed externally by the application
-
getActualEncoding
- Specified by:
getActualEncoding
in classCommonConfig
- Returns:
- Actual encoding in use, as determined by the processor.
-
getPreferredEncoding
-
getProperty
- Overrides:
getProperty
in classCommonConfig
- Parameters:
isMandatory
- If true, unrecognized property should result inIllegalArgumentException
-
setProperty
- Overrides:
setProperty
in classCommonConfig
- Returns:
- True, if the specified property was succesfully set to specified value; false if its value was not changed
-
isPropertySupported
- Overrides:
isPropertySupported
in classCommonConfig
-
willRepairNamespaces
public boolean willRepairNamespaces() -
isNamespaceAware
public boolean isNamespaceAware() -
willAutoCloseOutput
public boolean willAutoCloseOutput() -
getAutomaticNsPrefix
- Returns:
- Prefix to use as the base for automatically generated namespace prefixes ("namespace prefix prefix", so to speak). Defaults to "axns".
-
configureForXmlConformance
public void configureForXmlConformance() -
configureForRobustness
public void configureForRobustness() -
configureForSpeed
public void configureForSpeed()For Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact. -
willCheckStructure
public boolean willCheckStructure() -
willCheckContent
public boolean willCheckContent() -
willCheckNames
public boolean willCheckNames() -
willCheckAttributes
public boolean willCheckAttributes() -
willFixContent
public boolean willFixContent() -
willEscapeCR
public boolean willEscapeCR() -
allocMediumCBuffer
public char[] allocMediumCBuffer(int minSize) -
freeMediumCBuffer
public void freeMediumCBuffer(char[] buffer) -
allocFullCBuffer
public char[] allocFullCBuffer(int minSize) -
freeFullCBuffer
public void freeFullCBuffer(char[] buffer) -
allocFullBBuffer
public byte[] allocFullBBuffer(int minSize) -
freeFullBBuffer
public void freeFullBBuffer(byte[] buffer) -
createRecycler
-
getUtf8Symbols
-
getLatin1Symbols
-
getAsciiSymbols
-
getCharSymbols
-