public class WstxInputFactory extends org.codehaus.stax2.XMLInputFactory2 implements ReaderCreator, InputConfigFlags
Currently supported configuration options fall into two categories. First,
all properties from XMLInputFactory
(such as, say,
XMLInputFactory.IS_NAMESPACE_AWARE
) are at least recognized, and
most are supported. Second, there are additional properties, defined in
constant class WstxInputProperties
, that are supported.
See WstxInputProperties
for further explanation of these 'custom'
properties.
Modifier and Type | Field and Description |
---|---|
protected XMLEventAllocator |
mAllocator |
protected ReaderConfig |
mConfig
Current configurations for this factory
|
protected SimpleCache<DTDId,DTDSubset> |
mDTDCache |
P_AUTO_CLOSE_INPUT, P_DTD_OVERRIDE, P_INTERN_NAMES, P_INTERN_NS_URIS, P_LAZY_PARSING, P_PRESERVE_LOCATION, P_REPORT_CDATA, P_REPORT_PROLOG_WHITESPACE
ALLOCATOR, IS_COALESCING, IS_NAMESPACE_AWARE, IS_REPLACING_ENTITY_REFERENCES, IS_SUPPORTING_EXTERNAL_ENTITIES, IS_VALIDATING, REPORTER, RESOLVER, SUPPORT_DTD
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
Constructor and Description |
---|
WstxInputFactory() |
Modifier and Type | Method and Description |
---|---|
void |
addCachedDTD(DTDId id,
DTDSubset extSubset) |
void |
addSymbol(String symbol)
Method that can be used to ensure that specified symbol is
contained in the shared symbol table.
|
void |
configureForConvenience() |
void |
configureForLowMemUsage() |
void |
configureForRoundTripping() |
void |
configureForSpeed() |
void |
configureForXmlConformance() |
protected XMLEventAllocator |
createEventAllocator() |
XMLEventReader |
createFilteredReader(XMLEventReader reader,
EventFilter filter) |
XMLStreamReader |
createFilteredReader(XMLStreamReader reader,
StreamFilter filter) |
ReaderConfig |
createPrivateConfig()
Method called to construct a copy of the factory's configuration
object, such that two will be unlinked (changes to one are not
reflect in the other).
|
protected org.codehaus.stax2.XMLStreamReader2 |
createSR(File f,
boolean forER,
boolean autoCloseInput) |
org.codehaus.stax2.XMLStreamReader2 |
createSR(ReaderConfig cfg,
String systemId,
InputBootstrapper bs,
boolean forER,
boolean autoCloseInput)
Method that is eventually called to create a (full) stream read
instance.
|
org.codehaus.stax2.XMLStreamReader2 |
createSR(ReaderConfig cfg,
SystemId systemId,
InputBootstrapper bs,
boolean forER,
boolean autoCloseInput) |
protected org.codehaus.stax2.XMLStreamReader2 |
createSR(ReaderConfig cfg,
URL src,
boolean forER,
boolean autoCloseInput) |
protected org.codehaus.stax2.XMLStreamReader2 |
createSR(Source src,
boolean forER)
Another internal factory method, used when dealing with a generic
Source base type.
|
protected org.codehaus.stax2.XMLStreamReader2 |
createSR(SystemId systemId,
InputStream in,
String enc,
boolean forER,
boolean autoCloseInput) |
protected org.codehaus.stax2.XMLStreamReader2 |
createSR(SystemId systemId,
Reader r,
boolean forER,
boolean autoCloseInput) |
org.codehaus.stax2.XMLEventReader2 |
createXMLEventReader(File f) |
XMLEventReader |
createXMLEventReader(InputStream in) |
XMLEventReader |
createXMLEventReader(InputStream in,
String enc) |
XMLEventReader |
createXMLEventReader(Reader r) |
XMLEventReader |
createXMLEventReader(Source source) |
XMLEventReader |
createXMLEventReader(String systemId,
InputStream in) |
XMLEventReader |
createXMLEventReader(String systemId,
Reader r) |
org.codehaus.stax2.XMLEventReader2 |
createXMLEventReader(URL src) |
XMLEventReader |
createXMLEventReader(XMLStreamReader sr) |
org.codehaus.stax2.XMLStreamReader2 |
createXMLStreamReader(File f)
Convenience factory method that allows for parsing a document
stored in the specified file.
|
XMLStreamReader |
createXMLStreamReader(InputStream in) |
XMLStreamReader |
createXMLStreamReader(InputStream in,
String enc) |
XMLStreamReader |
createXMLStreamReader(Reader r) |
XMLStreamReader |
createXMLStreamReader(Source src) |
XMLStreamReader |
createXMLStreamReader(String systemId,
InputStream in) |
XMLStreamReader |
createXMLStreamReader(String systemId,
Reader r) |
org.codehaus.stax2.XMLStreamReader2 |
createXMLStreamReader(URL src) |
DTDSubset |
findCachedDTD(DTDId id)
Method readers created by this factory call, if DTD caching is
enabled, to see if an external DTD (subset) has been parsed
and cached earlier.
|
ReaderConfig |
getConfig() |
XMLEventAllocator |
getEventAllocator() |
Object |
getProperty(String name) |
XMLReporter |
getXMLReporter() |
XMLResolver |
getXMLResolver() |
boolean |
isPropertySupported(String name) |
void |
setEventAllocator(XMLEventAllocator allocator) |
void |
setProperty(String propName,
Object value) |
void |
setXMLReporter(XMLReporter r) |
void |
setXMLResolver(XMLResolver r)
Note: it's preferable to use Wstx-specific
ReaderConfig.setEntityResolver(javax.xml.stream.XMLResolver)
instead, if possible, since this just wraps passed in resolver. |
void |
updateSymbolTable(SymbolTable t)
Method individual parsers call to pass back symbol table that
they updated, which may be useful for other parser to reuse, instead
of previous base symbol table.
|
newFactory, newFactory, newInstance, newInstance
protected final ReaderConfig mConfig
protected XMLEventAllocator mAllocator
protected SimpleCache<DTDId,DTDSubset> mDTDCache
public void addSymbol(String symbol)
public DTDSubset findCachedDTD(DTDId id)
findCachedDTD
in interface ReaderCreator
public void updateSymbolTable(SymbolTable t)
Note: parser is only to call this method, if passed-in symbol table was modified, ie new entry/ies were added in addition to whatever was in root table.
updateSymbolTable
in interface ReaderCreator
public void addCachedDTD(DTDId id, DTDSubset extSubset)
addCachedDTD
in interface ReaderCreator
public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter)
createFilteredReader
in class XMLInputFactory
public XMLStreamReader createFilteredReader(XMLStreamReader reader, StreamFilter filter) throws XMLStreamException
createFilteredReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(InputStream in) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(InputStream in, String enc) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(Reader r) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(Source source) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(String systemId, InputStream in) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(String systemId, Reader r) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLEventReader createXMLEventReader(XMLStreamReader sr) throws XMLStreamException
createXMLEventReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(InputStream in) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(InputStream in, String enc) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(Reader r) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(Source src) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(String systemId, InputStream in) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public XMLStreamReader createXMLStreamReader(String systemId, Reader r) throws XMLStreamException
createXMLStreamReader
in class XMLInputFactory
XMLStreamException
public Object getProperty(String name)
getProperty
in class XMLInputFactory
public void setProperty(String propName, Object value)
setProperty
in class XMLInputFactory
public XMLEventAllocator getEventAllocator()
getEventAllocator
in class XMLInputFactory
public XMLReporter getXMLReporter()
getXMLReporter
in class XMLInputFactory
public XMLResolver getXMLResolver()
getXMLResolver
in class XMLInputFactory
public boolean isPropertySupported(String name)
isPropertySupported
in class XMLInputFactory
public void setEventAllocator(XMLEventAllocator allocator)
setEventAllocator
in class XMLInputFactory
public void setXMLReporter(XMLReporter r)
setXMLReporter
in class XMLInputFactory
public void setXMLResolver(XMLResolver r)
ReaderConfig.setEntityResolver(javax.xml.stream.XMLResolver)
instead, if possible, since this just wraps passed in resolver.setXMLResolver
in class XMLInputFactory
public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(URL src) throws XMLStreamException
createXMLEventReader
in class org.codehaus.stax2.XMLInputFactory2
XMLStreamException
public org.codehaus.stax2.XMLEventReader2 createXMLEventReader(File f) throws XMLStreamException
createXMLEventReader
in class org.codehaus.stax2.XMLInputFactory2
XMLStreamException
public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(URL src) throws XMLStreamException
createXMLStreamReader
in class org.codehaus.stax2.XMLInputFactory2
XMLStreamException
public org.codehaus.stax2.XMLStreamReader2 createXMLStreamReader(File f) throws XMLStreamException
createXMLStreamReader
in class org.codehaus.stax2.XMLInputFactory2
XMLStreamException
public void configureForXmlConformance()
configureForXmlConformance
in class org.codehaus.stax2.XMLInputFactory2
public void configureForConvenience()
configureForConvenience
in class org.codehaus.stax2.XMLInputFactory2
public void configureForSpeed()
configureForSpeed
in class org.codehaus.stax2.XMLInputFactory2
public void configureForLowMemUsage()
configureForLowMemUsage
in class org.codehaus.stax2.XMLInputFactory2
public void configureForRoundTripping()
configureForRoundTripping
in class org.codehaus.stax2.XMLInputFactory2
public ReaderConfig getConfig()
public org.codehaus.stax2.XMLStreamReader2 createSR(ReaderConfig cfg, String systemId, InputBootstrapper bs, boolean forER, boolean autoCloseInput) throws XMLStreamException
Note: defined as public method because it needs to be called by SAX implementation.
systemId
- System id used for this reader (if any)bs
- Bootstrapper to use for creating actual underlying
physical readerforER
- Flag to indicate whether it will be used via
Event API (will affect some configuration settings), true if it
will be, false if not (or not known)autoCloseInput
- Whether the underlying input source should be
actually closed when encountering EOF, or when close()
is called. Will be true for input sources that are automatically
managed by stream reader (input streams created for
URL
and File
arguments, or when
configuration settings indicate auto-closing is to be enabled
(the default value is false as per Stax 1.0 specs).XMLStreamException
public org.codehaus.stax2.XMLStreamReader2 createSR(ReaderConfig cfg, SystemId systemId, InputBootstrapper bs, boolean forER, boolean autoCloseInput) throws XMLStreamException
XMLStreamException
protected org.codehaus.stax2.XMLStreamReader2 createSR(SystemId systemId, InputStream in, String enc, boolean forER, boolean autoCloseInput) throws XMLStreamException
XMLStreamException
protected org.codehaus.stax2.XMLStreamReader2 createSR(ReaderConfig cfg, URL src, boolean forER, boolean autoCloseInput) throws XMLStreamException
XMLStreamException
protected org.codehaus.stax2.XMLStreamReader2 createSR(SystemId systemId, Reader r, boolean forER, boolean autoCloseInput) throws XMLStreamException
XMLStreamException
protected org.codehaus.stax2.XMLStreamReader2 createSR(File f, boolean forER, boolean autoCloseInput) throws XMLStreamException
XMLStreamException
protected org.codehaus.stax2.XMLStreamReader2 createSR(Source src, boolean forER) throws XMLStreamException
forER
- True, if the reader is being constructed to be used
by an event reader; false if it is not (or the purpose is not known)XMLStreamException
protected XMLEventAllocator createEventAllocator()
public ReaderConfig createPrivateConfig()
Note: only public so that other woodstox components outside of this package can access it.
Copyright © 2012–2015 FasterXML. All rights reserved.