public class MinimalInputFactory extends java.lang.Object implements ReaderCreator, InputConfigFlags
Unfortunately, the way StAX 1.0 is defined, this class can NOT be
the base class of the full input factory, without getting references
to most of StAX event classes. It does however have lots of shared
(cut'n pasted code) with WstxInputFactory
.
Hopefully in future this problem can be resolved.
Regarding Stax2 extensions: they are not included either (since just like stax 1.0, it does have event API extensions) in this minimal subset.
Implementation note: since entity objects are built directly on top
of StAX events Objects, couple of event classes (specifically,
EntityDeclaration
and the generic
base class, XMLEvent
, and Woodstox
classes that implement them) will still need to be included in the
subset.
Modifier and Type | Field and Description |
---|---|
protected ReaderConfig |
mConfig |
protected boolean |
mIsMinimal
Flag used to distinguish "real" minimal implementations and
extending non-minimal ones
|
CFG_AUTO_CLOSE_INPUT, CFG_CACHE_DTDS, CFG_CACHE_DTDS_BY_PUBLIC_ID, CFG_COALESCE_TEXT, CFG_INTERN_NS_URIS, CFG_LAZY_PARSING, CFG_NAMESPACE_AWARE, CFG_NORMALIZE_ATTR_VALUES, 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_VALIDATE_AGAINST_DTD, CFG_VALIDATE_TEXT_CHARS, CFG_XMLID_TYPING, CFG_XMLID_UNIQ_CHECKS
Modifier | Constructor and Description |
---|---|
|
MinimalInputFactory() |
protected |
MinimalInputFactory(boolean minimal) |
Modifier and Type | Method and Description |
---|---|
void |
addCachedDTD(DTDId id,
DTDSubset extSubset) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.io.InputStream in) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.io.InputStream in,
java.lang.String enc) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.io.Reader r) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(javax.xml.transform.Source source) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.lang.String systemId,
java.io.InputStream in) |
javax.xml.stream.XMLStreamReader |
createXMLStreamReader(java.lang.String systemId,
java.io.Reader r) |
protected javax.xml.stream.XMLStreamReader |
doCreateSR(BranchingReaderSource input,
ReaderConfig cfg,
InputBootstrapper bs) |
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() |
java.lang.Object |
getProperty(java.lang.String name) |
javax.xml.stream.XMLReporter |
getXMLReporter() |
javax.xml.stream.XMLResolver |
getXMLResolver() |
boolean |
isPropertySupported(java.lang.String name) |
static MinimalInputFactory |
newMinimalInstance()
Need to add this method, since we have no base class to do it...
|
void |
setProperty(java.lang.String propName,
java.lang.Object value) |
void |
setXMLReporter(javax.xml.stream.XMLReporter r) |
void |
setXMLResolver(javax.xml.stream.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.
|
protected final boolean mIsMinimal
protected final ReaderConfig mConfig
public MinimalInputFactory()
protected MinimalInputFactory(boolean minimal)
public static MinimalInputFactory newMinimalInstance()
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 javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.InputStream in, java.lang.String enc) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.io.Reader r) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public javax.xml.stream.XMLStreamReader createXMLStreamReader(javax.xml.transform.Source source) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.lang.String systemId, java.io.InputStream in) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public javax.xml.stream.XMLStreamReader createXMLStreamReader(java.lang.String systemId, java.io.Reader r) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public java.lang.Object getProperty(java.lang.String name)
public void setProperty(java.lang.String propName, java.lang.Object value)
public javax.xml.stream.XMLReporter getXMLReporter()
public javax.xml.stream.XMLResolver getXMLResolver()
public boolean isPropertySupported(java.lang.String name)
public void setXMLReporter(javax.xml.stream.XMLReporter r)
public void setXMLResolver(javax.xml.stream.XMLResolver r)
ReaderConfig.setEntityResolver(javax.xml.stream.XMLResolver)
instead, if possible, since this just wraps passed in resolver.public ReaderConfig getConfig()
protected javax.xml.stream.XMLStreamReader doCreateSR(BranchingReaderSource input, ReaderConfig cfg, InputBootstrapper bs) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException