public class XMLDocumentFragmentScannerImpl extends XMLScanner implements org.apache.xerces.xni.parser.XMLDocumentScanner, org.apache.xerces.xni.parser.XMLComponent, XMLEntityHandler
This component requires the following features and properties from the component manager that uses it:
| Modifier and Type | Class and Description | 
|---|---|
| protected static interface  | XMLDocumentFragmentScannerImpl.DispatcherThis interface defines an XML "event" dispatching model. | 
| protected static class  | XMLDocumentFragmentScannerImpl.ElementStackElement stack. | 
| protected class  | XMLDocumentFragmentScannerImpl.FragmentContentDispatcherDispatcher to handle content scanning. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected static boolean | DEBUG_CONTENT_SCANNINGDebug content dispatcher scanning. | 
| protected static java.lang.String | ENTITY_RESOLVERProperty identifier: entity resolver. | 
| protected org.apache.xerces.xni.QName | fAttributeQNameAttribute QName. | 
| protected XMLAttributesImpl | fAttributesElement attributes. | 
| protected XMLDocumentFragmentScannerImpl.Dispatcher | fContentDispatcherContent dispatcher. | 
| protected org.apache.xerces.xni.QName | fCurrentElementCurrent element. | 
| protected XMLDocumentFragmentScannerImpl.Dispatcher | fDispatcherActive dispatcher. | 
| protected org.apache.xerces.xni.XMLDocumentHandler | fDocumentHandlerDocument handler. | 
| protected org.apache.xerces.xni.QName | fElementQNameElement QName. | 
| protected XMLDocumentFragmentScannerImpl.ElementStack | fElementStackElement stack. | 
| protected int[] | fEntityStackEntity stack. | 
| protected ExternalSubsetResolver | fExternalSubsetResolverExternal subset resolver. | 
| protected boolean | fHasExternalDTDhas external dtd | 
| protected boolean | fInScanContentSubScanner state: inside scanContent method. | 
| protected boolean | fIsEntityDeclaredVCTrue if [Entity Declared] is a VC; false if it is a WFC. | 
| protected int | fMarkupDepthMarkup depth. | 
| protected boolean | fNotifyBuiltInRefsNotify built-in references. | 
| protected int | fScannerStateScanner state. | 
| protected boolean | fStandaloneStandalone. | 
| protected org.apache.xerces.xni.XMLString | fTempStringString. | 
| protected org.apache.xerces.xni.XMLString | fTempString2String. | 
| protected static java.lang.String | NAMESPACESFeature identifier: namespaces. | 
| protected static java.lang.String | NOTIFY_BUILTIN_REFSFeature identifier: notify built-in refereces. | 
| protected static int | SCANNER_STATE_CDATAScanner state: CDATA section. | 
| protected static int | SCANNER_STATE_COMMENTScanner state: comment. | 
| protected static int | SCANNER_STATE_CONTENTScanner state: content. | 
| protected static int | SCANNER_STATE_DOCTYPEScanner state: DOCTYPE. | 
| protected static int | SCANNER_STATE_END_OF_INPUTScanner state: end of input. | 
| protected static int | SCANNER_STATE_PIScanner state: processing instruction. | 
| protected static int | SCANNER_STATE_REFERENCEScanner state: reference. | 
| protected static int | SCANNER_STATE_ROOT_ELEMENTScanner state: root element. | 
| protected static int | SCANNER_STATE_START_OF_MARKUPScanner state: start of markup. | 
| protected static int | SCANNER_STATE_TERMINATEDScanner state: terminated. | 
| protected static int | SCANNER_STATE_TEXT_DECLScanner state: Text declaration. | 
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 and Description | 
|---|
| XMLDocumentFragmentScannerImpl()Default constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected XMLDocumentFragmentScannerImpl.Dispatcher | createContentDispatcher()Creates a content dispatcher. | 
| void | endEntity(java.lang.String name,
         org.apache.xerces.xni.Augmentations augs)This method notifies the end of an entity. | 
| java.lang.String | getDispatcherName(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher)Returns the dispatcher name. | 
| org.apache.xerces.xni.XMLDocumentHandler | getDocumentHandler()Returns the document handler | 
| 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. | 
| protected java.lang.String | getScannerStateName(int state)Returns the scanner state name. | 
| protected int | handleEndElement(org.apache.xerces.xni.QName element,
                boolean isEmpty)Handles the end element. | 
| void | reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)Resets the component. | 
| protected void | scanAttribute(org.apache.xerces.xni.XMLAttributes attributes)Scans an attribute. | 
| protected boolean | scanCDATASection(boolean complete)Scans a CDATA section. | 
| protected void | scanCharReference()Scans a character reference. | 
| protected void | scanComment()Scans a comment. | 
| protected int | scanContent()Scans element content. | 
| boolean | scanDocument(boolean complete)Scans a document. | 
| protected int | scanEndElement()Scans an end element. | 
| protected void | scanEntityReference()Scans an entity reference. | 
| protected void | scanPIData(java.lang.String target,
          org.apache.xerces.xni.XMLString data)Scans a processing data. | 
