|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.impl.XMLVersionDetector
This is not a full-function scanner; its sole job is to figure out the version of the document we're scanning, and create the correct document scanner, DTD scanner and entity scanner to deal with it. Any configuration that may parse documents from different versions of XML should place this object first in both the maqin and DTD pipelines, and take care to reset it in that position when it initiates a new parse.
Field Summary | |
---|---|
protected static java.lang.String |
DTD_PROCESSOR_PROPERTY
Property identifier: DTD processor. |
protected static java.lang.String |
DTD_SCANNER_PROPERTY
Property identifier: DTD scanner. |
protected static java.lang.String |
DTD_VALIDATOR_PROPERTY
Property identifier: DTD validator. |
protected static java.lang.String |
ENTITY_MANAGER
Property identifier: entity manager. |
protected static java.lang.String |
ERROR_REPORTER
Property identifier: error reporter. |
protected org.apache.xerces.xni.parser.XMLComponentManager |
fComponentManager
|
protected org.apache.xerces.xni.XMLDocumentHandler |
fDocumentHandler
|
protected org.apache.xerces.xni.XMLDTDContentModelHandler |
fDTDContentModelHandler
|
protected org.apache.xerces.xni.XMLDTDHandler |
fDTDHandler
|
protected XMLEntityManager |
fEntityManager
Entity manager. |
protected XMLEntityScanner |
fEntityScanner
Entity scanner. |
protected XMLErrorReporter |
fErrorReporter
Error reporter. |
protected XMLDocumentScannerImpl |
fRealDocumentScanner
|
protected XMLDTDScannerImpl |
fRealDTDScanner
|
protected SymbolTable |
fSymbolTable
Symbol table. |
protected static java.lang.String |
fVersionSymbol
Symbol: "version". |
protected XMLDocumentScannerImpl |
fXML10DocScanner
|
protected XMLDTDScannerImpl |
fXML10DTDScanner
|
protected XML11DocumentScannerImpl |
fXML11DocScanner
|
protected XML11DTDProcessor |
fXML11DTDProcessor
|
protected XML11DTDScannerImpl |
fXML11DTDScanner
|
protected XML11DTDValidator |
fXML11DTDValidator
|
protected XML11NamespaceBinder |
fXML11NamespaceBinder
|
protected static java.lang.String |
fXMLSymbol
|
protected static java.lang.String |
NAMESPACE_BINDER_PROPERTY
Property identifier: namespace binder. |
protected static java.lang.String |
SYMBOL_TABLE
Property identifier: symbol table. |
Constructor Summary | |
---|---|
XMLVersionDetector()
|
Method Summary | |
---|---|
org.apache.xerces.xni.XMLDocumentHandler |
getDocumentHandler()
Returns the document handler |
org.apache.xerces.xni.XMLDTDContentModelHandler |
getDTDContentModelHandler()
Returns the DTD content model handler. |
org.apache.xerces.xni.XMLDTDHandler |
getDTDHandler()
Returns the DTD handler. |
boolean |
getFeature(java.lang.String featureId)
|
java.lang.Boolean |
getFeatureDefault(java.lang.String featureId)
Returns the default state for a feature, or null if this component does not want to report a default value for this feature. |
java.lang.Object |
getPropertyDefault(java.lang.String propertyId)
Returns the default state for a property, or null if this component does not want to report a default value for this property. |
java.lang.String[] |
getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this component. |
java.lang.String[] |
getRecognizedProperties()
Returns a list of property identifiers that are recognized by this component. |
void |
reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
Resets the component. |
boolean |
scanDocument(boolean complete)
Scans a document. |
boolean |
scanDTDExternalSubset(boolean complete)
Scans the external subset of the document. |
boolean |
scanDTDInternalSubset(boolean complete,
boolean standalone,
boolean hasExternalSubset)
Scans the internal subset of the document. |
void |
setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler documentHandler)
setDocumentHandler |
void |
setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler handler)
Sets the DTD content model handler. |
void |
setDTDHandler(org.apache.xerces.xni.XMLDTDHandler handler)
Sets the DTD handler. |
void |
setFeature(java.lang.String featureId,
boolean value)
Sets the state of a feature. |
void |
setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
Sets the input source. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Sets the value of a property during parsing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String SYMBOL_TABLE
protected static final java.lang.String ERROR_REPORTER
protected static final java.lang.String ENTITY_MANAGER
protected static final java.lang.String DTD_SCANNER_PROPERTY
protected static final java.lang.String DTD_VALIDATOR_PROPERTY
protected static final java.lang.String DTD_PROCESSOR_PROPERTY
protected static final java.lang.String NAMESPACE_BINDER_PROPERTY
protected SymbolTable fSymbolTable
protected XMLErrorReporter fErrorReporter
protected XMLEntityManager fEntityManager
protected XMLEntityScanner fEntityScanner
protected org.apache.xerces.xni.parser.XMLComponentManager fComponentManager
protected org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
protected org.apache.xerces.xni.XMLDTDHandler fDTDHandler
protected org.apache.xerces.xni.XMLDTDContentModelHandler fDTDContentModelHandler
protected XMLDocumentScannerImpl fRealDocumentScanner
protected XMLDTDScannerImpl fRealDTDScanner
protected XMLDocumentScannerImpl fXML10DocScanner
protected XMLDTDScannerImpl fXML10DTDScanner
protected XML11DocumentScannerImpl fXML11DocScanner
protected XML11DTDScannerImpl fXML11DTDScanner
protected XML11DTDValidator fXML11DTDValidator
protected XML11DTDProcessor fXML11DTDProcessor
protected XML11NamespaceBinder fXML11NamespaceBinder
protected static final java.lang.String fVersionSymbol
protected static final java.lang.String fXMLSymbol
Constructor Detail |
public XMLVersionDetector()
Method Detail |
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) throws org.apache.xerces.xni.parser.XMLConfigurationException
org.apache.xerces.xni.parser.XMLComponent
reset
in interface org.apache.xerces.xni.parser.XMLComponent
componentManager
- The component manager.SAXException
- Throws exception if required features and
properties cannot be found.public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException
setProperty
in interface org.apache.xerces.xni.parser.XMLComponent
propertyId
- value
- public void setFeature(java.lang.String featureId, boolean value) throws org.apache.xerces.xni.parser.XMLConfigurationException
org.apache.xerces.xni.parser.XMLComponent
Note: Components should silently ignore features that do not affect the operation of the component.
setFeature
in interface org.apache.xerces.xni.parser.XMLComponent
org.apache.xerces.xni.parser.XMLComponent
featureId
- The feature identifier.state
- The state of the feature.org.apache.xerces.xni.parser.XMLConfigurationException
- Thrown for configuration error.
In general, components should
only throw this exception if
it is really
a critical error.public boolean getFeature(java.lang.String featureId) throws org.apache.xerces.xni.parser.XMLConfigurationException
public java.lang.String[] getRecognizedFeatures()
getRecognizedFeatures
in interface org.apache.xerces.xni.parser.XMLComponent
public java.lang.String[] getRecognizedProperties()
getRecognizedProperties
in interface org.apache.xerces.xni.parser.XMLComponent
public java.lang.Boolean getFeatureDefault(java.lang.String featureId)
getFeatureDefault
in interface org.apache.xerces.xni.parser.XMLComponent
featureId
- The feature identifier.public java.lang.Object getPropertyDefault(java.lang.String propertyId)
getPropertyDefault
in interface org.apache.xerces.xni.parser.XMLComponent
propertyId
- The property identifier.public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource) throws java.io.IOException
setInputSource
in interface org.apache.xerces.xni.parser.XMLDocumentScanner
inputSource
- The input source.java.io.IOException
- Thrown on i/o error.public boolean scanDocument(boolean complete) throws java.io.IOException, org.apache.xerces.xni.XNIException
scanDocument
in interface org.apache.xerces.xni.parser.XMLDocumentScanner
complete
- True if the scanner should scan the document
completely, pushing all events to the registered
document handler. A value of false indicates that
that the scanner should only scan the next portion
of the document and return. A scanner instance is
permitted to completely scan a document if it does
not support this "pull" scanning model.public void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler documentHandler)
setDocumentHandler
in interface org.apache.xerces.xni.parser.XMLDocumentSource
documentHandler
- public org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
getDocumentHandler
in interface org.apache.xerces.xni.parser.XMLDocumentSource
public void setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler handler)
setDTDContentModelHandler
in interface org.apache.xerces.xni.parser.XMLDTDContentModelSource
public org.apache.xerces.xni.XMLDTDContentModelHandler getDTDContentModelHandler()
getDTDContentModelHandler
in interface org.apache.xerces.xni.parser.XMLDTDContentModelSource
public void setDTDHandler(org.apache.xerces.xni.XMLDTDHandler handler)
setDTDHandler
in interface org.apache.xerces.xni.parser.XMLDTDSource
public org.apache.xerces.xni.XMLDTDHandler getDTDHandler()
getDTDHandler
in interface org.apache.xerces.xni.parser.XMLDTDSource
public boolean scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) throws java.io.IOException, org.apache.xerces.xni.XNIException
scanDTDInternalSubset
in interface org.apache.xerces.xni.parser.XMLDTDScanner
complete
- True if the scanner should scan the document
completely, pushing all events to the registered
document handler. A value of false indicates that
that the scanner should only scan the next portion
of the document and return. A scanner instance is
permitted to completely scan a document if it does
not support this "pull" scanning model.standalone
- True if the document was specified as standalone.
This value is important for verifying certain
well-formedness constraints.hasExternalDTD
- True if the document has an external DTD.
This allows the scanner to properly notify
the handler of the end of the DTD in the
absence of an external subset.public boolean scanDTDExternalSubset(boolean complete) throws java.io.IOException, org.apache.xerces.xni.XNIException
scanDTDExternalSubset
in interface org.apache.xerces.xni.parser.XMLDTDScanner
complete
- True if the scanner should scan the document
completely, pushing all events to the registered
document handler. A value of false indicates that
that the scanner should only scan the next portion
of the document and return. A scanner instance is
permitted to completely scan a document if it does
not support this "pull" scanning model.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |