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 XMLAttributesImpl | fAttributes
Default attribute |
| 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. |
| public 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 XMLStringBuffer | fIgnoreConditionalBuffer
Ignore conditional section buffer. |
| private int | fIncludeSectDepth
Number of opened include sections. |
| private XMLString | fLiteral
Literal text. |
| private 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 | fSeenExternalPE
Seen external parameter entity. |
| protected boolean | fStandalone
Standalone. |
| private boolean | fStartDTDCalled
Start DTD called. |
| private XMLString | |
| private XMLStringBuffer | fStringBuffer
Hides com. |
| private XMLStringBuffer | fStringBuffer2
Hides com. |
| private String[] | fStrings
Array of 3 strings. |
| pack-priv boolean | |
| pack-priv DTDGrammar | nvGrammarInfo
Object contains grammar information for a non-validaing parser. |
| 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 augs)Overrides com. Implements com. This method notifies the end of an entity. |
| private final void | |
| public XMLDTDContentModelHandler | Returns: XMLDTDContentModelHandlerImplements com. getDTDContentModelHandler |
| public XMLDTDHandler | Returns: the XMLDTDHandlerImplements com. getDTDHandler |
| public Boolean | getFeatureDefault(String
The feature identifier. featureId)Implements com. Returns the default state for a feature, or null if this component does not want to report a default value for this feature. |
| public DTDGrammar | |
| public Object | getPropertyDefault(String
The property identifier. propertyId)Implements com. Returns the default state for a property, or null if this component does not want to report a default value for this property. |
| public String[] | getRecognizedFeatures()
Implements com. Returns a list of feature identifiers that are recognized by this component. |
| public String[] | getRecognizedProperties()
Implements com. Returns a list of property identifiers that are recognized by this component. |
| 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 com. Implements com. reset |
| public void | |
| public void | |
| protected final String | |
| 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 com. Scans the external subset of the document. |
| 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 hasExternalSubset)Implements com. Scans the internal subset of the document. |
| 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 void | scanEntityValue(String entityName, boolean isPEDecl, XMLString
The string to fill in with the value. value, XMLString The string to fill in with the
non-normalized value nonNormalizedValue)Note This method uses fString, fStringBuffer (through the use of scanCharReferenceValue), and fStringBuffer2, anything in them at the time of calling is lost. 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)Scans a processing data. |
| protected final boolean | |
| public void | setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler)
Implements com. setDTDContentModelHandler |
| public void | setDTDHandler(XMLDTDHandler dtdHandler)
Implements com. setDTDHandler |
| public void | setInputSource(XMLInputSource
The input source or null. inputSource)Implements com. Sets the input source. |
| public void | setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer)
Implements com.
|
| protected final void | |
| public boolean | Returns: true if DTD is skipped, false otherwise.The value of the property javax.xml.stream.supportDTD. supportDTD)Implements com. Skip the DTD if javax.xml.stream.supportDTD is false. |
| 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 com. Implements com. This method notifies of the start of an entity. |
| protected void |
| DEBUG_SCANNER_STATE | back to summary |
|---|---|
| private static final boolean DEBUG_SCANNER_STATE Debug scanner state. | |
| fAttributes | back to summary |
|---|---|
| private XMLAttributesImpl fAttributes Default attribute | |
| 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 |
|---|---|
| public 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 XMLStringBuffer fIgnoreConditionalBuffer Ignore conditional section buffer. | |
| fIncludeSectDepth | back to summary |
|---|---|
| private int fIncludeSectDepth Number of opened include sections. | |
| fLiteral | back to summary |
|---|---|
| private XMLString fLiteral Literal text. | |
| fLiteral2 | back to summary |
|---|---|
| private 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. | |
| fSeenExternalPE | back to summary |
|---|---|
| protected boolean fSeenExternalPE Seen external parameter entity. | |
| fStandalone | back to summary |
|---|---|
| protected boolean fStandalone Standalone. | |
| fStartDTDCalled | back to summary |
|---|---|
| private boolean fStartDTDCalled Start DTD called. | |
| fString | back to summary |
|---|---|
| private XMLString fString Hides com. String. | |
| fStringBuffer | back to summary |
|---|---|
| private XMLStringBuffer fStringBuffer Hides com. String buffer. | |
| fStringBuffer2 | back to summary |
|---|---|
| private XMLStringBuffer fStringBuffer2 Hides com. String buffer. | |
| fStrings | back to summary |
|---|---|
| private String[] fStrings Array of 3 strings. | |
| nonValidatingMode | back to summary |
|---|---|
| pack-priv boolean nonValidatingMode | |
| nvGrammarInfo | back to summary |
|---|---|
| pack-priv DTDGrammar nvGrammarInfo Object contains grammar information for a non-validaing parser. | |
| 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, IOException Overrides com. Implements com. 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 com. getDTDContentModelHandler
| |
| getDTDHandler | back to summary |
|---|---|
| public XMLDTDHandler getDTDHandler() Implements com. getDTDHandler
| |
| getFeatureDefault | back to summary |
|---|---|
| public Boolean getFeatureDefault(String featureId) Implements com. Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
| |
| getGrammar | back to summary |
|---|---|
| public DTDGrammar getGrammar() | |
| getPropertyDefault | back to summary |
|---|---|
| public Object getPropertyDefault(String propertyId) Implements com. 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 com. 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 com. 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() Hides com. | |
| 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 com. Implements com. reset | |
| reset | back to summary |
|---|---|
| public void reset() Overrides com. | |
| reset | back to summary |
|---|---|
| public void reset(PropertyManager props) Overrides com. | |
| 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 com. Scans the external subset of the document.
| |
| scanDTDInternalSubset | back to summary |
|---|---|
| public boolean scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) throws IOException, XNIException Implements com. 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 void scanEntityValue(String entityName, boolean isPEDecl, XMLString value, XMLString nonNormalizedValue) throws IOException, XNIException Scans an entity value.
| |
| 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 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 com. setDTDContentModelHandler | |
| setDTDHandler | back to summary |
|---|---|
| public void setDTDHandler(XMLDTDHandler dtdHandler) Implements com. setDTDHandler | |
| setInputSource | back to summary |
|---|---|
| public void setInputSource(XMLInputSource inputSource) throws IOException Implements com. Sets the input source.
| |
| setLimitAnalyzer | back to summary |
|---|---|
| public void setLimitAnalyzer(XMLLimitAnalyzer limitAnalyzer) Implements com. | |
| setScannerState | back to summary |
|---|---|
| protected final void setScannerState(int state) Sets the scanner state.
| |
| skipDTD | back to summary |
|---|---|
| public boolean skipDTD(boolean supportDTD) throws IOException Implements com. Skip the DTD if javax.xml.stream.supportDTD is false.
| |
| 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 com. Implements com. 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 void startPE(String name, boolean literal) throws IOException, XNIException start a parameter entity dealing with the textdecl if there is any
| |