java.lang.Object | ||
↳ | org.apache.xerces.impl.XMLScanner | |
↳ | org.apache.xerces.impl.XMLDocumentFragmentScannerImpl |
Known Direct Subclasses |
Known Indirect Subclasses |
This class is responsible for scanning the structure and content of document fragments. 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:
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
XMLDocumentFragmentScannerImpl.Dispatcher | This interface defines an XML "event" dispatching model. | ||||||||||
XMLDocumentFragmentScannerImpl.ElementStack | Element stack. | ||||||||||
XMLDocumentFragmentScannerImpl.FragmentContentDispatcher | Dispatcher to handle content scanning. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | DEBUG_CONTENT_SCANNING | Debug content dispatcher scanning. | |||||||||
String | ENTITY_RESOLVER | Property identifier: entity resolver. | |||||||||
String | NAMESPACES | Feature identifier: namespaces. | |||||||||
String | NOTIFY_BUILTIN_REFS | Feature identifier: notify built-in refereces. | |||||||||
int | SCANNER_STATE_CDATA | Scanner state: CDATA section. | |||||||||
int | SCANNER_STATE_COMMENT | Scanner state: comment. | |||||||||
int | SCANNER_STATE_CONTENT | Scanner state: content. | |||||||||
int | SCANNER_STATE_DOCTYPE | Scanner state: DOCTYPE. | |||||||||
int | SCANNER_STATE_END_OF_INPUT | Scanner state: end of input. | |||||||||
int | SCANNER_STATE_PI | Scanner state: processing instruction. | |||||||||
int | SCANNER_STATE_REFERENCE | Scanner state: reference. | |||||||||
int | SCANNER_STATE_ROOT_ELEMENT | Scanner state: root element. | |||||||||
int | SCANNER_STATE_START_OF_MARKUP | Scanner state: start of markup. | |||||||||
int | SCANNER_STATE_TERMINATED | Scanner state: terminated. | |||||||||
int | SCANNER_STATE_TEXT_DECL | Scanner state: Text declaration. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.impl.XMLScanner
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fAttributeQName | Attribute QName. | ||||||||||
fAttributes | Element attributes. | ||||||||||
fContentDispatcher | Content dispatcher. | ||||||||||
fCurrentElement | Current element. | ||||||||||
fDispatcher | Active dispatcher. | ||||||||||
fDocumentHandler | Document handler. | ||||||||||
fElementQName | Element QName. | ||||||||||
fElementStack | Element stack. | ||||||||||
fEntityStack | Entity stack. | ||||||||||
fExternalSubsetResolver | External subset resolver. | ||||||||||
fHasExternalDTD | has external dtd | ||||||||||
fInScanContent | SubScanner state: inside scanContent method. | ||||||||||
fMarkupDepth | Markup depth. | ||||||||||
fNotifyBuiltInRefs | Notify built-in references. | ||||||||||
fScannerState | Scanner state. | ||||||||||
fStandalone | Standalone. | ||||||||||
fTempString | String. | ||||||||||
fTempString2 | String. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.impl.XMLScanner
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method notifies the end of an entity.
| |||||||||||
Returns the dispatcher name.
| |||||||||||
Returns the document handler
| |||||||||||
Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
| |||||||||||
Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
| |||||||||||
Returns a list of feature identifiers that are recognized by
this component.
| |||||||||||
Returns a list of property identifiers that are recognized by
this component.
| |||||||||||
Resets the component.
| |||||||||||
Scans a document.
| |||||||||||
setDocumentHandler
| |||||||||||
Sets the state of a feature.
| |||||||||||
Sets the input source.
| |||||||||||
Sets the value of a property.
| |||||||||||
This method notifies of the start of an entity.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a content dispatcher.
| |||||||||||
Returns the scanner state name.
| |||||||||||
Handles the end element.
| |||||||||||
Scans an attribute.
| |||||||||||
Scans a CDATA section.
| |||||||||||
Scans a character reference.
| |||||||||||
Scans a comment.
| |||||||||||
Scans element content.
| |||||||||||
Scans an end element.
| |||||||||||
Scans an entity reference.
| |||||||||||
Scans a processing data.
| |||||||||||
Scans a start element.
| |||||||||||
Scans the remainder of a start or empty tag after the element name.
| |||||||||||
Scans the name of an element in a start or empty tag.
| |||||||||||
Scans an XML or text declaration.
| |||||||||||
Sets the dispatcher.
| |||||||||||
Sets the scanner state.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.impl.XMLScanner
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.apache.xerces.impl.XMLEntityHandler
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLComponent
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLDocumentScanner
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLDocumentSource
|
Debug content dispatcher scanning.
Property identifier: entity resolver.
Feature identifier: namespaces.
Feature identifier: notify built-in refereces.
Scanner state: CDATA section.
Scanner state: comment.
Scanner state: content.
Scanner state: DOCTYPE.
Scanner state: end of input.
Scanner state: processing instruction.
Scanner state: reference.
Scanner state: root element.
Scanner state: start of markup.
Scanner state: terminated.
Scanner state: Text declaration.
Entity stack.
has external dtd
SubScanner state: inside scanContent method.
Markup depth.
Notify built-in references.
Scanner state.
Standalone.
Default constructor.
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.
name | The name of the entity. |
---|---|
augs | Additional information that may include infoset augmentations |
XNIException | Thrown by handler to signal an error. |
---|
Returns the dispatcher name.
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
featureId | The feature identifier. |
---|
Returns the default state for a property, or null if this component does not want to report a default value for this property.
propertyId | The property identifier. |
---|
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.
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.
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
componentManager | The component manager. |
---|
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. | |
XMLConfigurationException |
Scans a document.
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. |
---|
IOException | |
---|---|
XNIException |
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.
featureId | The feature identifier. |
---|---|
state | The state of the feature. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |
Sets the input source.
inputSource | The input source. |
---|
IOException | Thrown on i/o error. |
---|
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.
propertyId | The property identifier. |
---|---|
value | The value of the property. |
The component should not throw this exception. | |
The component should not throw this exception. | |
XMLConfigurationException |
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.
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 |
XNIException | Thrown by handler to signal an error. |
---|
Creates a content dispatcher.
Handles the end element. This method will make sure that the end element name matches the current element and notify the handler about the end of the element and the end of any relevent prefix mappings.
Note: This method uses the fQName variable. The contents of this variable will be destroyed.
element | The element. |
---|
XNIException | Thrown if the handler throws a SAX exception upon notification. |
---|
Scans an attribute.
[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. |
---|
IOException | |
---|---|
XNIException |
Scans a CDATA section.
Note: This method uses the fTempString and fStringBuffer variables.
complete | True if the CDATA section is to be scanned completely. |
---|
IOException | |
---|---|
XNIException |
Scans a character reference.
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'
IOException | |
---|---|
XNIException |
Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
IOException | |
---|---|
XNIException |
Scans element content.
IOException | |
---|---|
XNIException |
Scans an end element.
[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.
IOException | |
---|---|
XNIException |
Scans an entity reference.
IOException | Thrown if i/o error occurs. |
---|---|
XNIException | Thrown if handler throws exception upon notification. |
Scans a processing data. This is needed to handle the situation where a document starts with a processing instruction whose target name starts with "xml". (e.g. xmlfoo)
target | The PI target |
---|---|
data | The string to fill in with the data |
IOException | |
---|---|
XNIException |
Scans a start element. This method will handle the binding of namespace information and notifying the handler of the start of the element.
[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.
IOException | |
---|---|
XNIException |
Scans the remainder of a start or empty tag after the element name.
IOException | |
---|---|
XNIException |
Scans an XML or text declaration.
[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. |
---|
IOException | |
---|---|
XNIException |
Sets the dispatcher.
dispatcher | The new dispatcher. |
---|
Sets the scanner state.
state | The new scanner state. |
---|