|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.api.ReaderConfig
public final class ReaderConfig
Simple configuration container class; passed by reader factory to reader instance created.
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)
Field Summary | |
---|---|
protected static java.lang.String |
IMPL_NAME
|
protected static java.lang.String |
IMPL_VERSION
|
static int |
PROP_EVENT_ALLOCATOR
|
Fields 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 | |
---|---|
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)
|
void |
doAutoCloseInput(boolean state)
|
void |
doCacheDTDs(boolean state)
|
void |
doCacheDTDsByPublicId(boolean state)
|
void |
doCoalesceText(boolean state)
|
protected boolean |
doesSupportXml11()
|
void |
doInternNames(boolean state)
|
void |
doInternNsURIs(boolean state)
|
void |
doNormalizeAttrValues(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 |
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. |
protected int |
findPropertyId(java.lang.String propName)
|
protected int |
findStdPropertyId(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 |
getCustomInternalEntities()
|
int |
getDtdCacheSize()
In future this property could/should be made configurable? |
DTDEventListener |
getDTDEventListener()
|
javax.xml.stream.XMLResolver |
getDtdResolver()
|
javax.xml.stream.XMLResolver |
getEntityResolver()
|
int |
getInputBufferLength()
|
WstxInputProperties.ParsingMode |
getInputParsingMode()
|
java.lang.Object |
getProperty(int id)
|
java.lang.Object |
getProperty(java.lang.String propName)
|
int |
getShortestReportedTextSegment()
|
protected java.lang.Object |
getStdProperty(int id)
|
SymbolTable |
getSymbols()
|
javax.xml.stream.XMLResolver |
getUndeclaredEntityResolver()
|
javax.xml.stream.XMLReporter |
getXMLReporter()
|
javax.xml.stream.XMLResolver |
getXMLResolver()
|
boolean |
hasConfigFlags(int flags)
|
boolean |
inputParsingModeDocuments()
|
boolean |
inputParsingModeFragment()
|
boolean |
isPropertySupported(java.lang.String propName)
|
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)
|
void |
setConfigFlags(int flags)
|
void |
setCustomInternalEntities(java.util.Map m)
|
void |
setDTDEventListener(DTDEventListener l)
|
void |
setDtdResolver(javax.xml.stream.XMLResolver r)
|
void |
setEntityResolver(javax.xml.stream.XMLResolver r)
|
void |
setInputBufferLength(int value)
|
void |
setInputParsingMode(WstxInputProperties.ParsingMode mode)
|
boolean |
setProperty(java.lang.String propName,
int id,
java.lang.Object value)
|
boolean |
setProperty(java.lang.String propName,
java.lang.Object value)
|
void |
setShortestReportedTextSegment(int value)
|
protected boolean |
setStdProperty(java.lang.String propName,
int id,
java.lang.Object 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 |
willNormalizeAttrValues()
|
boolean |
willNormalizeLFs()
|
boolean |
willParseLazily()
|
boolean |
willPreserveLocation()
|
boolean |
willReplaceEntityRefs()
|
boolean |
willReportCData()
|
boolean |
willReportPrologWhitespace()
|
boolean |
willSupportDTDPP()
|
boolean |
willSupportDTDs()
|
boolean |
willSupportExternalEntities()
|
boolean |
willSupportNamespaces()
|
boolean |
willValidateWithDTD()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PROP_EVENT_ALLOCATOR
protected static final java.lang.String IMPL_NAME
protected static final java.lang.String IMPL_VERSION
Method Detail |
---|
public static ReaderConfig createJ2MEDefaults()
public static ReaderConfig createFullDefaults()
public ReaderConfig createNonShared(SymbolTable sym)
public void resetState()
protected int findPropertyId(java.lang.String propName)
public SymbolTable getSymbols()
public int getDtdCacheSize()
public int getConfigFlags()
public boolean hasConfigFlags(int flags)
public boolean willCoalesceText()
public boolean willSupportNamespaces()
public boolean willReplaceEntityRefs()
public boolean willSupportExternalEntities()
public boolean willSupportDTDs()
public boolean willValidateWithDTD()
public boolean willNormalizeLFs()
public boolean willNormalizeAttrValues()
public boolean willInternNames()
public boolean willInternNsURIs()
public boolean willReportCData()
public boolean willReportPrologWhitespace()
public boolean willCacheDTDs()
public boolean willCacheDTDsByPublicId()
public boolean willParseLazily()
public boolean willDoXmlIdTyping()
public boolean willDoXmlIdUniqChecks()
public boolean willPreserveLocation()
public boolean willAutoCloseInput()
public boolean willSupportDTDPP()
public int getInputBufferLength()
public int getShortestReportedTextSegment()
public java.util.Map getCustomInternalEntities()
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 void setConfigFlags(int flags)
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 doNormalizeLFs(boolean state)
public void doNormalizeAttrValues(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 setInputBufferLength(int value)
public void setShortestReportedTextSegment(int value)
public void setCustomInternalEntities(java.util.Map 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 configureForXmlConformance()
XMLInputFactory2.configureForXmlConformance()
for
required settings for standard StAX/StAX properties.
In addition to the standard settings, following Woodstox-specific settings are also done:
P_NORMALIZE_LFS
(will convert all legal
linefeeds in textual content [including PIs and COMMENTs] into
canonical "\n" linefeed before application gets
the text
P_NORMALIZE_ATTR_VALUES
(will normalize all
white space in the attribute values so that multiple adjacent white
space values are represented by a single space; also, leading and
trailing white space is removed).
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:
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_NORMALIZE_LFS
P_NORMALIZE_ATTR_VALUES
P_CACHE_DTDS
.
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_NORMALIZE_LFS
P_NORMALIZE_ATTR_VALUES
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)
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)
public java.lang.Object getProperty(int id)
public boolean setProperty(java.lang.String propName, int id, java.lang.Object value)
public final java.lang.Object getProperty(java.lang.String propName)
public final boolean isPropertySupported(java.lang.String propName)
public final boolean setProperty(java.lang.String propName, java.lang.Object value)
protected boolean doesSupportXml11()
protected int findStdPropertyId(java.lang.String propName)
protected boolean setStdProperty(java.lang.String propName, int id, java.lang.Object value)
protected java.lang.Object getStdProperty(int id)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |