org.apache.xerces.impl
Class XMLDTDScannerImpl

java.lang.Object
  |
  +--org.apache.xerces.impl.XMLScanner
        |
        +--org.apache.xerces.impl.XMLDTDScannerImpl

public class XMLDTDScannerImpl
extends XMLScanner
implements org.apache.xerces.xni.parser.XMLDTDScanner, org.apache.xerces.xni.parser.XMLComponent, XMLEntityHandler

Version:
$Id: XMLDTDScannerImpl.java,v 1.1.2.1 2001/08/06 05:17:54 andyc Exp $
Author:
Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000, Arnaud Le Hors, IBM, Andy Clark, IBM, Glenn Marcy, IBM, Eric Ye, IBM

Inner classes inherited from class org.apache.xerces.impl.XMLScanner
XMLScanner.AttrEntityStack
 
Field Summary
protected static java.lang.String ERROR_REPORTER
          Property identifier: error reporter.
protected  org.apache.xerces.xni.XMLDTDContentModelHandler fDTDContentModelHandler
          fDTDContentModelHandler
protected  org.apache.xerces.xni.XMLDTDHandler fDTDHandler
          fDTDHandler
protected  XMLErrorReporter fErrorReporter
          fErrorReporter
protected  int fScannerState
          Scanner state.
protected  boolean fSeenExternalDTD
          fSeenExternalDTD
protected  boolean fSeenExternalPE
          fSeenExternalPE
protected  boolean fStandalone
          fStandalone
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.
protected static java.lang.String VALIDATION
          Feature identifier: validation.
 
Fields inherited from class org.apache.xerces.impl.XMLScanner
DEBUG_ATTR_ENTITIES, DEBUG_ATTR_NORMALIZATION, fAmpSymbol, fAposSymbol, fAttributeEntityStack, fAttributeOffset, fCharRefLiteral, fEncodingSymbol, fEntityDepth, fEntityManager, fEntityScanner, fErrorReporter, fGtSymbol, fLtSymbol, fNotifyCharRefs, fQuotSymbol, fScanningAttribute, fStandaloneSymbol, fString, fStringBuffer, fStringBuffer2, fStrings, fSymbolTable, fValidation, fVersionSymbol, NOTIFY_CHAR_REFS, VALIDATION
 
Constructor Summary
XMLDTDScannerImpl()
          Default constructor.
 
Method Summary
 void endEntity(java.lang.String name)
          endEntity
 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(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)
          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)
          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(boolean complete)
          Dispatch an XML "event".
 void setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler dtdContentModelHandler)
          setDTDContentModelHandler
 void setDTDHandler(org.apache.xerces.xni.XMLDTDHandler dtdHandler)
          setDTDHandler
 void setFeature(java.lang.String featureId, boolean state)
          setFeature
 void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
          Sets the input source.
 void setProperty(java.lang.String propertyId, java.lang.Object value)
          setProperty
protected  void setScannerState(int state)
          Sets the scanner state.
 void startEntity(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String baseSystemId, java.lang.String encoding)
          startEntity
protected  void startPE(java.lang.String name, boolean literal)
          start a parameter entity dealing with the textdecl if there is any
 
Methods inherited from class org.apache.xerces.impl.XMLScanner
normalizeWhitespace, reportFatalError, scanAttributeValue, scanCharReferenceValue, scanComment, scanExternalID, scanPI, scanPseudoAttribute, scanPubidLiteral, scanSurrogates, scanXMLDeclOrTextDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCANNER_STATE_END_OF_INPUT

protected static final int SCANNER_STATE_END_OF_INPUT
Scanner state: end of input.

SCANNER_STATE_TEXT_DECL

protected static final int SCANNER_STATE_TEXT_DECL
Scanner state: text declaration.

SCANNER_STATE_MARKUP_DECL

protected static final int SCANNER_STATE_MARKUP_DECL
Scanner state: markup declaration.

VALIDATION

protected static final java.lang.String VALIDATION
Feature identifier: validation.

ERROR_REPORTER

protected static final java.lang.String ERROR_REPORTER
Property identifier: error reporter.

fErrorReporter

protected XMLErrorReporter fErrorReporter
fErrorReporter

fDTDHandler

protected org.apache.xerces.xni.XMLDTDHandler fDTDHandler
fDTDHandler

fDTDContentModelHandler

protected org.apache.xerces.xni.XMLDTDContentModelHandler fDTDContentModelHandler
fDTDContentModelHandler

fScannerState

protected int fScannerState
Scanner state.

fStandalone

protected boolean fStandalone
fStandalone

fSeenExternalDTD

protected boolean fSeenExternalDTD
fSeenExternalDTD

fSeenExternalPE

protected boolean fSeenExternalPE
fSeenExternalPE
Constructor Detail

XMLDTDScannerImpl

public XMLDTDScannerImpl()
Default constructor.
Method Detail

setInputSource

public void setInputSource(org.apache.xerces.xni.parser.XMLInputSource inputSource)
                    throws java.io.IOException
Sets the input source.
Specified by:
setInputSource in interface org.apache.xerces.xni.parser.XMLDTDScanner
Parameters:
inputSource - The input source.
Throws:
java.io.IOException - Thrown on i/o error.

scanDTDExternalSubset

public boolean scanDTDExternalSubset(boolean complete)
                              throws java.io.IOException,
                                     org.apache.xerces.xni.XNIException
Scans the external subset of the document.
Specified by:
scanDTDExternalSubset in interface org.apache.xerces.xni.parser.XMLDTDScanner
Parameters:
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.

scanDTDInternalSubset

