Save This Page
Home » openjdk-7 » com.sun.org.apache.xerces.internal » impl » [javadoc | source]
com.sun.org.apache.xerces.internal.impl
public class: XMLNSDocumentScannerImpl [javadoc | source]
java.lang.Object
   com.sun.org.apache.xerces.internal.impl.XMLScanner
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
         com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl
            com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl

All Implemented Interfaces:
    XMLComponent, XMLEntityHandler, XMLBufferListener, XMLDocumentScanner

This class adds the functionality of namespace processing. This class has been modified as per the new design which is more suited to efficiently build pull parser. Lot of improvements have been done and the code has been added to support stax functionality/features. This class scans an XML document, checks if document has a DTD, and if DTD is not found the scanner will remove the DTD Validator from the pipeline and perform namespace binding.
Nested Class Summary:
protected final class  XMLNSDocumentScannerImpl.NSContentDriver  Driver to handle content scanning. 
Field Summary
protected  boolean fBindNamespaces    If is true, the dtd validator is no longer in the pipeline and the scanner should bind namespaces 
protected  boolean fPerformValidation    If validating parser, make sure we report an error in the scanner if DTD grammar is missing. 
protected  boolean fNotAddNSDeclAsAttribute    Default value of this feature is false, when in Stax mode this should be true 
Fields inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl:
SCANNER_STATE_XML_DECL,  SCANNER_STATE_PROLOG,  SCANNER_STATE_TRAILING_MISC,  SCANNER_STATE_DTD_INTERNAL_DECLS,  SCANNER_STATE_DTD_EXTERNAL,  SCANNER_STATE_DTD_EXTERNAL_DECLS,  SCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTION,  DOCUMENT_SCANNER,  LOAD_EXTERNAL_DTD,  DISALLOW_DOCTYPE_DECL_FEATURE,  DTD_SCANNER,  VALIDATION_MANAGER,  NAMESPACE_CONTEXT,  fDTDScanner,  fValidationManager,  fDTDDecl,  fReadingDTD,  fAddedListener,  fDoctypeName,  fDoctypePublicId,  fDoctypeSystemId,  fNamespaceContext,  fLoadExternalDTD,  fDisallowDoctype,  fSeenDoctypeDecl,  fScanEndElement,  fXMLDeclDriver,  fPrologDriver,  fDTDDriver,  fTrailingMiscDriver,  fStartPos,  fEndPos,  fSeenInternalSubset,  DOCTYPE,  COMMENTSTRING
Fields inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl:
fElementAttributeLimit,  fExternalSubsetResolver,  SCANNER_STATE_START_OF_MARKUP,  SCANNER_STATE_CONTENT,  SCANNER_STATE_PI,  SCANNER_STATE_DOCTYPE,  SCANNER_STATE_XML_DECL,  SCANNER_STATE_ROOT_ELEMENT,  SCANNER_STATE_COMMENT,  SCANNER_STATE_REFERENCE,  SCANNER_STATE_ATTRIBUTE,  SCANNER_STATE_ATTRIBUTE_VALUE,  SCANNER_STATE_END_OF_INPUT,  SCANNER_STATE_TERMINATED,  SCANNER_STATE_CDATA,  SCANNER_STATE_TEXT_DECL,  SCANNER_STATE_CHARACTER_DATA,  SCANNER_STATE_START_ELEMENT_TAG,  SCANNER_STATE_END_ELEMENT_TAG,  SCANNER_STATE_CHAR_REFERENCE,  SCANNER_STATE_BUILT_IN_REFS,  NOTIFY_BUILTIN_REFS,  ENTITY_RESOLVER,  cdata,  xmlDecl,  endTag,  DEBUG_START_END_ELEMENT,  DEBUG_NEXT,  DEBUG,  DEBUG_COALESCE,  fDocumentHandler,  fScannerLastState,  fEntityStore,  fEntityStack,  fMarkupDepth,  fEmptyElement,  fReadingAttributes,  fScannerState,  fInScanContent,  fLastSectionWasCData,  fLastSectionWasEntityReference,  fLastSectionWasCharacterData,  fHasExternalDTD,  fStandalone,  fVersion,  fCurrentElement,  fElementStack,  fElementStack2,  fPITarget,  fPIData,  fNotifyBuiltInRefs,  fReplaceEntityReferences,  fSupportExternalEntities,  fReportCdataEvent,  fIsCoalesce,  fDeclaredEncoding,  fDriver,  fContentDriver,  fElementQName,  fAttributeQName,  fAttributes,  fTempString,  fTempString2,  fStringBuffer,  fStringBuffer2,  fContentBuffer,  fScanToEnd,  dtdGrammarUtil,  fAddDefaultAttr,  foundBuiltInRefs,  fSecurityManager,  MAX_DEPTH_LIMIT,  ELEMENT_ARRAY_LENGTH,  MAX_POINTER_AT_A_DEPTH,  DEBUG_SKIP_ALGORITHM,  fElementArray,  fLastPointerLocation,  fElementPointer,  fPointerInfo,  fElementRawname,  fShouldSkip,  fAdd,  fSkip,  fUsebuffer
Fields inherited from com.sun.org.apache.xerces.internal.impl.XMLScanner:
NAMESPACES,  VALIDATION,  NOTIFY_CHAR_REFS,  PARSER_SETTINGS,  SYMBOL_TABLE,  ERROR_REPORTER,  ENTITY_MANAGER,  DEBUG_ATTR_NORMALIZATION,  attributeValueCache,  stringBufferCache,  fStringBufferIndex,  fAttributeCacheInitDone,  fAttributeCacheUsedCount,  fValidation,  fNamespaces,  fNotifyCharRefs,  fParserSettings,  fPropertyManager,  fSymbolTable,  fErrorReporter,  fEntityManager,  fEntityStore,  fEvent,  fEntityScanner,  fEntityDepth,  fCharRefLiteral,  fScanningAttribute,  fReportEntity,  fVersionSymbol,  fEncodingSymbol,  fStandaloneSymbol,  fAmpSymbol,  fLtSymbol,  fGtSymbol,  fQuotSymbol,  fAposSymbol,  fResourceIdentifier,  initialCacheCount
Method from com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl Summary:
createContentDriver,   next,   reset,   reset,   scanAttribute,   scanStartElement,   setDTDValidator
Methods from com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl:
createContentDriver,   endEntity,   getCharacterEncodingScheme,   getDTDDecl,   getFeatureDefault,   getNamespaceContext,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   getScannerStateName,   getScannetState,   next,   refresh,   reset,   reset,   scanDoctypeDecl,   setFeature,   setInputSource,   setProperty,   startEntity
Methods from com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl:
addElement,   canStore,   createContentDriver,   endEntity,   getAttributeIterator,   getCharacterData,   getComment,   getDocumentHandler,   getDriverName,   getElementPointer,   getElementQName,   getEntityName,   getFeatureDefault,   getPIData,   getPITarget,   getPropertyDefault,   getRecognizedFeatures,   getRecognizedProperties,   getScannerStateName,   getString,   hasAttributes,   isStandAlone,   next,   pr,   refresh,   refresh,   reset,   reset,   resetPointer,   scanAttribute,   scanCDATASection,   scanCharReference,   scanComment,   scanContent,   scanDocument,   scanEndElement,   scanEntityReference,   scanPIData,   scanStartElement,   scanXMLDeclOrTextDecl,   seekCloseOfStartTag,   setDocumentHandler,   setDriver,   setFeature,   setInputSource,   setProperty,   setScannerState,   skipElement,   skipElement,   skipFromTheBuffer,   skipQElement,   startEntity,   storePointerForADepth
Methods from com.sun.org.apache.xerces.internal.impl.XMLScanner:
endEntity,   getFeature,   getStringBuffer,   isInvalid,   isInvalidLiteral,   isValidNCName,   isValidNameChar,   isValidNameStartChar,   normalizeWhitespace,   reportFatalError,   reset,   reset,   reset,   scanAttributeValue,   scanCharReferenceValue,   scanComment,   scanExternalID,   scanPI,   scanPIData,   scanPseudoAttribute,   scanPubidLiteral,   scanSurrogates,   scanXMLDeclOrTextDecl,   setFeature,   setProperty,   setPropertyManager,   startEntity,   versionSupported
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl Detail:
 protected Driver createContentDriver() 
    Creates a content driver.
 public int next() throws IOException, XNIException 
    return the next state on the input
 public  void reset(PropertyManager propertyManager) 
    Resets the fields of this scanner.
 public  void reset(XMLComponentManager componentManager) throws XMLConfigurationException 
 protected  void scanAttribute(XMLAttributesImpl attributes) throws IOException, XNIException 
    Scans an attribute.

    [41] Attribute ::= Name Eq AttValue
    

    Note: This method assumes that the next character on the stream is the first character of the attribute name.

    Note: This method uses the fAttributeQName and fQName variables. The contents of these variables will be destroyed.

 protected boolean scanStartElement() throws IOException, XNIException 
    Scans a start element. This method will handle the binding of namespace information and notifying the handler of the start of the element.

    [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
    [40] STag ::= '<' Name (S Attribute)* S? '>'
    

    Note: This method assumes that the leading '<' character has been consumed.

    Note: This method uses the fElementQName and fAttributes variables. The contents of these variables will be destroyed. The caller should copy important information out of these variables before calling this method.

 public  void setDTDValidator(XMLDTDValidatorFilter dtd) 
    The scanner is responsible for removing DTD validator from the pipeline if it is not needed.