APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl

public Class XMLDocumentScannerImpl

extends XMLDocumentFragmentScannerImpl
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl, com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl
Imports
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDDescription, com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException, com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter, com.sun.org.apache.xerces.internal.impl.validation.ValidationManager, com.sun.org.apache.xerces.internal.util.NamespaceSupport, .XMLChar, .XMLResourceIdentifierImpl, .XMLStringBuffer, com.sun.org.apache.xerces.internal.xni.Augmentations, .NamespaceContext, .XMLResourceIdentifier, .XNIException, com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager, .XMLConfigurationException, .XMLDTDScanner, .XMLInputSource, com.sun.xml.internal.stream.Entity, .StaxXMLInputSource, com.sun.xml.internal.stream.dtd.DTDGrammarUtil, java.io.CharConversionException, .EOFException, .IOException, javax.xml.XMLConstants, javax.xml.stream.events.XMLEvent, jdk.xml.internal.JdkConstants, .JdkProperty.State, .JdkXmlUtils, .SecuritySupport, .XMLSecurityManager.Limit

This class is responsible for scanning XML document structure and content. 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.
Authors
Neeraj Bajaj, Sun Microsystems, K.Venugopal, Sun Microsystems, Glenn Marcy, IBM, Andy Clark, IBM, Arnaud Le Hors, IBM, Eric Ye, IBM, Sunitha Reddy, Sun Microsystems Refer to the table in unit-test javax.xml.stream.XMLStreamReaderTest.SupportDTD for changes related to property SupportDTD., Joe Wang, Sun Microsystems

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
XMLDocumentScannerImpl.ContentDriver

Driver to handle content scanning.

protected class
XMLDocumentScannerImpl.DTDDriver

Driver to handle the internal and external DTD subsets.

protected class
XMLDocumentScannerImpl.PrologDriver

Driver to handle prolog scanning.

protected class
XMLDocumentScannerImpl.TrailingMiscDriver

Driver to handle trailing miscellaneous section scanning.

protected class
XMLDocumentScannerImpl.XMLDeclDriver

Driver to handle XMLDecl scanning.

Field Summary

Modifier and TypeField and Description
private static final char[]
protected static final String
DISALLOW_DOCTYPE_DECL_FEATURE

Feature identifier: load external DTD.

private static final char[]
protected static final String
DOCUMENT_SCANNER

Property identifier document scanner:

protected static final String
DTD_SCANNER

Property identifier: DTD scanner.

protected boolean
protected String
fDoctypeName

Doctype name.

protected String
fDoctypePublicId

Doctype declaration public identifier.

protected String
fDoctypeSystemId

Doctype declaration system identifier.

protected XMLStringBuffer
private final XMLDTDDescription
fDTDDescription

A DTD Description.

protected XMLDocumentFragmentScannerImpl.Driver
fDTDDriver

DTD driver.

protected XMLDTDScanner
fDTDScanner

DTD scanner.

private static final Boolean[]
protected int
private XMLInputSource
fExternalSubsetSource

External subset source.

protected boolean
fLoadExternalDTD

Load external DTD.

protected NamespaceContext
fNamespaceContext

Namespace support.

protected XMLDocumentFragmentScannerImpl.Driver
fPrologDriver

Prolog driver.

protected boolean
protected boolean
protected boolean
fSeenDoctypeDecl

Seen doctype declaration.

protected boolean
protected int
private String[]
protected XMLDocumentFragmentScannerImpl.Driver
fTrailingMiscDriver

Trailing miscellaneous section driver.

protected ValidationManager
fValidationManager

Validation manager .

protected XMLDocumentFragmentScannerImpl.Driver
fXMLDeclDriver

XML declaration driver.

protected static final String
LOAD_EXTERNAL_DTD

Feature identifier: load external DTD.

protected static final String
NAMESPACE_CONTEXT

property identifier: NamespaceContext

private static final Object[]
private static final String[]
private static final String[]
protected static final int
SCANNER_STATE_DTD_EXTERNAL

Scanner state: open DTD external subset.

protected static final int
SCANNER_STATE_DTD_EXTERNAL_DECLS

Scanner state: DTD external declarations.

protected static final int
SCANNER_STATE_DTD_INTERNAL_DECLS

Scanner state: DTD internal declarations.

protected static final int
SCANNER_STATE_NO_SUCH_ELEMENT_EXCEPTION

Scanner state: NO MORE ELEMENTS.

protected static final int
SCANNER_STATE_PROLOG

Scanner state: prolog.

protected static final int
SCANNER_STATE_TRAILING_MISC

Scanner state: trailing misc.

