public final class WriterConfig extends Object implements OutputConfigFlags
Modifier and Type | Field and Description |
---|---|
protected static String |
DEFAULT_AUTOMATIC_NS_PREFIX |
protected static String |
IMPL_NAME |
protected static String |
IMPL_VERSION
This is "major.minor" version used for purposes of determining
the feature set.
|
protected int |
mConfigFlags |
protected boolean |
mReturnNullForDefaultNamespace
As per [WSTX-277], can specify whether prefix for the
"default namespace" is return as null (true) or empty String (false)
|
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_STRUCTURE
Modifier and Type | Method and Description |
---|---|
byte[] |
allocFullBBuffer(int minSize) |
char[] |
allocFullCBuffer(int minSize) |
char[] |
allocMediumCBuffer(int minSize)
Method called to allocate intermediate recyclable copy buffers
|
boolean |
automaticEmptyElementsEnabled() |
boolean |
automaticEndElementsEnabled() |
boolean |
automaticNamespacesEnabled() |
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).
|
void |
configureForSpeed()
For Woodstox, setting this profile disables most checks for validity;
specifically anything that can have measurable performance impact.
|
void |
configureForXmlConformance()
For Woodstox, this profile enables all basic well-formedness checks,
including checking for name validity.
|
static WriterConfig |
createFullDefaults() |
static WriterConfig |
createJ2MEDefaults() |
WriterConfig |
createNonShared() |
void |
doAddSpaceAfterEmptyElem(boolean state) |
void |
doAutoCloseOutput(boolean state) |
void |
doCopyDefaultAttrs(boolean state) |
void |
doEscapeCr(boolean state) |
boolean |
doesSupportXml11() |
boolean |
doesSupportXmlId() |
void |
doFixContent(boolean state) |
void |
doOutputCDataAsText(boolean state) |
void |
doSupportNamespaces(boolean state) |
void |
doUseDoubleQuotesInXmlDecl(boolean state) |
void |
doValidateAttributes(boolean state) |
void |
doValidateContent(boolean state) |
void |
doValidateNames(boolean state) |
void |
doValidateStructure(boolean state) |
void |
enableAutomaticEmptyElements(boolean state) |
void |
enableAutomaticEndElements(boolean state) |
void |
enableAutomaticNamespaces(boolean state) |
protected int |
findPropertyId(String propName) |
protected int |
findStdPropertyId(String propName) |
void |
freeFullBBuffer(byte[] buffer) |
void |
freeFullCBuffer(char[] buffer) |
void |
freeMediumCBuffer(char[] buffer) |
org.codehaus.stax2.io.EscapingWriterFactory |
getAttrValueEscaperFactory() |
String |
getAutomaticNsPrefix() |
int |
getConfigFlags() |
EmptyElementHandler |
getEmptyElementHandler() |
static String |
getImplName()
Method used to figure out the official implementation name
for input/output/validation factories.
|
static String |
getImplVersion()
Method used to figure out the official implementation version
for input/output/validation factories.
|
InvalidCharHandler |
getInvalidCharHandler() |
XMLReporter |
getProblemReporter() |
Object |
getProperty(int id) |
Object |
getProperty(String propName) |
protected Object |
getStdProperty(int id) |
org.codehaus.stax2.io.EscapingWriterFactory |
getTextEscaperFactory() |
boolean |
isPropertySupported(String propName) |
protected void |
reportUnknownProperty(String propName) |
boolean |
returnNullForDefaultNamespace() |
Object |
safeGetProperty(String propName) |
void |
setAttrValueEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) |
void |
setAutomaticNsPrefix(String prefix) |
void |
setEmptyElementHandler(EmptyElementHandler h) |
void |
setInvalidCharHandler(InvalidCharHandler h) |
void |
setProblemReporter(XMLReporter rep) |
boolean |
setProperty(String name,
int id,
Object value) |
boolean |
setProperty(String propName,
Object value) |
protected boolean |
setStdProperty(String propName,
int id,
Object value) |
void |
setTextEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f) |
boolean |
willAddSpaceAfterEmptyElem() |
boolean |
willAutoCloseOutput() |
boolean |
willCopyDefaultAttrs() |
boolean |
willEscapeCr() |
boolean |
willFixContent() |
boolean |
willOutputCDataAsText() |
boolean |
willSupportNamespaces() |
boolean |
willUseDoubleQuotesInXmlDecl() |
boolean |
willValidateAttributes() |
boolean |
willValidateContent() |
boolean |
willValidateNames() |
boolean |
willValidateStructure() |
protected static final String DEFAULT_AUTOMATIC_NS_PREFIX
protected int mConfigFlags
protected static final String IMPL_NAME
protected static final String IMPL_VERSION
protected boolean mReturnNullForDefaultNamespace
public static WriterConfig createJ2MEDefaults()
public static WriterConfig createFullDefaults()
public WriterConfig createNonShared()
protected int findPropertyId(String propName)
public Object getProperty(int id)
public boolean setProperty(String name, int id, Object value)
public int getConfigFlags()
public boolean automaticNamespacesEnabled()
public boolean automaticEmptyElementsEnabled()
public boolean willAutoCloseOutput()
public boolean willSupportNamespaces()
public boolean willUseDoubleQuotesInXmlDecl()
public boolean willOutputCDataAsText()
public boolean willCopyDefaultAttrs()
public boolean willEscapeCr()
public boolean willAddSpaceAfterEmptyElem()
public boolean automaticEndElementsEnabled()
public boolean willValidateStructure()
public boolean willValidateContent()
public boolean willValidateAttributes()
public boolean willValidateNames()
public boolean willFixContent()
public String getAutomaticNsPrefix()
public org.codehaus.stax2.io.EscapingWriterFactory getTextEscaperFactory()
public org.codehaus.stax2.io.EscapingWriterFactory getAttrValueEscaperFactory()
public XMLReporter getProblemReporter()
public InvalidCharHandler getInvalidCharHandler()
public EmptyElementHandler getEmptyElementHandler()
public void enableAutomaticNamespaces(boolean state)
public void enableAutomaticEmptyElements(boolean state)
public void doAutoCloseOutput(boolean state)
public void doSupportNamespaces(boolean state)
public void doUseDoubleQuotesInXmlDecl(boolean state)
public void doOutputCDataAsText(boolean state)
public void doCopyDefaultAttrs(boolean state)
public void doEscapeCr(boolean state)
public void doAddSpaceAfterEmptyElem(boolean state)
public void enableAutomaticEndElements(boolean state)
public void doValidateStructure(boolean state)
public void doValidateContent(boolean state)
public void doValidateAttributes(boolean state)
public void doValidateNames(boolean state)
public void doFixContent(boolean state)
public void setAutomaticNsPrefix(String prefix)
prefix
- Prefix to use as the base for automatically generated
namespace prefixes ("namespace prefix prefix", so to speak).public void setTextEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f)
public void setAttrValueEscaperFactory(org.codehaus.stax2.io.EscapingWriterFactory f)
public void setProblemReporter(XMLReporter rep)
public void setInvalidCharHandler(InvalidCharHandler h)
public void setEmptyElementHandler(EmptyElementHandler h)
public void configureForXmlConformance()
public void configureForRobustness()
public void configureForSpeed()
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)
public boolean isPropertySupported(String propName)
public boolean setProperty(String propName, Object value)
protected void reportUnknownProperty(String propName)
public static String getImplName()
public static String getImplVersion()
public boolean doesSupportXml11()
public boolean doesSupportXmlId()
public boolean returnNullForDefaultNamespace()
protected int findStdPropertyId(String propName)
protected boolean setStdProperty(String propName, int id, Object value)
propName
- Name of standard property to setid
- Internal id matching the namevalue
- Value to set the standard property toprotected Object getStdProperty(int id)
Copyright © 2012–2015 FasterXML. All rights reserved.