|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ctc.wstx.api.ReaderConfig
Simple configuration container class; passed by reader factory to reader instance created.
TODO:
| Method Summary | |
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(DTDReaderProxy dtdReader)
|
static ReaderConfig |
createJ2MEDefaults(DTDReaderProxy dtdReader)
|
ReaderConfig |
createNonShared(SymbolTable sym)
|
void |
doCacheDTDs(boolean state)
|
void |
doCoalesceText(boolean state)
|
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 |
doReportAllTextAsCharacters(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)
|
java.net.URL |
getBaseURL()
|
int |
getConfigFlags()
|
java.util.Map |
getCustomInternalEntities()
|
int |
getDtdCacheSize()
In future this property could/should be made configurable? |
DTDReaderProxy |
getDtdReader()
|
javax.xml.stream.XMLResolver |
getDtdResolver()
|
javax.xml.stream.XMLResolver |
getEntityResolver()
|
int |
getInputBufferLength()
|
java.lang.Object |
getProperty(int id)
|
java.lang.Object |
getProperty(java.lang.String propName)
|
int |
getPropertyId(java.lang.String id)
|
int |
getShortestReportedTextSegment()
|
SymbolTable |
getSymbols()
|
int |
getTextBufferLength()
|
javax.xml.stream.XMLReporter |
getXMLReporter()
|
javax.xml.stream.XMLResolver |
getXMLResolver()
|
boolean |
hasConfigFlags(int flags)
|
boolean |
isPropertySupported(java.lang.String name)
|
void |
setBaseURL(java.net.URL baseURL)
|
void |
setConfigFlag(int flag)
|
void |
setConfigFlags(int flags)
|
void |
setCustomInternalEntities(java.util.Map m)
|
void |
setDtdResolver(javax.xml.stream.XMLResolver r)
|
void |
setEntityResolver(javax.xml.stream.XMLResolver r)
|
void |
setInputBufferLength(int value)
|
void |
setProperty(java.lang.String propName,
int id,
java.lang.Object value)
|
void |
setProperty(java.lang.String propName,
java.lang.Object value)
|
void |
setShortestReportedTextSegment(int value)
|
void |
setTextBufferLength(int value)
|
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 |
willCacheDTDs()
|
boolean |
willCoalesceText()
|
boolean |
willInternNames()
|
boolean |
willInternNsURIs()
|
boolean |
willNormalizeAttrValues()
|
boolean |
willNormalizeLFs()
|
boolean |
willParseLazily()
|
boolean |
willPreserveLocation()
|
boolean |
willReplaceEntityRefs()
|
boolean |
willReportAllTextAsCharacters()
|
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_COALESCE_TEXT
public static final int PROP_NAMESPACE_AWARE
public static final int PROP_REPLACE_ENTITY_REFS
public static final int PROP_SUPPORT_EXTERNAL_ENTITIES
public static final int PROP_VALIDATE_AGAINST_DTD
public static final int PROP_SUPPORT_DTD
public static final int PROP_EVENT_ALLOCATOR
public static final int PROP_WARNING_REPORTER
public static final int PROP_XML_RESOLVER
public static final int PROP_INTERN_NS_URIS
public static final int PROP_INTERN_NAMES
public static final int PROP_REPORT_ALL_TEXT_AS_CHARACTERS
public static final int PROP_REPORT_PROLOG_WS
public static final int PROP_PRESERVE_LOCATION
public static final int PROP_NORMALIZE_LFS
public static final int PROP_NORMALIZE_ATTR_VALUES
public static final int PROP_CACHE_DTDS
public static final int PROP_LAZY_PARSING
public static final int PROP_SUPPORT_DTDPP
public static final int PROP_INPUT_BUFFER_LENGTH
public static final int PROP_TEXT_BUFFER_LENGTH
public static final int PROP_MIN_TEXT_SEGMENT
public static final int PROP_CUSTOM_INTERNAL_ENTITIES
public static final int PROP_DTD_RESOLVER
public static final int PROP_ENTITY_RESOLVER
public static final int PROP_BASE_URL
public static final int DEFAULT_SHORTEST_TEXT_SEGMENT
| Method Detail |
public static ReaderConfig createJ2MEDefaults(DTDReaderProxy dtdReader)
public static ReaderConfig createFullDefaults(DTDReaderProxy dtdReader)
public ReaderConfig createNonShared(SymbolTable sym)
public java.lang.Object getProperty(java.lang.String propName)
public boolean isPropertySupported(java.lang.String name)
public void setProperty(java.lang.String propName,
java.lang.Object value)
public SymbolTable getSymbols()
public DTDReaderProxy getDtdReader()
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 willReportAllTextAsCharacters()
public boolean willReportPrologWhitespace()
public boolean willCacheDTDs()
public boolean willParseLazily()
public boolean willPreserveLocation()
public boolean willSupportDTDPP()
public int getInputBufferLength()
public int getTextBufferLength()
public int getShortestReportedTextSegment()
public java.util.Map getCustomInternalEntities()
public javax.xml.stream.XMLReporter getXMLReporter()
public javax.xml.stream.XMLResolver getXMLResolver()
public java.net.URL getBaseURL()
public javax.xml.stream.XMLResolver getDtdResolver()
public javax.xml.stream.XMLResolver getEntityResolver()
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 doReportAllTextAsCharacters(boolean state)
public void doCacheDTDs(boolean state)
public void doParseLazily(boolean state)
public void doPreserveLocation(boolean state)
public void doSupportDTDPP(boolean state)
public void setInputBufferLength(int value)
public void setTextBufferLength(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 setBaseURL(java.net.URL baseURL)
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.
P_TEXT_BUFFER_LENGTH a bit from default;
will reduce the likelihood of having to expand it during parsing.
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
P_TEXT_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 int getPropertyId(java.lang.String id)
public java.lang.Object getProperty(int id)
public void setProperty(java.lang.String propName,
int id,
java.lang.Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||