public class XMLDTDScannerImpl extends XMLScanner implements XMLDTDScanner, XMLComponent, XMLEntityHandler
This component requires the following features and properties from the component manager that uses it:
Modifier and Type | Field and Description |
---|---|
protected XMLDTDContentModelHandler |
fDTDContentModelHandler
DTD content model handler.
|
protected XMLDTDHandler |
fDTDHandler
DTD handler.
|
protected int |
fScannerState
Scanner state.
|
protected boolean |
fSeenExternalDTD
Seen external DTD.
|
protected boolean |
fSeenPEReferences
Seen a parameter entity reference.
|
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.
|
DEBUG_ATTR_NORMALIZATION, ENTITY_MANAGER, ERROR_REPORTER, fAmpSymbol, fAposSymbol, fCharRefLiteral, fEncodingSymbol, fEntityDepth, fEntityManager, fEntityScanner, fErrorReporter, fGtSymbol, fLtSymbol, fNamespaces, fNotifyCharRefs, fParserSettings, fQuotSymbol, fReportEntity, fResourceIdentifier, fScanningAttribute, fStandaloneSymbol, fSymbolTable, fValidation, fVersionSymbol, NAMESPACES, NOTIFY_CHAR_REFS, PARSER_SETTINGS, SYMBOL_TABLE, VALIDATION
Constructor and Description |
---|
XMLDTDScannerImpl()
Default constructor.
|
XMLDTDScannerImpl(SymbolTable symbolTable,
XMLErrorReporter errorReporter,
XMLEntityManager entityManager)
Constructor for he use of non-XMLComponentManagers.
|
Modifier and Type | Method and Description |
---|---|
void |
endEntity(String name,
Augmentations augs)
This method notifies the end of an entity.
|
XMLDTDContentModelHandler |
getDTDContentModelHandler()
getDTDContentModelHandler
|
XMLDTDHandler |
getDTDHandler()
getDTDHandler
|
Boolean |
getFeatureDefault(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.
|
Object |
getPropertyDefault(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.
|
String[] |
getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by
this component.
|
String[] |
getRecognizedProperties()
Returns a list of property identifiers that are recognized by
this component.
|
void |
reset() |
void |
reset(XMLComponentManager componentManager)
reset
|
protected String |
scanAttDefaultDecl(String elName,
String atName,
String type,
XMLString defaultVal,
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(XMLString value,
XMLString nonNormalizedValue)
Scans an entity value.
|
protected boolean |
scanningInternalSubset() |
protected void |
scanPIData(String target,
XMLString data)
Scans a processing data.
|
protected boolean |
scanTextDecl()
Dispatch an XML "event".
|
void |
setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler)
setDTDContentModelHandler
|
void |
setDTDHandler(XMLDTDHandler dtdHandler)
setDTDHandler
|
void |
setInputSource(XMLInputSource inputSource)
Sets the input source.
|
protected void |
setScannerState(int state)
Sets the scanner state.
|
void |
startEntity(String name,
XMLResourceIdentifier identifier,
String encoding,
Augmentations augs)
This method notifies of the start of an entity.
|
protected void |
startPE(String name,
boolean literal)
start a parameter entity dealing with the textdecl if there is any
|
getFeature, getVersionNotSupportedKey, isInvalid, isInvalidLiteral, isUnchangedByNormalization, isValidNameChar, isValidNameStartChar, isValidNameStartHighSurrogate, isValidNCName, normalizeWhitespace, normalizeWhitespace, reportFatalError, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl, setFeature, setProperty, versionSupported
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setFeature, setProperty
protected static final int SCANNER_STATE_END_OF_INPUT
protected static final int SCANNER_STATE_TEXT_DECL
protected static final int SCANNER_STATE_MARKUP_DECL
protected XMLDTDHandler fDTDHandler
protected XMLDTDContentModelHandler fDTDContentModelHandler
protected int fScannerState
protected boolean fStandalone
protected boolean fSeenExternalDTD
protected boolean fSeenPEReferences
public XMLDTDScannerImpl()
public XMLDTDScannerImpl(SymbolTable symbolTable, XMLErrorReporter errorReporter, XMLEntityManager entityManager)
public void setInputSource(XMLInputSource inputSource) throws IOException
setInputSource
in interface XMLDTDScanner
inputSource
- The input source or null.IOException
- Thrown on i/o error.public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException
scanDTDExternalSubset
in interface XMLDTDScanner
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
public boolean scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) throws IOException, XNIException
scanDTDInternalSubset
in interface XMLDTDScanner
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
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
reset
in interface XMLComponent
reset
in class XMLScanner
componentManager
- XMLConfigurationException
public void reset()
reset
in class XMLScanner
public String[] getRecognizedFeatures()
getRecognizedFeatures
in interface XMLComponent
public String[] getRecognizedProperties()
getRecognizedProperties
in interface XMLComponent
public Boolean getFeatureDefault(String featureId)
getFeatureDefault
in interface XMLComponent
featureId
- The feature identifier.public Object getPropertyDefault(String propertyId)
getPropertyDefault
in interface XMLComponent
propertyId
- The property identifier.public void setDTDHandler(XMLDTDHandler dtdHandler)
setDTDHandler
in interface XMLDTDSource
dtdHandler
- public XMLDTDHandler getDTDHandler()
getDTDHandler
in interface XMLDTDSource
public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler)
setDTDContentModelHandler
in interface XMLDTDContentModelSource
dtdContentModelHandler
- public XMLDTDContentModelHandler getDTDContentModelHandler()
getDTDContentModelHandler
in interface XMLDTDContentModelSource
public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException
startEntity
in interface XMLEntityHandler
startEntity
in class XMLScanner
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 augmentationsXNIException
- Thrown by handler to signal an error.public void endEntity(String name, Augmentations augs) throws XNIException
endEntity
in interface XMLEntityHandler
endEntity
in class XMLScanner
name
- The name of the entity.augs
- Additional information that may include infoset augmentationsXNIException
- Thrown by handler to signal an error.protected final void setScannerState(int state)
state
- The new scanner state.protected final boolean scanningInternalSubset()
protected void startPE(String name, boolean literal) throws IOException, XNIException
name
- The name of the parameter entity to start (without the '%')literal
- Whether this is happening within a literalIOException
XNIException
protected final boolean scanTextDecl() throws IOException, XNIException
IOException
- Thrown on i/o error.XNIException
- Thrown on parse error.protected final void scanPIData(String target, XMLString data) throws IOException, XNIException
scanPIData
in class XMLScanner
target
- The PI targetdata
- The string to fill in with the dataIOException
XNIException
protected final void scanComment() throws IOException, XNIException
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
IOException
XNIException
protected final void scanElementDecl() throws IOException, XNIException
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
Note: Called after scanning past '<!ELEMENT'
IOException
XNIException
protected final void scanAttlistDecl() throws IOException, XNIException
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl
Note: Called after scanning past '<!ATTLIST'
IOException
XNIException
protected final String scanAttDefaultDecl(String elName, String atName, String type, XMLString defaultVal, XMLString nonNormalizedDefaultVal) throws IOException, XNIException
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
elName
- atName
- The name of the attribute being scanned.type
- defaultVal
- The string to fill in with the default value.nonNormalizedDefaultVal
- IOException
XNIException
protected final void scanEntityValue(XMLString value, XMLString nonNormalizedValue) throws IOException, 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.IOException
XNIException
protected final boolean scanDecls(boolean complete) throws IOException, XNIException
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.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.