public class XMLDTDScannerImpl extends XMLScanner implements org.apache.xerces.xni.parser.XMLDTDScanner, 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 | Field and Description |
|---|---|
protected org.apache.xerces.xni.XMLDTDContentModelHandler |
fDTDContentModelHandler
DTD content model handler.
|
org.apache.xerces.xni.XMLDTDHandler |
fDTDHandler
DTD handler.
|
protected int |
fScannerState
Scanner state.
|
protected boolean |
fSeenExternalDTD
Seen external DTD.
|
protected boolean |
fSeenExternalPE
Seen external parameter entity.
|
protected boolean |
fStandalone
Standalone.
|
protected static int |
SCANNER_STATE_END_OF_INPUT
Scanner state: end of input.
|
protected static int |
SCANNER_STATE_MARKUP_DECL
Scanner state: markup declaration.
|
protected static int |
SCANNER_STATE_TEXT_DECL
Scanner state: text declaration.
|
attributeValueCache, DEBUG_ATTR_NORMALIZATION, ENTITY_MANAGER, ERROR_REPORTER, fAmpSymbol, fAposSymbol, fAttributeCacheInitDone, fAttributeCacheUsedCount, fCharRefLiteral, fEncodingSymbol, fEntityDepth, fEntityManager, fEntityScanner, fEntityStore, fErrorReporter, fEvent, fGtSymbol, fLtSymbol, fNotifyCharRefs, fPropertyManager, fQuotSymbol, fReportEntity, fResourceIdentifier, fScanningAttribute, fStandaloneSymbol, fStringBufferIndex, fSymbolTable, fValidation, fVersionSymbol, NOTIFY_CHAR_REFS, stringBufferCache, SYMBOL_TABLE, VALIDATION| Constructor and Description |
|---|
XMLDTDScannerImpl()
Default constructor.
|
XMLDTDScannerImpl(org.apache.xerces.util.SymbolTable symbolTable,
XMLErrorReporter errorReporter,
XMLEntityManager entityManager)
Constructor for he use of non-XMLComponentManagers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
endEntity(java.lang.String name)
This method notifies the end of an entity.
|
org.apache.xerces.xni.XMLDTDContentModelHandler |
getDTDContentModelHandler()
getDTDContentModelHandler
|
org.apache.xerces.xni.XMLDTDHandler |
getDTDHandler()
getDTDHandler
|
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.
|
DTDGrammar |
getGrammar() |
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.
|
void |
reset() |
void |
reset(PropertyManager props) |
void |
reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
reset
|
protected java.lang.String |
scanAttDefaultDecl(java.lang.String elName,
java.lang.String atName,
java.lang.String type,
org.apache.xerces.xni.XMLString defaultVal,
org.apache.xerces.xni.XMLString nonNormalizedDefaultVal)
Scans an attribute default declaration
|
protected void |
scanAttlistDecl()
Scans an attlist declaration
|
protected void |
scanComment()
Scans a comment.
|
protected boolean |
scanDecls(boolean complete)
Dispatch an XML "event".
|
boolean |
scanDTDExternalSubset(boolean complete)
Scans the external subset of the document.
|
boolean |
scanDTDInternalSubset(boolean complete,
boolean standalone,
boolean hasExternalSubset)
Scans the internal subset of the document.
|
protected void |
scanElementDecl()
Scans an element declaration
|
protected void |
scanEntityValue(org.apache.xerces.xni.XMLString value,
org.apache.xerces.xni.XMLString nonNormalizedValue)
Scans an entity value.
|
protected boolean |
scanningInternalSubset() |
protected void |
scanPIData(java.lang.String target,
org.apache.xerces.xni.XMLString data)
Scans a processing data.
|
protected boolean |
scanTextDecl()
Dispatch an XML "event".
|
void |
setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler dtdContentModelHandler)
setDTDContentModelHandler
|
void |
setDTDHandler(org.apache.xerces.xni.XMLDTDHandler dtdHandler)
setDTDHandler
|
void |
setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
Sets the input source.
|
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)
This method notifies of the start of an entity.
|
protected void |
startPE(java.lang.String name,
boolean literal)
start a parameter entity dealing with the textdecl if there is any
|
getFeature, isInvalid, isInvalidLiteral, isValidNameChar, isValidNameStartChar, isValidNCName, normalizeWhitespace, reportFatalError, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPIData, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl, setFeature, setProperty, setPropertyManager, versionSupportedprotected static final int SCANNER_STATE_END_OF_INPUT
protected static final int SCANNER_STATE_TEXT_DECL
protected static final int SCANNER_STATE_MARKUP_DECL
public org.apache.xerces.xni.XMLDTDHandler fDTDHandler
protected org.apache.xerces.xni.XMLDTDContentModelHandler fDTDContentModelHandler
protected int fScannerState
protected boolean fStandalone
protected boolean fSeenExternalDTD
protected boolean fSeenExternalPE
public XMLDTDScannerImpl()
public XMLDTDScannerImpl(org.apache.xerces.util.SymbolTable symbolTable,
XMLErrorReporter errorReporter,
XMLEntityManager entityManager)
public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
throws java.io.IOException
setInputSource in interface org.apache.xerces.xni.parser.XMLDTDScannerinputSource - The input source or null.java.io.IOException - Thrown on i/o error.public boolean scanDTDExternalSubset(boolean complete)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
scanDTDExternalSubset in interface org.apache.xerces.xni.parser.XMLDTDScannercomplete - 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 boolean scanDTDInternalSubset(boolean complete,
boolean standalone,
boolean hasExternalSubset)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
scanDTDInternalSubset in interface org.apache.xerces.xni.parser.XMLDTDScannercomplete - 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.hasExternalDTD - 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.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 - org.apache.xerces.xni.parser.XMLConfigurationExceptionpublic void reset()
public void reset(PropertyManager props)
reset in class XMLScannerpublic java.lang.String[] getRecognizedFeatures()
getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponentpublic java.lang.String[] getRecognizedProperties()
getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponentpublic 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 setDTDHandler(org.apache.xerces.xni.XMLDTDHandler dtdHandler)
setDTDHandler in interface org.apache.xerces.xni.parser.XMLDTDSourcedtdHandler - public org.apache.xerces.xni.XMLDTDHandler getDTDHandler()
public void setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler dtdContentModelHandler)
setDTDContentModelHandler in interface org.apache.xerces.xni.parser.XMLDTDContentModelSourcedtdContentModelHandler - public org.apache.xerces.xni.XMLDTDContentModelHandler getDTDContentModelHandler()
public void startEntity(java.lang.String name,
org.apache.xerces.xni.XMLResourceIdentifier identifier,
java.lang.String encoding)
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).org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.public void endEntity(java.lang.String name)
throws org.apache.xerces.xni.XNIException,
java.io.IOException
endEntity in interface XMLEntityHandlerendEntity in class XMLScannername - The name of the entity.org.apache.xerces.xni.XNIException - Thrown by handler to signal an error.java.io.IOExceptionprotected final void setScannerState(int state)
state - The new scanner state.protected final boolean scanningInternalSubset()
protected void startPE(java.lang.String name,
boolean literal)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
name - The name of the parameter entity to start (without the '%')literal - Whether this is happening within a literaljava.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final boolean scanTextDecl()
throws java.io.IOException,
org.apache.xerces.xni.XNIException
complete - True if this method is intended to scan
and dispatch as much as possible.java.io.IOException - Thrown on i/o error.org.apache.xerces.xni.XNIException - Thrown on parse error.protected final void scanPIData(java.lang.String target,
org.apache.xerces.xni.XMLString data)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
target - The PI targetdata - The string to fill in with the datajava.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final 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 final void scanElementDecl()
throws java.io.IOException,
org.apache.xerces.xni.XNIException
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
Note: Called after scanning past '<!ELEMENT'
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final void scanAttlistDecl()
throws java.io.IOException,
org.apache.xerces.xni.XNIException
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl
Note: Called after scanning past '<!ATTLIST'
java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final java.lang.String scanAttDefaultDecl(java.lang.String elName,
java.lang.String atName,
java.lang.String type,
org.apache.xerces.xni.XMLString defaultVal,
org.apache.xerces.xni.XMLString nonNormalizedDefaultVal)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
name - The name of the attribute being scanned.defaultVal - The string to fill in with the default value.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final void scanEntityValue(org.apache.xerces.xni.XMLString value,
org.apache.xerces.xni.XMLString nonNormalizedValue)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
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.java.io.IOExceptionorg.apache.xerces.xni.XNIExceptionprotected final boolean scanDecls(boolean complete)
throws java.io.IOException,
org.apache.xerces.xni.XNIException
complete - True if this method is intended to scan
and dispatch as much as possible.java.io.IOException - Thrown on i/o error.org.apache.xerces.xni.XNIException - Thrown on parse error.public DTDGrammar getGrammar()
Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.