java.lang.Object | ||
↳ | org.apache.xerces.impl.XMLScanner | |
↳ | org.apache.xerces.impl.XMLDTDScannerImpl |
Known Direct Subclasses |
This class is responsible for scanning the declarations found in the internal and external subsets of a DTD in an XML document. The scanner acts as the sources for the DTD information which is communicated to the DTD handlers.
This component requires the following features and properties from the component manager that uses it:
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SCANNER_STATE_END_OF_INPUT | Scanner state: end of input. | |||||||||
int | SCANNER_STATE_MARKUP_DECL | Scanner state: markup declaration. | |||||||||
int | SCANNER_STATE_TEXT_DECL | Scanner state: text declaration. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.impl.XMLScanner
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
fDTDContentModelHandler | DTD content model handler. | ||||||||||
fDTDHandler | DTD handler. | ||||||||||
fScannerState | Scanner state. | ||||||||||
fSeenExternalDTD | Seen external DTD. | ||||||||||
fSeenExternalPE | Seen external parameter entity. | ||||||||||
fStandalone | Standalone. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.xerces.impl.XMLScanner
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Default constructor.
| |||||||||||
Constructor for he use of non-XMLComponentManagers.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method notifies the end of an entity.
| |||||||||||
getDTDContentModelHandler
| |||||||||||
getDTDHandler
| |||||||||||
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.
| |||||||||||
reset
| |||||||||||
Scans the external subset of the document.
| |||||||||||
Scans the internal subset of the document.
| |||||||||||
setDTDContentModelHandler
| |||||||||||
setDTDHandler
| |||||||||||
Sets the input source.
| |||||||||||
This method notifies of the start of an entity.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Scans an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) | |||||||||||
Scans an attlist declaration
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl Note: Called after scanning past '<!ATTLIST' | |||||||||||
Scans a comment.
| |||||||||||
Dispatch an XML "event".
| |||||||||||
Scans an element declaration
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children Note: Called after scanning past '<!ELEMENT' | |||||||||||
Scans an entity value.
| |||||||||||
Scans a processing data.
| |||||||||||
Dispatch an XML "event".
| |||||||||||
Sets the scanner state.
| |||||||||||
start a parameter entity dealing with the textdecl if there is any
|
[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.XMLDTDContentModelSource
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLDTDScanner
| |||||||||||
From interface
org.apache.xerces.xni.parser.XMLDTDSource
|
Scanner state: end of input.
Scanner state: markup declaration.
Scanner state: text declaration.
Scanner state.
Seen external DTD.
Seen external parameter entity.
Standalone.
Default constructor.
Constructor for he use of non-XMLComponentManagers.
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. |
---|
getDTDContentModelHandler
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.
Scans the external subset of the 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 |
Scans the internal subset of the 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. |
---|---|
standalone | True if the document was specified as standalone. This value is important for verifying certain well-formedness constraints. |
hasExternalSubset | 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. |
IOException | |
---|---|
XNIException |
setDTDContentModelHandler
Sets the input source.
inputSource | The input source or null. |
---|
IOException | Thrown on i/o error. |
---|
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. |
---|
Scans an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
atName | The name of the attribute being scanned. |
---|---|
defaultVal | The string to fill in with the default value. |
IOException | |
---|---|
XNIException |
Scans an attlist declaration
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl
Note: Called after scanning past '<!ATTLIST'
IOException | |
---|---|
XNIException |
Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
IOException | |
---|---|
XNIException |
Dispatch an XML "event".
complete | True if this method is intended to scan and dispatch as much as possible. |
---|
IOException | Thrown on i/o error. |
---|---|
XNIException | Thrown on parse error. |
Scans an element declaration
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
Note: Called after scanning past '<!ELEMENT'
IOException | |
---|---|
XNIException |
Scans an entity value.
value | The string to fill in with the value. |
---|---|
nonNormalizedValue | The string to fill in with the non-normalized value. Note: This method uses fString, fStringBuffer (through the use of scanCharReferenceValue), and fStringBuffer2, anything in them at the time of calling is lost. |
IOException | |
---|---|
XNIException |
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 |
Dispatch an XML "event".
IOException | Thrown on i/o error. |
---|---|
XNIException | Thrown on parse error. |
Sets the scanner state.
state | The new scanner state. |
---|
start a parameter entity dealing with the textdecl if there is any
name | The name of the parameter entity to start (without the '%') |
---|---|
literal | Whether this is happening within a literal |
IOException | |
---|---|
XNIException |