This component requires the following features and properties from the component manager that uses it:
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | DEBUG_SCANNER_STATE
Debug scanner state. |
| private int | fContentDepth
Size of content stack. |
| private int[] | fContentStack
Stack of content operators (either '|' or ',') in children content. |
| protected XMLDTDContentModelHandler | fDTDContentModelHandler
DTD content model handler. |
| protected XMLDTDHandler | fDTDHandler
DTD handler. |
| private static final Boolean[] | FEATURE_DEFAULTS
Feature defaults. |
| private String[] | fEnumeration
Enumeration values. |
| private int | fEnumerationCount
Enumeration values count. |
| private int | fExtEntityDepth
Number of opened external entities. |
| private final XMLStringBuffer | fIgnoreConditionalBuffer
Ignore conditional section buffer. |
| private int | fIncludeSectDepth
Number of opened include sections. |
| private final XMLString | fLiteral
Literal text. |
| private final XMLString | fLiteral2
Literal text. |
| private int | fMarkUpDepth
Markup depth. |
| private int | fPEDepth
Number of opened parameter entities. |
| private boolean[] | fPEReport
Parameter entity stack to report start/end entity calls. |
| private int[] | fPEStack
Parameter entity stack to check well-formedness. |
| protected int | fScannerState
Scanner state. |
| protected boolean | fSeenExternalDTD
Seen external DTD. |
| protected boolean | fSeenPEReferences
Seen a parameter entity reference. |
| protected boolean | fStandalone
Standalone. |
| private boolean | fStartDTDCalled
Start DTD called. |
| private final XMLString | fString
String.
|
| private final XMLStringBuffer | fStringBuffer
String buffer.
|
| private final XMLStringBuffer | fStringBuffer2
String buffer.
|
| private final String[] | fStrings
Array of 3 strings. |
| private static final Object[] | PROPERTY_DEFAULTS
Property defaults. |
| private static final String[] | RECOGNIZED_FEATURES
Recognized features. |
| private static final String[] | RECOGNIZED_PROPERTIES
Recognized properties. |
| protected static final int | SCANNER_STATE_END_OF_INPUT
Scanner state: end of input. |
| protected static final int | SCANNER_STATE_MARKUP_DECL
Scanner state: markup declaration. |
| protected static final int | SCANNER_STATE_TEXT_DECL
Scanner state: text declaration. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | XMLDTDScannerImpl(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager)
Constructor for he use of non-XMLComponentManagers. |
| Modifier and Type | Method and Description |
|---|---|
| public void | endEntity(String
The name of the entity. name, Augmentations Additional information that may include infoset augmentations augs)Overrides org. Implements org. |
| private final void | |
| public XMLDTDContentModelHandler | Returns: XMLDTDContentModelHandlerImplements org. |
| public XMLDTDHandler | Returns: the XMLDTDHandlerImplements org. |
| public Boolean | getFeatureDefault(String
The feature identifier. featureId)Implements org. |
| public Object | getPropertyDefault(String
The property identifier. propertyId)Implements org. |
| public String[] | getRecognizedFeatures()
Implements org. |
| public String[] | getRecognizedProperties()
Implements org. |
| private static String | |
| private void | |
| private final boolean | |
| private final int | |
| private final int | |
| private final void | |
| private final void | |
| public void | reset(XMLComponentManager componentManager)
Overrides org. Implements org. |
| public void | |
| protected final String | scanAttDefaultDecl(String elName, String
The name of the attribute being scanned. atName, String type, XMLString The string to fill in with the default value. defaultVal, XMLString nonNormalizedDefaultVal)Scans an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)?
|
| protected final void | |
| private final String | scanAttType(String
The element type name this declaration is about. elName, String The attribute name this declaration is about. atName)Scans an attribute type definition
[54] AttType ::= StringType | TokenizedType | EnumeratedType
[55] StringType ::= 'CDATA'
[56] TokenizedType ::= 'ID'
| 'IDREF'
| 'IDREFS'
| 'ENTITY'
| 'ENTITIES'
| 'NMTOKEN'
| 'NMTOKENS'
[57] EnumeratedType ::= NotationType | Enumeration
[58] NotationType ::= 'NOTATION' S '(' S?
|
| private final void | scanChildren(String
The element type name this declaration is about elName)Note Called after scanning past the first open paranthesis. scan children content model This assumes it can simply append to fStringBuffer. |
| protected final void | |
| private final void | |
| protected final boolean | Returns: True if there is more to scan.True if this method is intended to scan
and dispatch as much as possible. complete)Dispatch an XML "event". |
| public boolean | Returns: True if there is more to scan, false otherwise.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. complete)Implements org. |
| public boolean | Returns: True if there is more to scan, false otherwise.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. complete, boolean True if the document was specified as standalone.
This value is important for verifying certain
well-formedness constraints. standalone, boolean 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. hasExternalSubset)Implements org. |
| protected final void | scanElementDecl()
Scans an element declaration
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? |
| private final void | scanEntityDecl()
Scans an entity declaration
[70] EntityDecl ::= GEDecl | PEDecl [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? |
| protected final int | Returns: Count of direct and indirect references to parameter entities in the value of the entity.The string to fill in with the value. value, XMLString The string to fill in with the
non-normalized value. nonNormalizedValue)Scans an entity value. |
| private final void | |
| protected final boolean | |
| private final void | scanNotationDecl()
Scans a notation declaration
[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID|PublicID) S? |
| protected final void | scanPIData(String
The PI target target, XMLString The string to fill in with the data data)Overrides org. |
| protected final boolean | |
| public void | setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler)
Implements org. |
| public void | setDTDHandler(XMLDTDHandler dtdHandler)
Implements org. |
| public void | setInputSource(XMLInputSource
The input source or null. inputSource)Implements org. |
| protected final void | |
| private int | |
| private boolean | Returns: True if any leading whitespace was found or the end of a parameter entity was crossed.Specify whether some leading whitespace should be
found spaceRequired, boolean Specify whether parameter entity references should
be looked for lookForPERefs)Skip separator. |
| public void | startEntity(String
The name of the entity. name, XMLResourceIdentifier The resource identifier. identifier, String 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). encoding, Augmentations Additional information that may include infoset augmentations augs)Overrides org. Implements org. |
| protected String |
| DEBUG_SCANNER_STATE | back to summary |
|---|---|
| private static final boolean DEBUG_SCANNER_STATE Debug scanner state. | |
| fContentDepth | back to summary |
|---|---|
| private int fContentDepth Size of content stack. | |
| fContentStack | back to summary |
|---|---|
| private int[] fContentStack Stack of content operators (either '|' or ',') in children content. | |
| fDTDContentModelHandler | back to summary |
|---|---|
| protected XMLDTDContentModelHandler fDTDContentModelHandler DTD content model handler. | |
| fDTDHandler | back to summary |
|---|---|
| protected XMLDTDHandler fDTDHandler DTD handler. | |
| FEATURE_DEFAULTS | back to summary |
|---|---|
| private static final Boolean[] FEATURE_DEFAULTS Feature defaults. | |
| fEnumeration | back to summary |
|---|---|
| private String[] fEnumeration Enumeration values. | |
| fEnumerationCount | back to summary |
|---|---|
| private int fEnumerationCount Enumeration values count. | |
| fExtEntityDepth | back to summary |
|---|---|
| private int fExtEntityDepth Number of opened external entities. | |
| fIgnoreConditionalBuffer | back to summary |
|---|---|
| private final XMLStringBuffer fIgnoreConditionalBuffer Ignore conditional section buffer. | |
| fIncludeSectDepth | back to summary |
|---|---|
| private int fIncludeSectDepth Number of opened include sections. | |
| fLiteral | back to summary |
|---|---|
| private final XMLString fLiteral Literal text. | |
| fLiteral2 | back to summary |
|---|---|
| private final XMLString fLiteral2 Literal text. | |
| fMarkUpDepth | back to summary |
|---|---|
| private int fMarkUpDepth Markup depth. | |
| fPEDepth | back to summary |
|---|---|
| private int fPEDepth Number of opened parameter entities. | |
| fPEReport | back to summary |
|---|---|
| private boolean[] fPEReport Parameter entity stack to report start/end entity calls. | |
| fPEStack | back to summary |
|---|---|
| private int[] fPEStack Parameter entity stack to check well-formedness. | |
| fScannerState | back to summary |
|---|---|
| protected int fScannerState Scanner state. | |
| fSeenExternalDTD | back to summary |
|---|---|
| protected boolean fSeenExternalDTD Seen external DTD. | |
| fSeenPEReferences | back to summary |
|---|---|
| protected boolean fSeenPEReferences Seen a parameter entity reference. | |
| fStandalone | back to summary |
|---|---|
| protected boolean fStandalone Standalone. | |
| fStartDTDCalled | back to summary |
|---|---|
| private boolean fStartDTDCalled Start DTD called. | |
| fString | back to summary |
|---|---|
| private final XMLString fString Hides org. String. | |
| fStringBuffer | back to summary |
|---|---|
| private final XMLStringBuffer fStringBuffer Hides org. String buffer. | |
| fStringBuffer2 | back to summary |
|---|---|
| private final XMLStringBuffer fStringBuffer2 Hides org. String buffer. | |
| fStrings | back to summary |
|---|---|
| private final String[] fStrings Array of 3 strings. | |
| PROPERTY_DEFAULTS | back to summary |
|---|---|
| private static final Object[] PROPERTY_DEFAULTS Property defaults. | |
| RECOGNIZED_FEATURES | back to summary |
|---|---|
| private static final String[] RECOGNIZED_FEATURES Recognized features. | |
| RECOGNIZED_PROPERTIES | back to summary |
|---|---|
| private static final String[] RECOGNIZED_PROPERTIES Recognized properties. | |
| SCANNER_STATE_END_OF_INPUT | back to summary |
|---|---|
| protected static final int SCANNER_STATE_END_OF_INPUT Scanner state: end of input. | |
| SCANNER_STATE_MARKUP_DECL | back to summary |
|---|---|
| protected static final int SCANNER_STATE_MARKUP_DECL Scanner state: markup declaration. | |
| SCANNER_STATE_TEXT_DECL | back to summary |
|---|---|
| protected static final int SCANNER_STATE_TEXT_DECL Scanner state: text declaration. | |
| XMLDTDScannerImpl | back to summary |
|---|---|
| public XMLDTDScannerImpl() Default constructor. | |
| XMLDTDScannerImpl | back to summary |
|---|---|
| public XMLDTDScannerImpl(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager) Constructor for he use of non-XMLComponentManagers. | |
| endEntity | back to summary |
|---|---|
| public void endEntity(String name, Augmentations augs) throws XNIException Overrides org. Implements org. 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.
| |
| ensureEnumerationSize | back to summary |
|---|---|
| private final void ensureEnumerationSize(int size) | |
| getDTDContentModelHandler | back to summary |
|---|---|
| public XMLDTDContentModelHandler getDTDContentModelHandler() Implements org. getDTDContentModelHandler
| |
| getDTDHandler | back to summary |
|---|---|
| public XMLDTDHandler getDTDHandler() Implements org. getDTDHandler
| |
| getFeatureDefault | back to summary |
|---|---|
| public Boolean getFeatureDefault(String featureId) Implements org. Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
| |
| getPropertyDefault | back to summary |
|---|---|
| public Object getPropertyDefault(String propertyId) Implements org. Returns the default state for a property, or null if this component does not want to report a default value for this property.
| |
| getRecognizedFeatures | back to summary |
|---|---|
| public String[] getRecognizedFeatures() Implements org. 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. | |
| getRecognizedProperties | back to summary |
|---|---|
| public String[] getRecognizedProperties() Implements org. 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. | |
| getScannerStateName | back to summary |
|---|---|
| private static String getScannerStateName(int state) Returns the scanner state name. | |
| init | back to summary |
|---|---|
| private void init() | |
| peekReportEntity | back to summary |
|---|---|
| private final boolean peekReportEntity() look at the top of the stack | |
| popContentStack | back to summary |
|---|---|
| private final int popContentStack() | |
| popPEStack | back to summary |
|---|---|
| private final int popPEStack() pop the stack | |
| pushContentStack | back to summary |
|---|---|
| private final void pushContentStack(int c) | |
| pushPEStack | back to summary |
|---|---|
| private final void pushPEStack(int depth, boolean report) | |
| reset | back to summary |
|---|---|
| public void reset(XMLComponentManager componentManager) throws XMLConfigurationException Overrides org. Implements org. reset | |
| reset | back to summary |
|---|---|
| public void reset() Overrides org. | |
| scanAttDefaultDecl | back to summary |
|---|---|
| protected final String scanAttDefaultDecl(String elName, String atName, String type, XMLString defaultVal, XMLString nonNormalizedDefaultVal) throws IOException, XNIException Scans an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
| |
| scanAttlistDecl | back to summary |
|---|---|
| protected final void scanAttlistDecl() throws 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' | |
| scanAttType | back to summary |
|---|---|
| private final String scanAttType(String elName, String atName) throws IOException, XNIException Scans an attribute type definition
[54] AttType ::= StringType | TokenizedType | EnumeratedType
[55] StringType ::= 'CDATA'
[56] TokenizedType ::= 'ID'
| 'IDREF'
| 'IDREFS'
| 'ENTITY'
| 'ENTITIES'
| 'NMTOKEN'
| 'NMTOKENS'
[57] EnumeratedType ::= NotationType | Enumeration
[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
Note Called after scanning past '<!ATTLIST' | |
| scanChildren | back to summary |
|---|---|
| private final void scanChildren(String elName) throws IOException, XNIException scan children content model This assumes it can simply append to fStringBuffer.
[47] children ::= (choice | seq) ('?' | '*' | '+')?
[48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
[49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
| |
| scanComment | back to summary |
|---|---|
| protected final void scanComment() throws IOException, XNIException Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note Called after scanning past '<!--' | |
| scanConditionalSect | back to summary |
|---|---|
| private final void scanConditionalSect(int currPEDepth) throws IOException, XNIException Scans a conditional section. If it's a section to ignore the whole section gets scanned through and this method only returns after the closing bracket has been found. When it's an include section though, it returns to let the main loop take care of scanning it. In that case the end of the section if handled by the main loop (scanDecls).
[61] conditionalSect ::= includeSect | ignoreSect
[62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>'
[63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>'
[64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
[65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
Note Called after scanning past '<![' | |
| scanDecls | back to summary |
|---|---|
| protected final boolean scanDecls(boolean complete) throws IOException, XNIException Dispatch an XML "event".
| |
| scanDTDExternalSubset | back to summary |
|---|---|
| public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException Implements org. Scans the external subset of the document.
| |
| scanDTDInternalSubset | back to summary |
|---|---|
| public boolean scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) throws IOException, XNIException Implements org. Scans the internal subset of the document.
| |
| scanElementDecl | back to summary |
|---|---|
| protected final void scanElementDecl() throws IOException, XNIException Scans an element declaration
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children Note Called after scanning past '<!ELEMENT' | |
| scanEntityDecl | back to summary |
|---|---|
| private final void scanEntityDecl() throws IOException, XNIException Scans an entity declaration
[70] EntityDecl ::= GEDecl | PEDecl
[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
[74] PEDef ::= EntityValue | ExternalID
[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
[76] NDataDecl ::= S 'NDATA' S Name
Note Called after scanning past '<!ENTITY' | |
| scanEntityValue | back to summary |
|---|---|
| protected final int scanEntityValue(XMLString value, XMLString nonNormalizedValue) throws IOException, XNIException Scans an entity value. Note This method uses fString, fStringBuffer (through the use of scanCharReferenceValue), and fStringBuffer2, anything in them at the time of calling is lost. | |
| scanMixed | back to summary |
|---|---|
| private final void scanMixed(String elName) throws IOException, XNIException scan Mixed content model This assumes the content model has been parsed up to #PCDATA and can simply append to fStringBuffer.
[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
| '(' S? '#PCDATA' S? ')'
| |
| scanningInternalSubset | back to summary |
|---|---|
| protected final boolean scanningInternalSubset() | |
| scanNotationDecl | back to summary |
|---|---|
| private final void scanNotationDecl() throws IOException, XNIException Scans a notation declaration
[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID|PublicID) S? '>' [83] PublicID ::= 'PUBLIC' S PubidLiteral Note Called after scanning past '<!NOTATION' | |
| scanPIData | back to summary |
|---|---|
| protected final void scanPIData(String target, XMLString data) throws IOException, XNIException Overrides org. 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) | |
| scanTextDecl | back to summary |
|---|---|
| protected final boolean scanTextDecl() throws IOException, XNIException Dispatch an XML "event".
| |
| setDTDContentModelHandler | back to summary |
|---|---|
| public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler) Implements org. setDTDContentModelHandler | |
| setDTDHandler | back to summary |
|---|---|
| public void setDTDHandler(XMLDTDHandler dtdHandler) Implements org. setDTDHandler | |
| setInputSource | back to summary |
|---|---|
| public void setInputSource(XMLInputSource inputSource) throws IOException Implements org. Sets the input source.
| |
| setScannerState | back to summary |
|---|---|
| protected final void setScannerState(int state) Sets the scanner state.
| |
| skipInvalidEnumerationValue | back to summary |
|---|---|
| private int skipInvalidEnumerationValue() throws IOException | |
| skipSeparator | back to summary |
|---|---|
| private boolean skipSeparator(boolean spaceRequired, boolean lookForPERefs) throws IOException, XNIException Skip separator. This is typically just whitespace but it can also be one or more parameter entity references. If there are some it "expands them" by calling the corresponding entity from the entity manager. This is recursive and will process has many refs as possible.
| |
| startEntity | back to summary |
|---|---|
| public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException Overrides org. Implements org. 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.
| |
| startPE | back to summary |
|---|---|
| protected String startPE(String name, boolean literal) throws IOException, XNIException start a parameter entity dealing with the textdecl if there is any | |