| protected boolean | scanStartElement()Scans a start element. | 
| protected boolean | scanStartElementAfterName()Scans the remainder of a start or empty tag after the element name. | 
| protected void | scanStartElementName()Scans the name of an element in a start or empty tag. | 
| protected void | scanXMLDeclOrTextDecl(boolean scanningTextDecl)Scans an XML or text declaration. | 
| protected void | setDispatcher(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher)Sets the dispatcher. | 
| void | setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler documentHandler)setDocumentHandler | 
| void | setFeature(java.lang.String featureId,
          boolean state)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. | 
| protected void | setScannerState(int state)Sets the scanner state. | 
| void | startEntity(java.lang.String name,
           org.apache.xerces.xni.XMLResourceIdentifier identifier,
           java.lang.String encoding,
           org.apache.xerces.xni.Augmentations augs)This method notifies of the start of an entity. | 
getFeature, getVersionNotSupportedKey, isInvalid, isInvalidLiteral, isUnchangedByNormalization, isValidNameChar, isValidNameStartChar, isValidNameStartHighSurrogate, isValidNCName, normalizeWhitespace, normalizeWhitespace, reportFatalError, reset, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl, versionSupportedprotected static final int SCANNER_STATE_START_OF_MARKUP
protected static final int SCANNER_STATE_COMMENT
protected static final int SCANNER_STATE_PI
protected static final int SCANNER_STATE_DOCTYPE
protected static final int SCANNER_STATE_ROOT_ELEMENT
protected static final int SCANNER_STATE_CONTENT
protected static final int SCANNER_STATE_REFERENCE
protected static final int SCANNER_STATE_END_OF_INPUT
protected static final int SCANNER_STATE_TERMINATED
protected static final int SCANNER_STATE_CDATA
protected static final int SCANNER_STATE_TEXT_DECL
protected static final java.lang.String NAMESPACES
protected static final java.lang.String NOTIFY_BUILTIN_REFS
protected static final java.lang.String ENTITY_RESOLVER
protected static final boolean DEBUG_CONTENT_SCANNING
protected org.apache.xerces.xni.XMLDocumentHandler fDocumentHandler
protected int[] fEntityStack
protected int fMarkupDepth
protected int fScannerState
protected boolean fInScanContent
protected boolean fHasExternalDTD
protected boolean fStandalone
protected boolean fIsEntityDeclaredVC
protected ExternalSubsetResolver fExternalSubsetResolver
protected org.apache.xerces.xni.QName fCurrentElement
protected final XMLDocumentFragmentScannerImpl.ElementStack fElementStack
protected boolean fNotifyBuiltInRefs
protected XMLDocumentFragmentScannerImpl.Dispatcher fDispatcher
protected final XMLDocumentFragmentScannerImpl.Dispatcher fContentDispatcher
protected final org.apache.xerces.xni.QName fElementQName
protected final org.apache.xerces.xni.QName fAttributeQName
protected final XMLAttributesImpl fAttributes
protected final org.apache.xerces.xni.XMLString fTempString
protected final org.apache.xerces.xni.XMLString fTempString2
public XMLDocumentFragmentScannerImpl()
public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
                    throws java.io.IOException
setInputSource in interface org.apache.xerces.xni.parser.XMLDocumentScannerinputSource - 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.XMLDocumentScannercomplete - 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.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionpublic void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
           throws org.apache.xerces.xni.parser.XMLConfigurationException
reset in interface org.apache.xerces.xni.parser.XMLComponentreset in class XMLScannercomponentManager - The component manager.SAXException - Thrown by component on initialization error.
                      For example, if a feature or property is
                      required for the operation of the component, the
                      component manager may throw a 
                      SAXNotRecognizedException or a
                      SAXNotSupportedException.org.apache.xerces.xni.parser.XMLConfigurationExceptionpublic java.lang.String[] getRecognizedFeatures()
getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponentpublic void setFeature(java.lang.String featureId,
              boolean state)
                throws org.apache.xerces.xni.parser.XMLConfigurationException
Note: Components should silently ignore features that do not affect the operation of the component.
setFeature in interface org.apache.xerces.xni.parser.XMLComponentsetFeature in class XMLScannerfeatureId - The feature identifier.state - The state of the feature.SAXNotRecognizedException - The component should not throw
                                   this exception.SAXNotSupportedException - The component should not throw
                                  this exception.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 java.lang.String[] getRecognizedProperties()
getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponentpublic void setProperty(java.lang.String propertyId,
               java.lang.Object value)
                 throws org.apache.xerces.xni.parser.XMLConfigurationException
Note: Components should silently ignore properties that do not affect the operation of the component.
setProperty in interface org.apache.xerces.xni.parser.XMLComponentsetProperty in class XMLScannerpropertyId - The property identifier.value - The value of the property.SAXNotRecognizedException - The component should not throw
                                   this exception.SAXNotSupportedException - The component should not throw
                                  this exception.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 java.lang.Boolean getFeatureDefault(java.lang.String featureId)