public boolean scanDTDInternalSubset(boolean complete,
                                     boolean standalone,
                                     boolean hasExternalSubset)
                              throws java.io.IOException,
                                     org.apache.xerces.xni.XNIException
Scans the internal subset of the document.
Specified by:
scanDTDInternalSubset in interface org.apache.xerces.xni.parser.XMLDTDScanner
Parameters:
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.
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.

reset

public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
           throws org.apache.xerces.xni.parser.XMLConfigurationException
reset
Specified by:
reset in interface org.apache.xerces.xni.parser.XMLComponent
Overrides:
reset in class XMLScanner
Parameters:
componentManager -  

getRecognizedFeatures

public java.lang.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.
Specified by:
getRecognizedFeatures in interface org.apache.xerces.xni.parser.XMLComponent

setFeature

public void setFeature(java.lang.String featureId,
                       boolean state)
                throws org.apache.xerces.xni.parser.XMLConfigurationException
setFeature
Specified by:
setFeature in interface org.apache.xerces.xni.parser.XMLComponent
Overrides:
setFeature in class XMLScanner
Parameters:
featureId -  
state -  

getRecognizedProperties

public java.lang.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.
Specified by:
getRecognizedProperties in interface org.apache.xerces.xni.parser.XMLComponent

setProperty

public void setProperty(java.lang.String propertyId,
                        java.lang.Object value)
                 throws org.apache.xerces.xni.parser.XMLConfigurationException
setProperty
Specified by:
setProperty in interface org.apache.xerces.xni.parser.XMLComponent
Overrides:
setProperty in class XMLScanner
Parameters:
propertyId -  
value -  

setDTDHandler

public void setDTDHandler(org.apache.xerces.xni.XMLDTDHandler dtdHandler)
setDTDHandler
Parameters:
dtdHandler -  

setDTDContentModelHandler

public void setDTDContentModelHandler(org.apache.xerces.xni.XMLDTDContentModelHandler dtdContentModelHandler)
setDTDContentModelHandler
Parameters:
dtdContentModelHandler -  

startEntity

public void startEntity(java.lang.String name,
                        java.lang.String publicId,
                        java.lang.String systemId,
                        java.lang.String baseSystemId,
                        java.lang.String encoding)
                 throws org.apache.xerces.xni.XNIException
startEntity
Specified by:
startEntity in interface XMLEntityHandler
Overrides:
startEntity in class XMLScanner
Parameters:
name -  
publicId -  
systemId -  
encoding -  

endEntity

public void endEntity(java.lang.String name)
               throws org.apache.xerces.xni.XNIException
endEntity
Specified by:
endEntity in interface XMLEntityHandler
Overrides:
endEntity in class XMLScanner
Parameters:
name -  

setScannerState

protected final void setScannerState(int state)
Sets the scanner state.
Parameters:
state - The new scanner state.

scanningInternalSubset

protected final boolean scanningInternalSubset()

startPE

protected void startPE(java.lang.String name,
                       boolean literal)
                throws java.io.IOException,
                       org.apache.xerces.xni.XNIException
start a parameter entity dealing with the textdecl if there is any
Parameters:
name - The name of the parameter entity to start (without the '%')
literal - Whether this is happening within a literal

scanTextDecl

protected final boolean scanTextDecl(boolean complete)
                              throws java.io.IOException,
                                     org.apache.xerces.xni.XNIException
Dispatch an XML "event".
Parameters:
complete - True if this method is intended to scan and dispatch as much as possible.
Throws:
java.io.IOException - Thrown on i/o error.
org.apache.xerces.xni.XNIException - Thrown on parse error.

scanPIData

protected final void scanPIData(java.lang.String target,
                                org.apache.xerces.xni.XMLString data)
                         throws java.io.IOException,
                                org.apache.xerces.xni.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)
Overrides:
scanPIData in class XMLScanner
Parameters:
target - The PI target
data - The string to fill in with the data

scanComment

protected final void scanComment()
                          throws java.io.IOException,
                                 org.apache.xerces.xni.XNIException
Scans a comment.

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

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


scanElementDecl

protected final void scanElementDecl()
                              throws java.io.IOException,
                                     org.apache.xerces.xni.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'


scanAttlistDecl

protected final void scanAttlistDecl()
                              throws java.io.IOException,
                                     org.apache.xerces.xni.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'


scanAttDefaultDecl

protected final java.lang.String scanAttDefaultDecl(java.lang.String elName,
                                                    java.lang.String atName,
                                                    java.lang.String type,
                                                    org.apache.xerces.xni.XMLString defaultVal)
                                             throws java.io.IOException,
                                                    org.apache.xerces.xni.XNIException
Scans an attribute default declaration

 [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue)
 
Parameters:
name - The name of the attribute being scanned.
defaultVal - The string to fill in with the default value.

scanEntityValue

protected final void scanEntityValue(org.apache.xerces.xni.XMLString value)
                              throws java.io.IOException,
                                     org.apache.xerces.xni.XNIException
Scans an entity value.
Parameters:
value - The string to fill in with the value. Note: This method uses fString, fStringBuffer (through the use of scanCharReferenceValue), and fStringBuffer2, anything in them at the time of calling is lost.

scanDecls

protected final boolean scanDecls(boolean complete)
                           throws java.io.IOException,
                                  org.apache.xerces.xni.XNIException
Dispatch an XML "event".
Parameters:
complete - True if this method is intended to scan and dispatch as much as possible.
Throws:
java.io.IOException - Thrown on i/o error.
org.apache.xerces.xni.XNIException - Thrown on parse error.


Copyright © 1999-2001 Apache XML Project. All Rights Reserved.