This class is responsible for scanning XML document structure
and content. The scanner acts as the source for the document
information which is communicated to the document handler.
This component requires the following features and properties from the
component manager that uses it:
- http://xml.org/sax/features/namespaces
- http://xml.org/sax/features/validation
- http://apache.org/xml/features/nonvalidating/load-external-dtd
- http://apache.org/xml/features/scanner/notify-char-refs
- http://apache.org/xml/features/scanner/notify-builtin-refs
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/entity-manager
- http://apache.org/xml/properties/internal/dtd-scanner
DISALLOW_DOCTYPE_DECL_FEATURE
protected static final String DISALLOW_DOCTYPE_DECL_FEATURE
Feature identifier: load external DTD.
DTD_SCANNER
protected static final String DTD_SCANNER
Property identifier: DTD scanner.
LOAD_EXTERNAL_DTD
protected static final String LOAD_EXTERNAL_DTD
Feature identifier: load external DTD.
NAMESPACE_CONTEXT
protected static final String NAMESPACE_CONTEXT
property identifier: NamespaceContext
SCANNER_STATE_DTD_EXTERNAL
protected static final int SCANNER_STATE_DTD_EXTERNAL
Scanner state: open DTD external subset.
SCANNER_STATE_DTD_EXTERNAL_DECLS
protected static final int SCANNER_STATE_DTD_EXTERNAL_DECLS
Scanner state: DTD external declarations.
SCANNER_STATE_DTD_INTERNAL_DECLS
protected static final int SCANNER_STATE_DTD_INTERNAL_DECLS
Scanner state: DTD internal declarations.
SCANNER_STATE_PROLOG
protected static final int SCANNER_STATE_PROLOG
Scanner state: prolog.
SCANNER_STATE_TRAILING_MISC
protected static final int SCANNER_STATE_TRAILING_MISC
Scanner state: trailing misc.
SCANNER_STATE_XML_DECL
protected static final int SCANNER_STATE_XML_DECL
Scanner state: XML declaration.
VALIDATION_MANAGER
protected static final String VALIDATION_MANAGER
property identifier: ValidationManager
fDTDScanner
protected org.apache.xerces.xni.parser.XMLDTDScanner fDTDScanner
DTD scanner.
fDisallowDoctype
protected boolean fDisallowDoctype
Disallow doctype declaration.
fDoctypeName
protected String fDoctypeName
Doctype name.
fDoctypePublicId
protected String fDoctypePublicId
Doctype declaration public identifier.
fDoctypeSystemId
protected String fDoctypeSystemId
Doctype declaration system identifier.
fLoadExternalDTD
protected boolean fLoadExternalDTD
Load external DTD.
fNamespaceContext
protected org.apache.xerces.xni.NamespaceContext fNamespaceContext
Namespace support.
fScanningDTD
protected boolean fScanningDTD
Scanning DTD.
fSeenDoctypeDecl
protected boolean fSeenDoctypeDecl
Seen doctype declaration.
endEntity
public void endEntity(String name,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
This method notifies the end of an entity. The DTD has the pseudo-name
of "[dtd]" parameter entity names start with '%'; and general entities
are just specified by their name.
- endEntity in interface XMLEntityHandler
- endEntity in interface XMLDocumentFragmentScannerImpl
name
- The name of the entity.
org.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.
getFeatureDefault
public Boolean getFeatureDefault(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.
- getFeatureDefault in interface org.apache.xerces.xni.parser.XMLComponent
- getFeatureDefault in interface XMLDocumentFragmentScannerImpl
featureId
- The feature identifier.
getPropertyDefault
public Object getPropertyDefault(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.
- getPropertyDefault in interface org.apache.xerces.xni.parser.XMLComponent
- getPropertyDefault in interface XMLDocumentFragmentScannerImpl
propertyId
- The property identifier.
reset
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Resets the component. The component can query the component manager
about any features and properties that affect the operation of the
component.
- reset in interface org.apache.xerces.xni.parser.XMLComponent
- reset in interface XMLDocumentFragmentScannerImpl
componentManager
- The component manager.
scanDoctypeDecl
protected boolean scanDoctypeDecl()
throws IOException,
org.apache.xerces.xni.XNIException
Scans a doctype declaration.
setFeature
public void setFeature(String featureId,
boolean state)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the state of a feature. This method is called by the component
manager any time after reset when a feature changes state.
Note: Components should silently ignore features
that do not affect the operation of the component.
- setFeature in interface org.apache.xerces.xni.parser.XMLComponent
- setFeature in interface XMLDocumentFragmentScannerImpl
featureId
- The feature identifier.state
- The state of the feature.
setInputSource
public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
throws IOException
Sets the input source.
- setInputSource in interface XMLDocumentFragmentScannerImpl
inputSource
- The input source.
setProperty
public void setProperty(String propertyId,
Object value)
throws org.apache.xerces.xni.parser.XMLConfigurationException
Sets the value of a property. This method is called by the component
manager any time after reset when a property changes value.
Note: Components should silently ignore properties
that do not affect the operation of the component.
- setProperty in interface org.apache.xerces.xni.parser.XMLComponent
- setProperty in interface XMLDocumentFragmentScannerImpl
propertyId
- The property identifier.value
- The value of the property.
startEntity
public void startEntity(String name,
org.apache.xerces.xni.XMLResourceIdentifier identifier,
String encoding,
org.apache.xerces.xni.Augmentations augs)
throws org.apache.xerces.xni.XNIException
This method notifies of the start of an entity. The DTD has the
pseudo-name of "[dtd]" parameter entity names start with '%'; and
general entities are just specified by their name.
- startEntity in interface XMLEntityHandler
- startEntity in interface XMLDocumentFragmentScannerImpl
name
- The name of the entity.identifier
- The resource identifier.encoding
- The auto-detected IANA encoding name of the entity
stream. This value will be null in those situations
where the entity encoding is not auto-detected (e.g.
internal entities or a document entity that is
parsed from a java.io.Reader).
org.apache.xerces.xni.XNIException
- Thrown by handler to signal an error.