getFeatureDefault in interface org.apache.xerces.xni.parser.XMLComponentfeatureId - The feature identifier.public java.lang.Object getPropertyDefault(java.lang.String propertyId)
getPropertyDefault in interface org.apache.xerces.xni.parser.XMLComponentpropertyId - The property identifier.public void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler documentHandler)
setDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSourcedocumentHandler - public org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()
getDocumentHandler in interface org.apache.xerces.xni.parser.XMLDocumentSourcepublic void startEntity(java.lang.String name,
               org.apache.xerces.xni.XMLResourceIdentifier identifier,
               java.lang.String encoding,
               org.apache.xerces.xni.Augmentations augs)
                 throws org.apache.xerces.xni.XNIException
startEntity in interface XMLEntityHandlerstartEntity in class XMLScannername - 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 augmentationsorg.apache.xerces.xni.XNIException - Thrown by handler to signal an error.public void endEntity(java.lang.String name,
             org.apache.xerces.xni.Augmentations augs)
               throws org.apache.xerces.xni.XNIException
endEntity in interface XMLEntityHandlerendEntity in class XMLScannername - The name of the entity.augs - Additional information that may include infoset augmentationsorg.apache.xerces.xni.XNIException - Thrown by handler to signal an error.protected XMLDocumentFragmentScannerImpl.Dispatcher createContentDispatcher()
protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl)
                              throws java.io.IOException,
                                     org.apache.xerces.xni.XNIException
 [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
 [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
 [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" )
 [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
 [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
                 | ('"' ('yes' | 'no') '"'))
 [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
 scanningTextDecl - True if a text declaration is to
                         be scanned instead of an XML
                         declaration.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected void scanPIData(java.lang.String target,
              org.apache.xerces.xni.XMLString data)
                   throws java.io.IOException,
                          org.apache.xerces.xni.XNIException
scanPIData in class XMLScannertarget - The PI targetdata - The string to fill in with the datajava.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected void scanComment()
                    throws java.io.IOException,
                           org.apache.xerces.xni.XNIException
 [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 
 Note: Called after scanning past '<!--'
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected boolean scanStartElement()
                            throws java.io.IOException,
                                   org.apache.xerces.xni.XNIException
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [40] STag ::= '<' Name (S Attribute)* S? '>'
Note: This method assumes that the leading '<' character has been consumed.
Note: This method uses the fElementQName and fAttributes variables. The contents of these variables will be destroyed. The caller should copy important information out of these variables before calling this method.
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected void scanStartElementName()
                             throws java.io.IOException,
                                    org.apache.xerces.xni.XNIException
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionscanStartElement()protected boolean scanStartElementAfterName()
                                     throws java.io.IOException,
                                            org.apache.xerces.xni.XNIException
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionscanStartElement()protected void scanAttribute(org.apache.xerces.xni.XMLAttributes attributes)
                      throws java.io.IOException,
                             org.apache.xerces.xni.XNIException
[41] Attribute ::= Name Eq AttValue
Note: This method assumes that the next character on the stream is the first character of the attribute name.
Note: This method uses the fAttributeQName and fQName variables. The contents of these variables will be destroyed.
attributes - The attributes list for the scanned attribute.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected int scanContent()
                   throws java.io.IOException,
                          org.apache.xerces.xni.XNIException
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected boolean scanCDATASection(boolean complete)
                            throws java.io.IOException,
                                   org.apache.xerces.xni.XNIException
Note: This method uses the fTempString and fStringBuffer variables.
complete - True if the CDATA section is to be scanned
                 completely.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected int scanEndElement()
                      throws java.io.IOException,
                             org.apache.xerces.xni.XNIException
[42] ETag ::= '</' Name S? '>'
Note: This method uses the fElementQName variable. The contents of this variable will be destroyed. The caller should copy the needed information out of this variable before calling this method.
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected void scanCharReference()
                          throws java.io.IOException,
                                 org.apache.xerces.xni.XNIException
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected void scanEntityReference()
                            throws java.io.IOException,
                                   org.apache.xerces.xni.XNIException
java.io.IOException - Thrown if i/o error occurs.org.apache.xerces.xni.XNIException - Thrown if handler throws exception upon
                      notification.protected int handleEndElement(org.apache.xerces.xni.QName element,
                   boolean isEmpty)
                        throws org.apache.xerces.xni.XNIException
Note: This method uses the fQName variable. The contents of this variable will be destroyed.
element - The element.org.apache.xerces.xni.XNIException - Thrown if the handler throws a SAX exception
                      upon notification.protected final void setScannerState(int state)
state - The new scanner state.protected final void setDispatcher(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher)
dispatcher - The new dispatcher.protected java.lang.String getScannerStateName(int state)
public java.lang.String getDispatcherName(XMLDocumentFragmentScannerImpl.Dispatcher dispatcher)
Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.