| java.lang.Object org.apache.xerces.impl.XMLScanner org.apache.xerces.impl.XMLDTDScannerImpl
All known Subclasses: org.apache.xerces.impl.XML11DTDScannerImpl,
XMLDTDScannerImpl | public class XMLDTDScannerImpl extends XMLScanner implements XMLDTDScanner,XMLComponent,XMLEntityHandler(Code) | | 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:
- http://xml.org/sax/features/validation
- http://apache.org/xml/features/scanner/notify-char-refs
- http://apache.org/xml/properties/internal/symbol-table
- http://apache.org/xml/properties/internal/error-reporter
- http://apache.org/xml/properties/internal/entity-manager
author: Arnaud Le Hors, IBM author: Andy Clark, IBM author: Glenn Marcy, IBM author: Eric Ye, IBM version: $Id: XMLDTDScannerImpl.java 572055 2007-09-02 17:55:43Z mrglavas $ |
Method Summary | |
public void | endEntity(String name, Augmentations augs) This method notifies the end of an entity. | public XMLDTDContentModelHandler | getDTDContentModelHandler() | public XMLDTDHandler | getDTDHandler() | public 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. | public 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. | public String[] | getRecognizedFeatures() Returns a list of feature identifiers that are recognized by
this component. | public String[] | getRecognizedProperties() Returns a list of property identifiers that are recognized by
this component. | public void | reset(XMLComponentManager componentManager) | public void | reset() | final protected String | scanAttDefaultDecl(String elName, String atName, String type, XMLString defaultVal, XMLString nonNormalizedDefaultVal) | final protected void | scanAttlistDecl() | final protected void | scanComment() Scans a comment. | public boolean | scanDTDExternalSubset(boolean complete) Scans the external subset of the document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. | public boolean | scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) Scans the internal subset of the document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. | final protected boolean | scanDecls(boolean complete) Dispatch an XML "event".
Parameters: complete - True if this method is intended to scanand dispatch as much as possible. | final protected void | scanElementDecl() | final protected void | scanEntityValue(XMLString value, XMLString nonNormalizedValue) Scans an entity value. | final protected void | scanPIData(String target, XMLString data) Scans a processing data. | final protected boolean | scanTextDecl() Dispatch an XML "event". | final protected boolean | scanningInternalSubset() | public void | setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler) | public void | setDTDHandler(XMLDTDHandler dtdHandler) | public void | setInputSource(XMLInputSource inputSource) Sets the input source. | final protected void | setScannerState(int state) Sets the scanner state. | public 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) |
SCANNER_STATE_END_OF_INPUT | final protected static int SCANNER_STATE_END_OF_INPUT(Code) | | Scanner state: end of input.
|
SCANNER_STATE_MARKUP_DECL | final protected static int SCANNER_STATE_MARKUP_DECL(Code) | | Scanner state: markup declaration.
|
SCANNER_STATE_TEXT_DECL | final protected static int SCANNER_STATE_TEXT_DECL(Code) | | Scanner state: text declaration.
|
fScannerState | protected int fScannerState(Code) | | Scanner state.
|
fSeenExternalDTD | protected boolean fSeenExternalDTD(Code) | | Seen external DTD.
|
fSeenPEReferences | protected boolean fSeenPEReferences(Code) | | Seen a parameter entity reference.
|
fStandalone | protected boolean fStandalone(Code) | | Standalone.
|
XMLDTDScannerImpl | public XMLDTDScannerImpl()(Code) | | Default constructor.
|
endEntity | public void endEntity(String name, Augmentations augs) throws XNIException(Code) | | 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.
Parameters: name - The name of the entity. Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
getFeatureDefault | public Boolean getFeatureDefault(String featureId)(Code) | | Returns the default state for a feature, or null if this
component does not want to report a default value for this
feature.
Parameters: featureId - The feature identifier. since: Xerces 2.2.0 |
getPropertyDefault | public Object getPropertyDefault(String propertyId)(Code) | | Returns the default state for a property, or null if this
component does not want to report a default value for this
property.
Parameters: propertyId - The property identifier. since: Xerces 2.2.0 |
getRecognizedFeatures | public String[] getRecognizedFeatures()(Code) | | 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 | public String[] getRecognizedProperties()(Code) | | 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.
|
reset | public void reset()(Code) | | |
scanAttDefaultDecl | final protected String scanAttDefaultDecl(String elName, String atName, String type, XMLString defaultVal, XMLString nonNormalizedDefaultVal) throws IOException, XNIException(Code) | | Scans an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
Parameters: elName - Parameters: atName - The name of the attribute being scanned. Parameters: type - Parameters: defaultVal - The string to fill in with the default value. Parameters: nonNormalizedDefaultVal - |
scanAttlistDecl | final protected void scanAttlistDecl() throws IOException, XNIException(Code) | | 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'
|
scanComment | final protected void scanComment() throws IOException, XNIException(Code) | | Scans a comment.
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--'
|
scanDTDExternalSubset | public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException(Code) | | Scans the external subset of the document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. A value of false indicates thatthat the scanner should only scan the next portionof the document and return. A scanner instance ispermitted to completely scan a document if it doesnot support this "pull" scanning model. True if there is more to scan, false otherwise. |
scanDTDInternalSubset | public boolean scanDTDInternalSubset(boolean complete, boolean standalone, boolean hasExternalSubset) throws IOException, XNIException(Code) | | Scans the internal subset of the document.
Parameters: complete - True if the scanner should scan the documentcompletely, pushing all events to the registereddocument handler. A value of false indicates thatthat the scanner should only scan the next portionof the document and return. A scanner instance ispermitted to completely scan a document if it doesnot support this "pull" scanning model. Parameters: standalone - True if the document was specified as standalone.This value is important for verifying certainwell-formedness constraints. Parameters: hasExternalSubset - True if the document has an external DTD.This allows the scanner to properly notifythe handler of the end of the DTD in theabsence of an external subset. True if there is more to scan, false otherwise. |
scanDecls | final protected boolean scanDecls(boolean complete) throws IOException, XNIException(Code) | | Dispatch an XML "event".
Parameters: complete - True if this method is intended to scanand dispatch as much as possible. True if there is more to scan. throws: IOException - Thrown on i/o error. throws: XNIException - Thrown on parse error. |
scanElementDecl | final protected void scanElementDecl() throws IOException, XNIException(Code) | | Scans an element declaration
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'
[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
Note: Called after scanning past '<!ELEMENT'
|
scanEntityValue | final protected void scanEntityValue(XMLString value, XMLString nonNormalizedValue) throws IOException, XNIException(Code) | | Scans an entity value.
Parameters: value - The string to fill in with the value. Parameters: nonNormalizedValue - The string to fill in with the non-normalized value.Note: This method uses fString, fStringBuffer (throughthe use of scanCharReferenceValue), and fStringBuffer2, anything in themat the time of calling is lost. |
scanPIData | final protected void scanPIData(String target, XMLString data) throws IOException, XNIException(Code) | | 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)
Parameters: target - The PI target Parameters: data - The string to fill in with the data |
scanningInternalSubset | final protected boolean scanningInternalSubset()(Code) | | |
setDTDContentModelHandler | public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler)(Code) | | setDTDContentModelHandler
Parameters: dtdContentModelHandler - |
setDTDHandler | public void setDTDHandler(XMLDTDHandler dtdHandler)(Code) | | setDTDHandler
Parameters: dtdHandler - |
setInputSource | public void setInputSource(XMLInputSource inputSource) throws IOException(Code) | | Sets the input source.
Parameters: inputSource - The input source or null. throws: IOException - Thrown on i/o error. |
setScannerState | final protected void setScannerState(int state)(Code) | | Sets the scanner state.
Parameters: state - The new scanner state. |
startEntity | public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code) | | 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.
Parameters: name - The name of the entity. Parameters: identifier - The resource identifier. Parameters: encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader). Parameters: augs - Additional information that may include infoset augmentations throws: XNIException - Thrown by handler to signal an error. |
startPE | protected void startPE(String name, boolean literal) throws IOException, XNIException(Code) | | start a parameter entity dealing with the textdecl if there is any
Parameters: name - The name of the parameter entity to start (without the '%') Parameters: literal - Whether this is happening within a literal |
Methods inherited from org.apache.xerces.impl.XMLScanner | public void endEntity(String name, Augmentations augs) throws XNIException(Code)(Java Doc) public boolean getFeature(String featureId) throws XMLConfigurationException(Code)(Java Doc) protected String getVersionNotSupportedKey()(Code)(Java Doc) protected boolean isInvalid(int value)(Code)(Java Doc) protected boolean isInvalidLiteral(int value)(Code)(Java Doc) protected int isUnchangedByNormalization(XMLString value)(Code)(Java Doc) protected boolean isValidNCName(int value)(Code)(Java Doc) protected boolean isValidNameChar(int value)(Code)(Java Doc) protected boolean isValidNameStartChar(int value)(Code)(Java Doc) protected boolean isValidNameStartHighSurrogate(int value)(Code)(Java Doc) protected void normalizeWhitespace(XMLString value)(Code)(Java Doc) protected void normalizeWhitespace(XMLString value, int fromIndex)(Code)(Java Doc) protected void reportFatalError(String msgId, Object[] args) throws XNIException(Code)(Java Doc) public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)(Java Doc) protected void reset()(Code)(Java Doc) protected boolean scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, boolean checkEntities, String eleName) throws IOException, XNIException(Code)(Java Doc) protected int scanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2) throws IOException, XNIException(Code)(Java Doc) protected void scanComment(XMLStringBuffer text) throws IOException, XNIException(Code)(Java Doc) protected void scanExternalID(String[] identifiers, boolean optionalSystemId) throws IOException, XNIException(Code)(Java Doc) protected void scanPI() throws IOException, XNIException(Code)(Java Doc) protected void scanPIData(String target, XMLString data) throws IOException, XNIException(Code)(Java Doc) public String scanPseudoAttribute(boolean scanningTextDecl, XMLString value) throws IOException, XNIException(Code)(Java Doc) protected boolean scanPubidLiteral(XMLString literal) throws IOException, XNIException(Code)(Java Doc) protected boolean scanSurrogates(XMLStringBuffer buf) throws IOException, XNIException(Code)(Java Doc) protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues) throws IOException, XNIException(Code)(Java Doc) public void setFeature(String featureId, boolean value) throws XMLConfigurationException(Code)(Java Doc) public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc) public void startEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) protected boolean versionSupported(String version)(Code)(Java Doc)
|
|
|