Package org.apache.xerces.impl
Class XMLDocumentScannerImpl
java.lang.Object
org.apache.xerces.impl.XMLScanner
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
org.apache.xerces.impl.XMLDocumentScannerImpl
- All Implemented Interfaces:
XMLEntityHandler,org.apache.xerces.xni.parser.XMLComponent,org.apache.xerces.xni.parser.XMLDocumentScanner,org.apache.xerces.xni.parser.XMLDocumentSource
- Direct Known Subclasses:
XML11DocumentScannerImpl,XMLNSDocumentScannerImpl
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
INTERNAL:
- Usage of this class is not supported. It may be altered or removed at any time.
- Version:
- $Id: XMLDocumentScannerImpl.java 572055 2007-09-02 17:55:43Z mrglavas $
- Author:
- Glenn Marcy, IBM, Andy Clark, IBM, Arnaud Le Hors, IBM, Eric Ye, IBM
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classDispatcher to handle content scanning.protected final classDispatcher to handle the internal and external DTD subsets.protected final classDispatcher to handle prolog scanning.protected final classDispatcher to handle trailing miscellaneous section scanning.protected final classDispatcher to handle XMLDecl scanning.Nested classes/interfaces inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
XMLDocumentFragmentScannerImpl.Dispatcher, XMLDocumentFragmentScannerImpl.ElementStack, XMLDocumentFragmentScannerImpl.FragmentContentDispatcher -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringFeature identifier: load external DTD.protected static final StringProperty identifier: DTD scanner.protected booleanDisallow doctype declaration.protected StringDoctype name.protected StringDoctype declaration public identifier.protected StringDoctype declaration system identifier.protected final XMLDocumentFragmentScannerImpl.DispatcherDTD dispatcher.protected org.apache.xerces.xni.parser.XMLDTDScannerDTD scanner.protected booleanLoad external DTD.protected org.apache.xerces.xni.NamespaceContextNamespace support.protected final XMLDocumentFragmentScannerImpl.DispatcherProlog dispatcher.protected booleanScanning DTD.protected booleanSeen doctype declaration.protected final XMLDocumentFragmentScannerImpl.DispatcherTrailing miscellaneous section dispatcher.protected ValidationManagerValidation manager .protected final XMLDocumentFragmentScannerImpl.DispatcherXML declaration dispatcher.protected static final StringFeature identifier: load external DTD.protected static final Stringproperty identifier: NamespaceContextprotected static final intScanner state: open DTD external subset.protected static final intScanner state: DTD external declarations.protected static final intScanner state: DTD internal declarations.protected static final intScanner state: prolog.protected static final intScanner state: trailing misc.protected static final intScanner state: XML declaration.protected static final Stringproperty identifier: ValidationManagerFields inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
DEBUG_CONTENT_SCANNING, ENTITY_RESOLVER, fAttributeQName, fAttributes, fContentDispatcher, fCurrentElement, fDispatcher, fDocumentHandler, fElementQName, fElementStack, fEntityStack, fExternalSubsetResolver, fHasExternalDTD, fInScanContent, fIsEntityDeclaredVC, fMarkupDepth, fNotifyBuiltInRefs, fScannerState, fStandalone, fTempString, fTempString2, NAMESPACES, NOTIFY_BUILTIN_REFS, SCANNER_STATE_CDATA, SCANNER_STATE_COMMENT, SCANNER_STATE_CONTENT, SCANNER_STATE_DOCTYPE, SCANNER_STATE_END_OF_INPUT, SCANNER_STATE_PI, SCANNER_STATE_REFERENCE, SCANNER_STATE_ROOT_ELEMENT, SCANNER_STATE_START_OF_MARKUP, SCANNER_STATE_TERMINATED, SCANNER_STATE_TEXT_DECLFields inherited from class org.apache.xerces.impl.XMLScanner
DEBUG_ATTR_NORMALIZATION, ENTITY_MANAGER, ERROR_REPORTER, fAmpSymbol, fAposSymbol, fCharRefLiteral, fEncodingSymbol, fEntityDepth, fEntityManager, fEntityScanner, fErrorReporter, fGtSymbol, fLtSymbol, fNamespaces, fNotifyCharRefs, fParserSettings, fQuotSymbol, fReportEntity, fResourceIdentifier, fScanningAttribute, fStandaloneSymbol, fSymbolTable, fValidation, fVersionSymbol, NOTIFY_CHAR_REFS, PARSER_SETTINGS, SYMBOL_TABLE, VALIDATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a content dispatcher.voidThis method notifies the end of an entity.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.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.String[]Returns a list of feature identifiers that are recognized by this component.String[]Returns a list of property identifiers that are recognized by this component.protected StringgetScannerStateName(int state) Returns the scanner state name.voidreset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) Resets the component.protected booleanScans a doctype declaration.voidsetFeature(String featureId, boolean state) Sets the state of a feature.voidsetInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource) Sets the input source.voidsetProperty(String propertyId, Object value) Sets the value of a property.voidstartEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier identifier, String encoding, org.apache.xerces.xni.Augmentations augs) This method notifies of the start of an entity.Methods inherited from class org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
getDispatcherName, getDocumentHandler, handleEndElement, scanAttribute, scanCDATASection, scanCharReference, scanComment, scanContent, scanDocument, scanEndElement, scanEntityReference, scanPIData, scanStartElement, scanStartElementAfterName, scanStartElementName, scanXMLDeclOrTextDecl, setDispatcher, setDocumentHandler, setScannerStateMethods inherited from class org.apache.xerces.impl.XMLScanner
getFeature, getVersionNotSupportedKey, isInvalid, isInvalidLiteral, isUnchangedByNormalization, isValidNameChar, isValidNameStartChar, isValidNameStartHighSurrogate, isValidNCName, normalizeWhitespace, normalizeWhitespace, reportFatalError, reset, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl, versionSupported
-
Field Details
-
SCANNER_STATE_XML_DECL
protected static final int SCANNER_STATE_XML_DECLScanner state: XML declaration.- See Also:
-
SCANNER_STATE_PROLOG
protected static final int SCANNER_STATE_PROLOGScanner state: prolog.- See Also:
-
SCANNER_STATE_TRAILING_MISC
protected static final int SCANNER_STATE_TRAILING_MISCScanner state: trailing misc.- See Also:
-
SCANNER_STATE_DTD_INTERNAL_DECLS
protected static final int SCANNER_STATE_DTD_INTERNAL_DECLSScanner state: DTD internal declarations.- See Also:
-
SCANNER_STATE_DTD_EXTERNAL
protected static final int SCANNER_STATE_DTD_EXTERNALScanner state: open DTD external subset.- See Also:
-
SCANNER_STATE_DTD_EXTERNAL_DECLS
protected static final int SCANNER_STATE_DTD_EXTERNAL_DECLSScanner state: DTD external declarations.- See Also:
-
LOAD_EXTERNAL_DTD
Feature identifier: load external DTD.- See Also:
-
DISALLOW_DOCTYPE_DECL_FEATURE
Feature identifier: load external DTD.- See Also:
-
DTD_SCANNER
Property identifier: DTD scanner.- See Also:
-
VALIDATION_MANAGER
property identifier: ValidationManager- See Also:
-
NAMESPACE_CONTEXT
property identifier: NamespaceContext- See Also:
-
fDTDScanner
protected org.apache.xerces.xni.parser.XMLDTDScanner fDTDScannerDTD scanner. -
fValidationManager
Validation manager . -
fScanningDTD
protected boolean fScanningDTDScanning DTD. -
fDoctypeName
Doctype name. -
fDoctypePublicId
Doctype declaration public identifier. -
fDoctypeSystemId
Doctype declaration system identifier. -
fNamespaceContext
protected org.apache.xerces.xni.NamespaceContext fNamespaceContextNamespace support. -
fLoadExternalDTD
protected boolean fLoadExternalDTDLoad external DTD. -
fDisallowDoctype
protected boolean fDisallowDoctypeDisallow doctype declaration. -
fSeenDoctypeDecl
protected boolean fSeenDoctypeDeclSeen doctype declaration. -
fXMLDeclDispatcher
XML declaration dispatcher. -
fPrologDispatcher
Prolog dispatcher. -
fDTDDispatcher
DTD dispatcher. -
fTrailingMiscDispatcher
Trailing miscellaneous section dispatcher.
-
-
Constructor Details
-
XMLDocumentScannerImpl
public XMLDocumentScannerImpl()Default constructor.
-
-
Method Details
-
setInputSource
public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource) throws IOException Sets the input source.- Specified by:
setInputSourcein interfaceorg.apache.xerces.xni.parser.XMLDocumentScanner- Overrides:
setInputSourcein classXMLDocumentFragmentScannerImpl- Parameters:
inputSource- The input source.- Throws:
IOException- Thrown on i/o error.
-
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.- Specified by:
resetin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
resetin classXMLDocumentFragmentScannerImpl- Parameters:
componentManager- The component manager.
-
getRecognizedFeatures
Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.- Specified by:
getRecognizedFeaturesin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getRecognizedFeaturesin classXMLDocumentFragmentScannerImpl
-
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.
- Specified by:
setFeaturein interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
setFeaturein classXMLDocumentFragmentScannerImpl- Parameters:
featureId- The feature identifier.state- The state of the feature.
-
getRecognizedProperties
Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.- Specified by:
getRecognizedPropertiesin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getRecognizedPropertiesin classXMLDocumentFragmentScannerImpl
-
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.
- Specified by:
setPropertyin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
setPropertyin classXMLDocumentFragmentScannerImpl- Parameters:
propertyId- The property identifier.value- The value of the property.
-
getFeatureDefault
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.- Specified by:
getFeatureDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getFeatureDefaultin classXMLDocumentFragmentScannerImpl- Parameters:
featureId- The feature identifier.- Since:
- Xerces 2.2.0
-
getPropertyDefault
Returns the default state for a property, or null if this component does not want to report a default value for this property.- Specified by:
getPropertyDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent- Overrides:
getPropertyDefaultin classXMLDocumentFragmentScannerImpl- Parameters:
propertyId- The property identifier.- Since:
- Xerces 2.2.0
-
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.- Specified by:
startEntityin interfaceXMLEntityHandler- Overrides:
startEntityin classXMLDocumentFragmentScannerImpl- Parameters:
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).augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
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.- Specified by:
endEntityin interfaceXMLEntityHandler- Overrides:
endEntityin classXMLDocumentFragmentScannerImpl- Parameters:
name- The name of the entity.augs- Additional information that may include infoset augmentations- Throws:
org.apache.xerces.xni.XNIException- Thrown by handler to signal an error.
-
createContentDispatcher
Creates a content dispatcher.- Overrides:
createContentDispatcherin classXMLDocumentFragmentScannerImpl
-
scanDoctypeDecl
Scans a doctype declaration.- Throws:
IOExceptionorg.apache.xerces.xni.XNIException
-
getScannerStateName
Returns the scanner state name.- Overrides:
getScannerStateNamein classXMLDocumentFragmentScannerImpl
-