Package com.ctc.wstx.api
Class WriterConfig
java.lang.Object
com.ctc.wstx.api.WriterConfig
- All Implemented Interfaces:
OutputConfigFlags,org.codehaus.stax2.XMLStreamProperties
Simple configuration container class; passed by writer factory to writer
instance created.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final StringThis is "major.minor" version used for purposes of determining the feature set.protected intprotected booleanAs per [WSTX-277], can specify whether prefix for the "default namespace" is return as null (true) or empty String (false)Fields inherited from interface com.ctc.wstx.cfg.OutputConfigFlags
CFG_ADD_SPACE_AFTER_EMPTY_ELEM, CFG_AUTO_CLOSE_OUTPUT, CFG_AUTOMATIC_EMPTY_ELEMENTS, CFG_AUTOMATIC_END_ELEMENTS, CFG_AUTOMATIC_NS, CFG_COPY_DEFAULT_ATTRS, CFG_ENABLE_NS, CFG_ESCAPE_CR, CFG_FIX_CONTENT, CFG_OUTPUT_CDATA_AS_TEXT, CFG_USE_DOUBLE_QUOTES_IN_XML_DECL, CFG_VALIDATE_ATTR, CFG_VALIDATE_CONTENT, CFG_VALIDATE_NAMES, CFG_VALIDATE_STRUCTUREFields inherited from interface org.codehaus.stax2.XMLStreamProperties
XSP_IMPLEMENTATION_NAME, XSP_IMPLEMENTATION_VERSION, XSP_NAMESPACE_AWARE, XSP_PROBLEM_REPORTER, XSP_SUPPORT_XMLID, XSP_SUPPORTS_XML11, XSP_V_XMLID_FULL, XSP_V_XMLID_NONE, XSP_V_XMLID_TYPING -
Method Summary
Modifier and TypeMethodDescriptionbyte[]allocFullBBuffer(int minSize) char[]allocFullCBuffer(int minSize) char[]allocMediumCBuffer(int minSize) Method called to allocate intermediate recyclable copy buffersbooleanbooleanbooleanvoidFor Woodstox, this profile enables all basic well-formedness checks, including checking for name validity, and also enables all matching "fix-me" properties (currently only content-fixing property exists).voidFor Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact.voidFor Woodstox, this profile enables all basic well-formedness checks, including checking for name validity.static WriterConfigstatic WriterConfigvoiddoAddSpaceAfterEmptyElem(boolean state) voiddoAutoCloseOutput(boolean state) voiddoCopyDefaultAttrs(boolean state) voiddoEscapeCr(boolean state) booleanbooleanvoiddoFixContent(boolean state) voiddoOutputCDataAsText(boolean state) voiddoSupportNamespaces(boolean state) voiddoUseDoubleQuotesInXmlDecl(boolean state) voiddoValidateAttributes(boolean state) voiddoValidateContent(boolean state) voiddoValidateNames(boolean state) voiddoValidateStructure(boolean state) voidenableAutomaticEmptyElements(boolean state) voidenableAutomaticEndElements(boolean state) voidenableAutomaticNamespaces(boolean state) protected intfindPropertyId(String propName) protected intfindStdPropertyId(String propName) voidfreeFullBBuffer(byte[] buffer) voidfreeFullCBuffer(char[] buffer) voidfreeMediumCBuffer(char[] buffer) org.codehaus.stax2.io.EscapingWriterFactoryintstatic StringMethod used to figure out the official implementation name for input/output/validation factories.static StringMethod used to figure out the official implementation version for input/output/validation factories.getProperty(int id) getProperty(String propName) protected ObjectgetStdProperty(int id) org.codehaus.stax2.io.EscapingWriterFactorybooleanisPropertySupported(String propName) protected voidreportUnknownProperty(String propName) booleanfinal ObjectsafeGetProperty(String propName) voidsetAttrValueEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) voidsetAutomaticNsPrefix(String prefix) voidvoidvoidbooleansetProperty(String name, int id, Object value) booleansetProperty(String propName, Object value) protected booleansetStdProperty(String propName, int id, Object value) voidsetTextEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanboolean
-
Field Details
-
DEFAULT_AUTOMATIC_NS_PREFIX
- See Also:
-
mConfigFlags
protected int mConfigFlags -
IMPL_NAME
- See Also:
-
IMPL_VERSION
This is "major.minor" version used for purposes of determining the feature set. Patch level is not included, since those should not affect API or feature set. Using applications should be prepared to take additional levels, however, just not depend on those being available.- See Also:
-
mReturnNullForDefaultNamespace
protected boolean mReturnNullForDefaultNamespaceAs per [WSTX-277], can specify whether prefix for the "default namespace" is return as null (true) or empty String (false)
-
-
Method Details
-
createJ2MEDefaults
-
createFullDefaults
-
findPropertyId
- Returns:
- Internal enumerated int matching the String name of the property, if one found: -1 to indicate no match was found.
-
getProperty
-
setProperty
- Returns:
- True, if the specified property was succesfully set to specified value; false if its value was not changed
-
getConfigFlags
public int getConfigFlags() -
automaticNamespacesEnabled
public boolean automaticNamespacesEnabled() -
automaticEmptyElementsEnabled
public boolean automaticEmptyElementsEnabled() -
willAutoCloseOutput
public boolean willAutoCloseOutput() -
willSupportNamespaces
public boolean willSupportNamespaces() -
willUseDoubleQuotesInXmlDecl
public boolean willUseDoubleQuotesInXmlDecl()- Since:
- 4.2.2
-
willOutputCDataAsText
public boolean willOutputCDataAsText() -
willCopyDefaultAttrs
public boolean willCopyDefaultAttrs() -
willEscapeCr
public boolean willEscapeCr() -
willAddSpaceAfterEmptyElem
public boolean willAddSpaceAfterEmptyElem() -
automaticEndElementsEnabled
public boolean automaticEndElementsEnabled() -
willValidateStructure
public boolean willValidateStructure() -
willValidateContent
public boolean willValidateContent() -
willValidateAttributes
public boolean willValidateAttributes() -
willValidateNames
public boolean willValidateNames() -
willFixContent
public boolean willFixContent() -
getAutomaticNsPrefix
- Returns:
- Prefix to use as the base for automatically generated namespace prefixes ("namespace prefix prefix", so to speak). Defaults to "wstxns".
-
getTextEscaperFactory
public org.codehaus.stax2.io.EscapingWriterFactory getTextEscaperFactory() -
getAttrValueEscaperFactory
public org.codehaus.stax2.io.EscapingWriterFactory getAttrValueEscaperFactory() -
getProblemReporter
-
getInvalidCharHandler
-
getEmptyElementHandler
-
enableAutomaticNamespaces
public void enableAutomaticNamespaces(boolean state) -
enableAutomaticEmptyElements
public void enableAutomaticEmptyElements(boolean state) -
doAutoCloseOutput
public void doAutoCloseOutput(boolean state) -
doSupportNamespaces
public void doSupportNamespaces(boolean state) -
doUseDoubleQuotesInXmlDecl
public void doUseDoubleQuotesInXmlDecl(boolean state) - Since:
- 4.2.2
-
doOutputCDataAsText
public void doOutputCDataAsText(boolean state) -
doCopyDefaultAttrs
public void doCopyDefaultAttrs(boolean state) -
doEscapeCr
public void doEscapeCr(boolean state) -
doAddSpaceAfterEmptyElem
public void doAddSpaceAfterEmptyElem(boolean state) -
enableAutomaticEndElements
public void enableAutomaticEndElements(boolean state) -
doValidateStructure
public void doValidateStructure(boolean state) -
doValidateContent
public void doValidateContent(boolean state) -
doValidateAttributes
public void doValidateAttributes(boolean state) -
doValidateNames
public void doValidateNames(boolean state) -
doFixContent
public void doFixContent(boolean state) -
setAutomaticNsPrefix
- Parameters:
prefix- Prefix to use as the base for automatically generated namespace prefixes ("namespace prefix prefix", so to speak).
-
setTextEscaperFactory
public void setTextEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) -
setAttrValueEscaperFactory
public void setAttrValueEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) -
setProblemReporter
-
setInvalidCharHandler
-
setEmptyElementHandler
-
configureForXmlConformance
public void configureForXmlConformance()For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity. -
configureForRobustness
public void configureForRobustness()For Woodstox, this profile enables all basic well-formedness checks, including checking for name validity, and also enables all matching "fix-me" properties (currently only content-fixing property exists). -
configureForSpeed
public void configureForSpeed()For Woodstox, setting this profile disables most checks for validity; specifically anything that can have measurable performance impact. -
allocMediumCBuffer
public char[] allocMediumCBuffer(int minSize) Method called to allocate intermediate recyclable copy buffers -
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) -
getProperty
-
isPropertySupported
-
setProperty
- Returns:
- True, if the specified property was successfully set to specified value; false if its value was not changed
-
reportUnknownProperty
-
safeGetProperty
-
getImplName
Method used to figure out the official implementation name for input/output/validation factories. -
getImplVersion
Method used to figure out the official implementation version for input/output/validation factories. -
doesSupportXml11
public boolean doesSupportXml11() -
doesSupportXmlId
public boolean doesSupportXmlId() -
returnNullForDefaultNamespace
public boolean returnNullForDefaultNamespace() -
findStdPropertyId
-
setStdProperty
- Parameters:
propName- Name of standard property to setid- Internal id matching the namevalue- Value to set the standard property to
-
getStdProperty
-