public final class ReaderConfig extends CommonConfig implements InputConfigFlags
In addition to its main task as a configuration container, this class also acts as a wrapper around simple buffer recycling functionality. The reason is that while conceptually this is a separate concern, there are enough commonalities with the life-cycle of this object to make this a very convenience place to add that functionality... (that is: conceptually this is not right, but from pragmatic viewpoint it just makes sense)
Modifier and Type | Field and Description |
---|---|
(package private) static int |
DEFAULT_FLAGS_FULL
Default config flags are converted from individual settings,
to conform to StAX 1.0 specifications.
|
(package private) static int |
DEFAULT_FLAGS_J2ME
For now defaults for J2ME flags can be identical to 'full' set;
differences are in buffer sizes.
|
static int |
DEFAULT_MAX_ATTRIBUTE_LENGTH |
static int |
DEFAULT_MAX_ATTRIBUTES_PER_ELEMENT |
static int |
DEFAULT_MAX_ELEMENT_DEPTH |
static int |
DEFAULT_MAX_ENTITY_COUNT |
static int |
DEFAULT_MAX_ENTITY_DEPTH |
(package private) static int |
DEFAULT_SHORTEST_TEXT_SEGMENT
By default, let's require minimum of 64 chars to be delivered
as shortest partial (piece of) text (CDATA, text) segment;
same for both J2ME subset and full readers.
|
(package private) static int |
DTD_CACHE_SIZE_J2ME |
(package private) static int |
DTD_CACHE_SIZE_J2SE
Let's allow caching of just a dozen DTDs...
|
protected java.net.URL |
mBaseURL
Base URL to use as the resolution context for relative entity
references
|
protected int |
mConfigFlagMods
Bitset that indicates explicit changes to
mConfigFlags
through calls; empty bit means that the corresponding property
has its default value, set bit that an explicit call has been
made. |
protected int |
mConfigFlags
Bitset that contains state of on/off properties; initialized
to defaults, but can be set/cleared.
|
(package private) BufferRecycler |
mCurrRecycler
This is the actually container of the recyclable buffers.
|
(package private) javax.xml.stream.XMLResolver |
mDtdResolver |
(package private) javax.xml.stream.XMLResolver |
mEntityResolver |
(package private) static int |
MIN_INPUT_BUFFER_LENGTH
Need to set a minimum size, since there are some limitations to
smallest consequtive block that can be used.
|
protected int |
mInputBufferLen |
protected boolean |
mIsJ2MESubset |
protected int |
mMaxAttributeSize |
protected int |
mMaxAttributesPerElement |
protected long |
mMaxCharacters |
protected int |
mMaxChildrenPerElement |
protected long |
mMaxElementCount |
protected int |
mMaxElementDepth |
protected long |
mMaxEntityCount |
protected int |
mMaxEntityDepth |
protected int |
mMaxTextLength |
protected int |
mMinTextSegmentLen |
protected WstxInputProperties.ParsingMode |
mParsingMode
Parsing mode can be changed from the default xml compliant
behavior to one of alternate modes (fragment processing,
multiple document processing).
|
(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) javax.xml.stream.XMLReporter |
mReporter |
(package private) java.lang.Object[] |
mSpecialProperties |
protected SymbolTable |
mSymbols |
protected boolean |
mXml11
This boolean flag is set if the input document requires
xml 1.1 (or above) compliant processing: default is xml 1.0
compliant.
|
(package private) static int |
PROP_AUTO_CLOSE_INPUT |
(package private) static int |
PROP_BASE_URL |
(package private) static int |
PROP_CACHE_DTDS |
(package private) static int |
PROP_CACHE_DTDS_BY_PUBLIC_ID |
(package private) static int |
PROP_COALESCE_TEXT |
(package private) static int |
PROP_CUSTOM_INTERNAL_ENTITIES |
(package private) static int |
PROP_DTD_OVERRIDE |
(package private) static int |
PROP_DTD_RESOLVER |
(package private) static int |
PROP_ENTITY_RESOLVER |
static int |
PROP_EVENT_ALLOCATOR |
(package private) static int |
PROP_INPUT_BUFFER_LENGTH |
(package private) static int |
PROP_INPUT_PARSING_MODE |
(package private) static int |
PROP_INTERN_NAMES |
(package private) static int |
PROP_INTERN_NAMES_EXPLICIT
13-Nov-2008, tatus: Need to be able to keep track of whether
name-interning has been explicitly enabled/disable or not
(not if it's whatever defaults we have)
|
(package private) static int |
PROP_INTERN_NS_URIS |
(package private) static int |
PROP_INTERN_NS_URIS_EXPLICIT |
(package private) static int |
PROP_LAZY_PARSING |
(package private) static int |
PROP_MAX_ATTRIBUTE_SIZE |
(package private) static int |
PROP_MAX_ATTRIBUTES_PER_ELEMENT |
(package private) static int |
PROP_MAX_CHARACTERS |
(package private) static int |
PROP_MAX_CHILDREN_PER_ELEMENT |
(package private) static int |
PROP_MAX_ELEMENT_COUNT |
(package private) static int |
PROP_MAX_ELEMENT_DEPTH |
(package private) static int |
PROP_MAX_ENTITY_COUNT |
(package private) static int |
PROP_MAX_ENTITY_DEPTH |
(package private) static int |
PROP_MAX_TEXT_LENGTH |
(package private) static int |
PROP_MIN_TEXT_SEGMENT |
(package private) static int |
PROP_NAMESPACE_AWARE |
(package private) static int |
PROP_NORMALIZE_LFS
Note: this entry was deprecated for 4.0 versions up until
and including 4.0.7; was brought back for 4.0.8 (and will
be retained for 4.1)
|
(package private) static int |
PROP_PRESERVE_LOCATION |
(package private) static int |
PROP_REPLACE_ENTITY_REFS |
(package private) static int |
PROP_REPORT_CDATA |
(package private) static int |
PROP_REPORT_PROLOG_WS |
(package private) static int |
PROP_SUPPORT_DTD |
(package private) static int |
PROP_SUPPORT_DTDPP |
(package private) static int |
PROP_SUPPORT_EXTERNAL_ENTITIES |
(package private) static int |
PROP_SUPPORT_XMLID |
(package private) static int |
PROP_TREAT_CHAR_REFS_AS_ENTS |
(package private) static int |
PROP_UNDECLARED_ENTITY_RESOLVER |
(package private) static int |
PROP_VALIDATE_AGAINST_DTD |
(package private) static int |
PROP_WARNING_REPORTER |
(package private) static int |
PROP_XML_RESOLVER |
private static int |
SP_IX_CUSTOM_ENTITIES |
private static int |
SP_IX_DTD_EVENT_LISTENER |
private static int |
SP_IX_DTD_OVERRIDE |
private static int |
SP_IX_UNDECL_ENT_RESOLVER |
private static int |
SPEC_PROC_COUNT |
(package private) static java.util.HashMap<java.lang.String,java.lang.Integer> |
sProperties
Map to use for converting from String property ids to ints
described above; useful to allow use of switch later on.
|
IMPL_NAME, IMPL_VERSION, mReturnNullForDefaultNamespace, PROP_IMPL_NAME, PROP_IMPL_VERSION, PROP_RETURN_NULL_FOR_DEFAULT_NAMESPACE, PROP_SUPPORTS_XML11, sStdProperties
CFG_AUTO_CLOSE_INPUT, CFG_CACHE_DTDS, CFG_CACHE_DTDS_BY_PUBLIC_ID, CFG_COALESCE_TEXT, CFG_INTERN_NAMES, CFG_INTERN_NS_URIS, CFG_LAZY_PARSING, CFG_NAMESPACE_AWARE, CFG_NORMALIZE_LFS, CFG_PRESERVE_LOCATION, CFG_REPLACE_ENTITY_REFS, CFG_REPORT_CDATA, CFG_REPORT_PROLOG_WS, CFG_SUPPORT_DTD, CFG_SUPPORT_DTDPP, CFG_SUPPORT_EXTERNAL_ENTITIES, CFG_TREAT_CHAR_REFS_AS_ENTS, CFG_VALIDATE_AGAINST_DTD, CFG_XMLID_TYPING, CFG_XMLID_UNIQ_CHECKS
Modifier | Constructor and Description |
---|---|
private |
ReaderConfig(ReaderConfig base,
boolean j2meSubset,
SymbolTable symbols,
int configFlags,
int configFlagMods,
int inputBufLen,
int minTextSegmentLen) |
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
_getSpecialProperty(int ix) |
protected boolean |
_hasConfigFlag(int flag) |
protected boolean |
_hasExplicitConfigFlag(int flag)
Method similar to
_hasConfigFlag(int) , but that will only
return true if in addition to being set, flag has been explicitly
modified (i.e. |
private void |
_setSpecialProperty(int ix,
java.lang.Object value) |
byte[] |
allocFullBBuffer(int minSize) |
char[] |
allocFullCBuffer(int minSize) |
char[] |
allocMediumCBuffer(int minSize) |
char[] |
allocSmallCBuffer(int minSize) |
void |
clearConfigFlag(int flag) |
void |
configureForConvenience()
Method to call to make Reader created be as "convenient" to use
as possible; ie try to avoid having to deal with some of things
like segmented text chunks.
|
void |
configureForLowMemUsage()
Method to call to minimize the memory usage of the stream/event reader;
both regarding Objects created, and the temporary memory usage during
parsing.
|
void |
configureForRoundTripping()
Method to call to make Reader try to preserve as much of input
formatting as possible, so that round-tripping would be as lossless
as possible.
|
void |
configureForSpeed()
Method to call to make the Reader created be as fast as possible reading
documents, especially for long-running processes where caching is
likely to help.
|
void |
configureForXmlConformance()
Method to call to make Reader created conform as closely to XML
standard as possible, doing all checks and transformations mandated
(linefeed conversions, attr value normalizations).
|
static ReaderConfig |
createFullDefaults() |
static ReaderConfig |
createJ2MEDefaults() |
ReaderConfig |
createNonShared(SymbolTable sym) |
private BufferRecycler |
createRecycler() |
void |
doAutoCloseInput(boolean state) |
void |
doCacheDTDs(boolean state) |
void |
doCacheDTDsByPublicId(boolean state) |
void |
doCoalesceText(boolean state) |
void |
doInternNames(boolean state) |
void |
doInternNsURIs(boolean state) |
void |
doNormalizeLFs(boolean state) |
void |
doParseLazily(boolean state) |
void |
doPreserveLocation(boolean state) |
void |
doReplaceEntityRefs(boolean state) |
void |
doReportCData(boolean state) |
void |
doReportPrologWhitespace(boolean state) |
void |
doSupportDTDPP(boolean state) |
void |
doSupportDTDs(boolean state) |
void |
doSupportExternalEntities(boolean state) |
void |
doSupportNamespaces(boolean state) |
void |
doTreatCharRefsAsEnts(boolean state) |
void |
doValidateWithDTD(boolean state) |
void |
doXmlIdTyping(boolean state) |
void |
doXmlIdUniqChecks(boolean state) |
void |
enableXml11(boolean state)
Method called to enable or disable 1.1 compliant processing; if
disabled, defaults to xml 1.0 compliant processing.
|
EntityDecl |
findCustomInternalEntity(java.lang.String id) |
protected int |
findPropertyId(java.lang.String propName) |
void |
freeFullBBuffer(byte[] buffer) |
void |
freeFullCBuffer(char[] buffer) |
void |
freeMediumCBuffer(char[] buffer) |
void |
freeSmallCBuffer(char[] buffer) |
java.net.URL |
getBaseURL() |
int |
getConfigFlags() |
java.util.Map<java.lang.String,EntityDecl> |
getCustomInternalEntities() |
int |
getDtdCacheSize()
In future this property could/should be made configurable?
|
DTDEventListener |
getDTDEventListener() |
org.codehaus.stax2.validation.DTDValidationSchema |
getDTDOverride() |
javax.xml.stream.XMLResolver |
getDtdResolver() |
javax.xml.stream.XMLResolver |
getEntityResolver() |
int |
getInputBufferLength() |
WstxInputProperties.ParsingMode |
getInputParsingMode() |
int |
getMaxAttributeSize() |
int |
getMaxAttributesPerElement() |
long |
getMaxCharacters() |
int |
getMaxChildrenPerElement() |
long |
getMaxElementCount() |
int |
getMaxElementDepth() |
long |
getMaxEntityCount() |
int |
getMaxEntityDepth() |
long |
getMaxTextLength() |
java.lang.Object |
getProperty(int id) |
int |
getShortestReportedTextSegment() |
SymbolTable |
getSymbols() |
javax.xml.stream.XMLResolver |
getUndeclaredEntityResolver() |
javax.xml.stream.XMLReporter |
getXMLReporter() |
javax.xml.stream.XMLResolver |
getXMLResolver() |
boolean |
hasInternNamesBeenEnabled()
Special accessor to use to verify whether name interning has
explicitly been enabled; true if call was been made to set
it to true; false otherwise (default, or set to false)
|
boolean |
hasInternNsURIsBeenEnabled() |
boolean |
inputParsingModeDocuments() |
boolean |
inputParsingModeFragment() |
boolean |
isXml11() |
void |
resetState()
Unlike name suggests there is also some limited state information
associated with the config object.
|
void |
setBaseURL(java.net.URL baseURL) |
void |
setConfigFlag(int flag) |
private void |
setConfigFlag(int flag,
boolean state) |
void |
setCustomInternalEntities(java.util.Map<java.lang.String,?> m) |
void |
setDTDEventListener(DTDEventListener l) |
void |
setDTDOverride(org.codehaus.stax2.validation.DTDValidationSchema schema) |
void |
setDtdResolver(javax.xml.stream.XMLResolver r) |
void |
setEntityResolver(javax.xml.stream.XMLResolver r) |
void |
setInputBufferLength(int value) |
void |
setInputParsingMode(WstxInputProperties.ParsingMode mode) |
void |
setMaxAttributeSize(int value) |
void |
setMaxAttributesPerElement(int value) |
void |
setMaxCharacters(long value) |
void |
setMaxChildrenPerElement(int value) |
void |
setMaxElementCount(long value) |
void |
setMaxElementDepth(int value) |
void |
setMaxEntityCount(long value) |
void |
setMaxEntityDepth(int value) |
void |
setMaxTextLength(int value) |
boolean |
setProperty(java.lang.String propName,
int id,
java.lang.Object value) |
void |
setShortestReportedTextSegment(int value) |
void |
setUndeclaredEntityResolver(javax.xml.stream.XMLResolver r) |
void |
setXMLReporter(javax.xml.stream.XMLReporter r) |
void |
setXMLResolver(javax.xml.stream.XMLResolver r)
Note: for better granularity, you should call
setEntityResolver(javax.xml.stream.XMLResolver)
and setDtdResolver(javax.xml.stream.XMLResolver) instead. |
boolean |
willAutoCloseInput() |
boolean |
willCacheDTDs() |
boolean |
willCacheDTDsByPublicId() |
boolean |
willCoalesceText() |
boolean |
willDoXmlIdTyping() |
boolean |
willDoXmlIdUniqChecks() |
boolean |
willInternNames() |
boolean |
willInternNsURIs() |
boolean |
willNormalizeLFs() |
boolean |
willParseLazily() |
boolean |
willPreserveLocation() |
boolean |
willReplaceEntityRefs() |
boolean |
willReportCData() |
boolean |
willReportPrologWhitespace() |
boolean |
willSupportDTDPP() |
boolean |
willSupportDTDs() |
boolean |
willSupportExternalEntities() |
boolean |
willSupportNamespaces() |
boolean |
willTreatCharRefsAsEnts() |
boolean |
willValidateWithDTD() |
doesSupportXml11, doesSupportXmlId, findStdPropertyId, getImplName, getImplVersion, getProperty, getStdProperty, isPropertySupported, reportUnknownProperty, returnNullForDefaultNamespace, safeGetProperty, setProperty, setStdProperty
public static final int DEFAULT_MAX_ATTRIBUTES_PER_ELEMENT
public static final int DEFAULT_MAX_ATTRIBUTE_LENGTH
public static final int DEFAULT_MAX_ELEMENT_DEPTH
public static final int DEFAULT_MAX_ENTITY_DEPTH
public static final int DEFAULT_MAX_ENTITY_COUNT
static final int PROP_COALESCE_TEXT
static final int PROP_NAMESPACE_AWARE
static final int PROP_REPLACE_ENTITY_REFS
static final int PROP_SUPPORT_EXTERNAL_ENTITIES
static final int PROP_VALIDATE_AGAINST_DTD
static final int PROP_SUPPORT_DTD
public static final int PROP_EVENT_ALLOCATOR
static final int PROP_WARNING_REPORTER
static final int PROP_XML_RESOLVER
static final int PROP_INTERN_NS_URIS
static final int PROP_INTERN_NAMES
static final int PROP_REPORT_CDATA
static final int PROP_REPORT_PROLOG_WS
static final int PROP_PRESERVE_LOCATION
static final int PROP_AUTO_CLOSE_INPUT
static final int PROP_SUPPORT_XMLID
static final int PROP_DTD_OVERRIDE
static final int PROP_NORMALIZE_LFS
static final int PROP_CACHE_DTDS
static final int PROP_CACHE_DTDS_BY_PUBLIC_ID
static final int PROP_LAZY_PARSING
static final int PROP_SUPPORT_DTDPP
static final int PROP_TREAT_CHAR_REFS_AS_ENTS
static final int PROP_INPUT_BUFFER_LENGTH
static final int PROP_MIN_TEXT_SEGMENT
static final int PROP_CUSTOM_INTERNAL_ENTITIES
static final int PROP_DTD_RESOLVER
static final int PROP_ENTITY_RESOLVER
static final int PROP_UNDECLARED_ENTITY_RESOLVER
static final int PROP_BASE_URL
static final int PROP_INPUT_PARSING_MODE
static final int PROP_MAX_ATTRIBUTES_PER_ELEMENT
static final int PROP_MAX_CHILDREN_PER_ELEMENT
static final int PROP_MAX_ELEMENT_COUNT
static final int PROP_MAX_ELEMENT_DEPTH
static final int PROP_MAX_CHARACTERS
static final int PROP_MAX_ATTRIBUTE_SIZE
static final int PROP_MAX_TEXT_LENGTH
static final int PROP_MAX_ENTITY_COUNT
static final int PROP_MAX_ENTITY_DEPTH
static final int MIN_INPUT_BUFFER_LENGTH
static final int DTD_CACHE_SIZE_J2SE
static final int DTD_CACHE_SIZE_J2ME
static final int DEFAULT_SHORTEST_TEXT_SEGMENT
static final int DEFAULT_FLAGS_FULL
static final int DEFAULT_FLAGS_J2ME
static final java.util.HashMap<java.lang.String,java.lang.Integer> sProperties
protected final boolean mIsJ2MESubset
protected final SymbolTable mSymbols
protected int mConfigFlags
protected int mConfigFlagMods
mConfigFlags
through calls; empty bit means that the corresponding property
has its default value, set bit that an explicit call has been
made.static final int PROP_INTERN_NAMES_EXPLICIT
static final int PROP_INTERN_NS_URIS_EXPLICIT
protected int mInputBufferLen
protected int mMinTextSegmentLen
protected int mMaxAttributesPerElement
protected int mMaxAttributeSize
protected int mMaxChildrenPerElement
protected int mMaxElementDepth
protected long mMaxElementCount
protected long mMaxCharacters
protected int mMaxTextLength
protected int mMaxEntityDepth
protected long mMaxEntityCount
protected java.net.URL mBaseURL
protected WstxInputProperties.ParsingMode mParsingMode
protected boolean mXml11
javax.xml.stream.XMLReporter mReporter
javax.xml.stream.XMLResolver mDtdResolver
javax.xml.stream.XMLResolver mEntityResolver
java.lang.Object[] mSpecialProperties
private static final int SPEC_PROC_COUNT
private static final int SP_IX_CUSTOM_ENTITIES
private static final int SP_IX_UNDECL_ENT_RESOLVER
private static final int SP_IX_DTD_EVENT_LISTENER
private static final int SP_IX_DTD_OVERRIDE
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 mCurrRecycler
private ReaderConfig(ReaderConfig base, boolean j2meSubset, SymbolTable symbols, int configFlags, int configFlagMods, int inputBufLen, int minTextSegmentLen)
public static ReaderConfig createJ2MEDefaults()
public static ReaderConfig createFullDefaults()
public ReaderConfig createNonShared(SymbolTable sym)
public void resetState()
protected int findPropertyId(java.lang.String propName)
findPropertyId
in class CommonConfig
public SymbolTable getSymbols()
public int getDtdCacheSize()
public int getConfigFlags()
public boolean willCoalesceText()
public boolean willSupportNamespaces()
public boolean willReplaceEntityRefs()
public boolean willSupportExternalEntities()
public boolean willSupportDTDs()
public boolean willValidateWithDTD()
public boolean willReportCData()
public boolean willParseLazily()
public boolean willInternNames()
public boolean willInternNsURIs()
public boolean willPreserveLocation()
public boolean willAutoCloseInput()
public boolean willReportPrologWhitespace()
public boolean willCacheDTDs()
public boolean willCacheDTDsByPublicId()
public boolean willDoXmlIdTyping()
public boolean willDoXmlIdUniqChecks()
public boolean willSupportDTDPP()
public boolean willNormalizeLFs()
public boolean willTreatCharRefsAsEnts()
public int getInputBufferLength()
public int getShortestReportedTextSegment()
public int getMaxAttributesPerElement()
public int getMaxAttributeSize()
public int getMaxChildrenPerElement()
public int getMaxElementDepth()
public long getMaxElementCount()
public int getMaxEntityDepth()
public long getMaxEntityCount()
public long getMaxCharacters()
public long getMaxTextLength()
public java.util.Map<java.lang.String,EntityDecl> getCustomInternalEntities()
public EntityDecl findCustomInternalEntity(java.lang.String id)
public javax.xml.stream.XMLReporter getXMLReporter()
public javax.xml.stream.XMLResolver getXMLResolver()
public javax.xml.stream.XMLResolver getDtdResolver()
public javax.xml.stream.XMLResolver getEntityResolver()
public javax.xml.stream.XMLResolver getUndeclaredEntityResolver()
public java.net.URL getBaseURL()
public WstxInputProperties.ParsingMode getInputParsingMode()
public boolean inputParsingModeDocuments()
public boolean inputParsingModeFragment()
public boolean isXml11()
public DTDEventListener getDTDEventListener()
public org.codehaus.stax2.validation.DTDValidationSchema getDTDOverride()
public boolean hasInternNamesBeenEnabled()
public boolean hasInternNsURIsBeenEnabled()
public void setConfigFlag(int flag)
public void clearConfigFlag(int flag)
public void doCoalesceText(boolean state)
public void doSupportNamespaces(boolean state)
public void doReplaceEntityRefs(boolean state)
public void doSupportExternalEntities(boolean state)
public void doSupportDTDs(boolean state)
public void doValidateWithDTD(boolean state)
public void doInternNames(boolean state)
public void doInternNsURIs(boolean state)
public void doReportPrologWhitespace(boolean state)
public void doReportCData(boolean state)
public void doCacheDTDs(boolean state)
public void doCacheDTDsByPublicId(boolean state)
public void doParseLazily(boolean state)
public void doXmlIdTyping(boolean state)
public void doXmlIdUniqChecks(boolean state)
public void doPreserveLocation(boolean state)
public void doAutoCloseInput(boolean state)
public void doSupportDTDPP(boolean state)
public void doTreatCharRefsAsEnts(boolean state)
public void doNormalizeLFs(boolean state)
public void setInputBufferLength(int value)
public void setShortestReportedTextSegment(int value)
public void setMaxAttributesPerElement(int value)
public void setMaxAttributeSize(int value)
public void setMaxChildrenPerElement(int value)
public void setMaxElementDepth(int value)
public void setMaxElementCount(long value)
public void setMaxCharacters(long value)
public void setMaxTextLength(int value)
public void setMaxEntityDepth(int value)
public void setMaxEntityCount(long value)
public void setCustomInternalEntities(java.util.Map<java.lang.String,?> m)
public void setXMLReporter(javax.xml.stream.XMLReporter r)
public void setXMLResolver(javax.xml.stream.XMLResolver r)
setEntityResolver(javax.xml.stream.XMLResolver)
and setDtdResolver(javax.xml.stream.XMLResolver)
instead.public void setDtdResolver(javax.xml.stream.XMLResolver r)
public void setEntityResolver(javax.xml.stream.XMLResolver r)
public void setUndeclaredEntityResolver(javax.xml.stream.XMLResolver r)
public void setBaseURL(java.net.URL baseURL)
public void setInputParsingMode(WstxInputProperties.ParsingMode mode)
public void enableXml11(boolean state)
public void setDTDEventListener(DTDEventListener l)
public void setDTDOverride(org.codehaus.stax2.validation.DTDValidationSchema schema)
public void configureForXmlConformance()
XMLInputFactory2.configureForXmlConformance()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
Notes: Does NOT change 'performance' settings (buffer sizes, DTD caching, coalescing, interning, accurate location info).
public void configureForConvenience()
XMLInputFactory2.configureForConvenience()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
XMLStreamFactory2.P_LAZY_PARSING
(to allow for synchronous
error notification by forcing full XML events to be completely
parsed when reader's next() is called)
public void configureForSpeed()
XMLInputFactory2.configureForSpeed()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
P_CACHE_DTDS
.
XMLStremaFactory2.P_LAZY_PARSING
(can improve performance
especially when skipping text segments)
P_MIN_TEXT_SEGMENT
, to allow
reader to optimize segment length it uses (and possibly avoids
one copy operation in the process)
P_INPUT_BUFFER_LENGTH
a bit from default,
to allow for longer consequtive read operations; also reduces cases
where partial text segments are on input buffer boundaries.
public void configureForLowMemUsage()
See XMLInputFactory2.configureForLowMemUsage()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
P_CACHE_DTDS
P_PARSE_LAZILY
P_MIN_TEXT_SEGMENT
to the (somewhat low)
default value.
P_INPUT_BUFFER_LENGTH
a bit from the default
public void configureForRoundTripping()
See XMLInputFactory2.configureForLowMemUsage()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
P_MIN_TEXT_SEGMENT
to the maximum value so
that all original text segment chunks are reported without
segmentation (but without coalescing with adjacent CDATA segments)
P_TREAT_CHAR_REFS_AS_ENTS
to true, so the all the
original character references are reported with their position,
original text, and the replacement text.
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()
private void setConfigFlag(int flag, boolean state)
public java.lang.Object getProperty(int id)
getProperty
in class CommonConfig
public boolean setProperty(java.lang.String propName, int id, java.lang.Object value)
setProperty
in class CommonConfig
protected boolean _hasConfigFlag(int flag)
protected boolean _hasExplicitConfigFlag(int flag)
_hasConfigFlag(int)
, but that will only
return true if in addition to being set, flag has been explicitly
modified (i.e. setProperty has been called to modify it)private final java.lang.Object _getSpecialProperty(int ix)
private final void _setSpecialProperty(int ix, java.lang.Object value)