Save This Page
Home » Xerces-J-src.2.9.1 » org.apache.xerces » impl » [javadoc | source]
org.apache.xerces.impl
public class: XMLDTDScannerImpl [javadoc | source]
java.lang.Object
   org.apache.xerces.impl.XMLScanner
      org.apache.xerces.impl.XMLDTDScannerImpl

All Implemented Interfaces:
    XMLDTDScanner, XMLComponent, XMLEntityHandler

Direct Known Subclasses:
    XML11DTDScannerImpl

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:

Field Summary
protected static final  int SCANNER_STATE_END_OF_INPUT    Scanner state: end of input. 
protected static final  int SCANNER_STATE_TEXT_DECL    Scanner state: text declaration. 
protected static final  int SCANNER_STATE_MARKUP_DECL    Scanner state: markup declaration. 
protected  XMLDTDHandler fDTDHandler    DTD handler. 
protected  XMLDTDContentModelHandler fDTDContentModelHandler    DTD content model handler. 
protected  int fScannerState    Scanner state. 
protected  boolean fStandalone    Standalone. 
protected  boolean fSeenExternalDTD    Seen external DTD. 
protected  boolean fSeenPEReferences    Seen a parameter entity reference. 
Fields inherited from org.apache.xerces.impl.XMLScanner:
VALIDATION,  NAMESPACES,  NOTIFY_CHAR_REFS,  PARSER_SETTINGS,  SYMBOL_TABLE,  ERROR_REPORTER,  ENTITY_MANAGER,  DEBUG_ATTR_NORMALIZATION,  fValidation,  fNamespaces,  fNotifyCharRefs,  fParserSettings,  fSymbolTable,  fErrorReporter,  fEntityManager,  fEntityScanner,  fEntityDepth,  fCharRefLiteral,  fScanningAttribute,  fReportEntity,  fVersionSymbol,  fEncodingSymbol,  fStandaloneSymbol,  fAmpSymbol,  fLtSymbol,  fGtSymbol,  fQuotSymbol,  fAposSymbol,  fResourceIdentifier
Constructor:
 public XMLDTDScannerImpl() 
 public XMLDTDScannerImpl(SymbolTable symbolTable,
    XMLErrorReporter errorReporter,
    XMLEntityManager entityManager) 
    Constructor for he use of non-XMLComponentManagers.
Method from org.apache.xerces.impl.XMLDTDScannerImpl Summary:
endEntity,   getDTDContentModelHandler,   getDTDHandler,   getFeatureDefault,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   reset,   reset,   scanAttDefaultDecl,   scanAttlistDecl,   scanComment,   scanDTDExternalSubset,   scanDTDInternalSubset,   scanDecls,   scanElementDecl,   scanEntityValue,   scanPIData,   scanTextDecl,   scanningInternalSubset,   setDTDContentModelHandler,   setDTDHandler,   setInputSource,   setScannerState,   startEntity,   startPE
Methods from org.apache.xerces.impl.XMLScanner:
endEntity,   getFeature,   getVersionNotSupportedKey,   isInvalid,   isInvalidLiteral,   isUnchangedByNormalization,   isValidNCName,   isValidNameChar,   isValidNameStartChar,   isValidNameStartHighSurrogate,   normalizeWhitespace,   normalizeWhitespace,   reportFatalError,   reset,   reset,   scanAttributeValue,   scanCharReferenceValue,   scanComment,   scanExternalID,   scanPI,   scanPIData,   scanPseudoAttribute,   scanPubidLiteral,   scanSurrogates,   scanXMLDeclOrTextDecl,   setFeature,   setProperty,   startEntity,   versionSupported
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.xerces.impl.XMLDTDScannerImpl Detail:
 public  void endEntity(String name,
    Augmentations augs) throws XNIException 
    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.
 public XMLDTDContentModelHandler getDTDContentModelHandler() 
    getDTDContentModelHandler
 public XMLDTDHandler getDTDHandler() 
    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. This method may return null if no features are recognized by this component.
 public String[] getRecognizedProperties() 
    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.
 public  void reset() 
 public  void reset(XMLComponentManager componentManager) throws XMLConfigurationException 
    reset
 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)
    
 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'

 protected final  void scanComment() throws IOException, XNIException 
    Scans a comment.

    [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
    

    Note: Called after scanning past '<!--'

 public boolean scanDTDExternalSubset(boolean complete) throws IOException, XNIException 
    Scans the external subset of the document.
 public boolean scanDTDInternalSubset(boolean complete,
    boolean standalone,
    boolean hasExternalSubset) throws IOException, XNIException 
    Scans the internal subset of the document.
 protected final boolean scanDecls(boolean complete) throws IOException, XNIException 
    Dispatch an XML "event".
 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'

 protected final  void scanEntityValue(XMLString value,
    XMLString nonNormalizedValue) throws IOException, XNIException 
    Scans an entity value.
 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)
 protected final boolean scanTextDecl() throws IOException, XNIException 
    Dispatch an XML "event".
 protected final boolean scanningInternalSubset() 
 public  void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler) 
    setDTDContentModelHandler
 public  void setDTDHandler(XMLDTDHandler dtdHandler) 
    setDTDHandler
 public  void setInputSource(XMLInputSource inputSource) throws IOException 
    Sets the input source.
 protected final  void setScannerState(int state) 
    Sets the scanner state.
 public  void startEntity(String name,
    XMLResourceIdentifier identifier,
    String encoding,
    Augmentations augs) throws XNIException 
    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.
 protected  void startPE(String name,
    boolean literal) throws IOException, XNIException 
    start a parameter entity dealing with the textdecl if there is any