protected static final int
protected static final String
Inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl:
builtInRefCharacterHandledCREATE_ENTITY_REF_NODESDEBUGDEBUG_SKIP_ALGORITHMDEBUG_START_END_ELEMENTdtdGrammarUtilELEMENT_ARRAY_LENGTHENTITY_RESOLVEREXTERNAL_ACCESS_DEFAULTfAccessExternalDTDfAddfAddDefaultAttrfAttributeQNamefAttributesfCatalogFilefCDataEndfCDataStartfContentBufferfContentDriverfCreateEntityRefNodesfCurrentElementfDeclaredEncodingfDisallowDoctypefDocumentHandlerfDriverfDTDErrorCodefElementArrayfElementAttributeLimitfElementPointerfElementQNamefElementRawnamefElementStackfElementStack2fEmptyElementfEntityStackfEntityStorefExternalSubsetResolverfHasExternalDTDfInCDatafInScanContentfIsCoalescefLastPointerLocationfLastSectionWasCDatafLastSectionWasCharacterDatafLastSectionWasEntityReferencefMarkupDepthfNotifyBuiltInRefsfoundBuiltInRefsfPIDatafPITargetfPointerInfofReadingAttributesfReplaceEntityReferencesfReportCdataEventfScannerLastStatefScannerStatefScanToEndfShouldSkipfSkipfStandalonefStandaloneSetfStrictURIfStringBufferfStringBuffer2fSupportDTDfSupportExternalEntitiesfTempStringfTempString2fUsebufferfUseCatalogfVersionfXMLNameLimitMAX_DEPTH_LIMITMAX_POINTER_AT_A_DEPTHNOTIFY_BUILTIN_REFSSCANNER_STATE_ATTRIBUTESCANNER_STATE_ATTRIBUTE_VALUESCANNER_STATE_BUILT_IN_REFSSCANNER_STATE_CDATASCANNER_STATE_CHAR_REFERENCESCANNER_STATE_CHARACTER_DATASCANNER_STATE_COMMENTSCANNER_STATE_CONTENTSCANNER_STATE_DOCTYPESCANNER_STATE_END_ELEMENT_TAGSCANNER_STATE_END_OF_INPUTSCANNER_STATE_PISCANNER_STATE_REFERENCESCANNER_STATE_ROOT_ELEMENTSCANNER_STATE_START_ELEMENT_TAGSCANNER_STATE_START_OF_MARKUPSCANNER_STATE_TERMINATEDSCANNER_STATE_TEXT_DECLSTANDARD_URI_CONFORMANTXMLDECL

Constructor Summary

AccessConstructor and Description
public
XMLDocumentScannerImpl()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
private void
checkDTDSetting()

Checks the DTD settings.

protected XMLDocumentFragmentScannerImpl.Driver
public void
public String
public XMLStringBuffer
public Boolean
getFeatureDefault(String
The feature identifier.
featureId
)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.getFeatureDefault.

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getFeatureDefault.

Returns the default state for a feature, or null if this component does not want to report a default value for this feature.

public NamespaceContext
public Object
getPropertyDefault(String
The property identifier.
propertyId
)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.getPropertyDefault.

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.getPropertyDefault.

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[]
public String[]
protected String
public int
getScannetState()

return the state of the scanner

public int
public void
public void
public void
protected boolean
scanDoctypeDecl(boolean supportDTD)

Scans a doctype declaration.

protected void
setEndDTDScanState()

Set the scanner state after scanning DTD

public void
setFeature(String
The feature identifier.
featureId
,
boolean
The state of the feature.
state
)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.setFeature.

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setFeature.

Sets the state of a feature.

public void
public void
setProperty(String
The property identifier.
propertyId
,
Object
The value of the property.
value
)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.setProperty.

Implements com.sun.org.apache.xerces.internal.xni.parser.XMLComponent.setProperty.

Sets the value of a property.

public void
startEntity(String
The name of the entity.
name
,
XMLResourceIdentifier
The resource identifier.
identifier
,
String
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).
encoding
,
Augmentations augs)

Overrides com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.startEntity.

Implements com.sun.org.apache.xerces.internal.impl.XMLEntityHandler.startEntity.

This method notifies of the start of an entity.

Inherited from com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl:
addElementcanStorecheckAccesscheckDepthgetAttributeIteratorgetCharacterDatagetCommentgetDocumentHandlergetDriverNamegetElementPointergetElementQNamegetEntityNamegetPIDatagetPITargetgetStringhasAttributesisStandAloneprrefreshresetCommonresetPointerscanAttributescanCDATASectionscanCharReferencescanCommentscanContentscanDocumentscanEndElementscanEntityReferencescanPIDatascanStartElementscanXMLDeclOrTextDeclseekCloseOfStartTagsetDocumentHandlersetDriversetScannerStateskipElementskipElementskipFromTheBufferskipQElementstandaloneSetstorePointerForADepth