|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.stax.MinimalInputFactory
public class MinimalInputFactory
Minimalistic input factory, which implements just the basic XML parsing functionality, including namespace handling. It does not support any DTD handling beyond simple skipping of internal subset; it also does not implement the Event API part of StAX specs. It is intended as the smallest valid (J2ME) subset of StAX as suggested by the specs.
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.
Field Summary | |
---|---|
protected ReaderConfig |
mConfig
|
protected boolean |
mIsMinimal
Flag used to distinguish "real" minimal implementations and extending non-minimal ones |
Constructor Summary | |
---|---|
|
MinimalInputFactory()
|
protected |
MinimalInputFactory(boolean minimal)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final boolean mIsMinimal
protected final ReaderConfig mConfig
Constructor Detail |
---|
public MinimalInputFactory()
protected MinimalInputFactory(boolean minimal)
Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |