Top Description Fields Constructors Methods
com.ctc.wstx.dtd

public Class MinimalDTDReader

extends StreamScanner
Class Inheritance
Known Direct Subclasses
com.ctc.wstx.dtd.FullDTDReader
Imports
javax.xml.stream.Location, .XMLStreamException, com.ctc.wstx.api.ReaderConfig, com.ctc.wstx.ent.EntityDecl, com.ctc.wstx.io.WstxInputData, .WstxInputSource, com.ctc.wstx.sr.StreamScanner

Minimal DTD reader implementation that only knows how to skip internal DTD subsets.

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
mIsExternal

True, when reading external subset, false when reading internal subset.

Inherited from com.ctc.wstx.sr.StreamScanner:
CHAR_CR_LF_OR_NULLCHAR_FIRST_PURE_TEXTCHAR_LOWEST_LEGAL_LOCALNAME_CHARINT_CR_LF_OR_NULLmAllowXml11EscapedCharsInXml10mCachedEntitiesmCfgNsEnabledmCfgReplaceEntitiesmCfgTreatCharRefsAsEntitiesmConfigmCurrDepthmCurrEntitymCurrNamemDocInputEncodingmDocXmlEncodingmDocXmlVersionmEntityExpansionCountmEntityResolvermInputmInputTopDepthmNameBuffermNormalizeLFsmRootInputmTokenInputColmTokenInputRowmTokenInputTotal

Constructor Summary

AccessConstructor and Description
private
MinimalDTDReader(WstxInputSource input, ReaderConfig cfg)

Constructor used for reading/skipping internal subset.

protected
MinimalDTDReader(WstxInputSource input, ReaderConfig cfg, boolean isExt)

Common initialization part of int/ext subset constructors.

Method Summary

Modifier and TypeMethod and Description
protected char
protected char
protected EntityDecl
findEntity(String
Identifier of the entity to find
id
,
Object
Optional argument passed from caller; needed by DTD reader.
arg
)

Implements abstract com.ctc.wstx.sr.StreamScanner.findEntity.

Abstract method for sub-classes to implement, for finding a declared general or parsed entity.

public EntityDecl
findEntity(String entName)

Method that may need to be called by attribute default value validation code, during parsing....

protected String
public final Location
getLocation()

Implements abstract com.ctc.wstx.sr.StreamScanner.getLocation.

Implements com.ctc.wstx.sr.InputProblemReporter.getLocation.

What DTD reader returns doesn't really matter, so let's just return perceived start location (different from what stream readers actually do)

protected char
protected char
handleExpandedSurrogate(char first, char second)

protected void
handleIncompleteEntityProblem(WstxInputSource closing)

Implements abstract com.ctc.wstx.sr.StreamScanner.handleIncompleteEntityProblem.

Since improper entity/PE nesting is VC, not WFC, let's not react to this failure at all when only skipping the DTD subset.

protected void
handleUndeclaredEntity(String id)

Implements abstract com.ctc.wstx.sr.StreamScanner.handleUndeclaredEntity.

This is a VC, not WFC, nothing to do when skipping through DTD in non-supporting mode.

protected void
protected void
private void
private void
public static void
skipInternalSubset(WstxInputData
Link back to the input buffer shared with the owning stream reader.
srcData
,
WstxInputSource input, ReaderConfig cfg)

Method that just skims through structure of internal subset, but without doing any sort of validation, or parsing of contents.

protected void
skipInternalSubset()

Method that will skip through internal DTD subset, without doing any parsing, except for trying to match end of subset properly.

private void
skipLiteral(char quoteChar)

private void
protected void
protected void
Inherited from com.ctc.wstx.sr.StreamScanner:
_reportProblem_reportProblemcloseAllInputconstructFromIOEconstructLimitViolationconstructNullCharExceptionconstructWfcExceptionensureInputexpandBy50PctexpandEntityfullyResolveEntitygetConfiggetCurrentInputgetCurrentLocationgetIntEntitygetLastCharLocationgetNameBuffergetNextgetNextAfterWSgetNextChargetNextCharAfterWSgetNextCharFromCurrentgetNextInCurrAfterWSgetNextInCurrAfterWSgetSourcegetStartLocationgetSystemIdinitInputSourceinputInBufferloadMoreloadMoreloadMoreFromCurrentloadMoreFromCurrentmarkLFmarkLFparseEntityNameparseFNameForErrorparseFullNameparseFullNameparseFullName2parseLocalNameparseLocalName2parsePublicIdparseSystemIdparseUntilpeekNextpushbackreportProblemreportProblemreportValidationProblemreportValidationProblemreportValidationProblemreportValidationProblemreportValidationProblemresolveCharOnlyEntityresolveNonCharEntityresolveSimpleEntityskipCRLFskipFullNamethrowFromIOEthrowFromStrEthrowInvalidSpacethrowInvalidSpacethrowLazyErrorthrowNullCharthrowNullParentthrowParseErrorthrowParseErrorthrowUnexpectedCharthrowUnexpectedEOBthrowUnexpectedEOFthrowWfcExceptiontokenTypeDescverifyLimit

Field Detail

mIsExternalback to summary
pack-priv final boolean mIsExternal

True, when reading external subset, false when reading internal subset.

Constructor Detail

MinimalDTDReaderback to summary
private MinimalDTDReader(WstxInputSource input, ReaderConfig cfg)

Constructor used for reading/skipping internal subset.

MinimalDTDReaderback to summary
protected MinimalDTDReader(WstxInputSource input, ReaderConfig cfg, boolean isExt)

Common initialization part of int/ext subset constructors.

Method Detail

dtdNextCharback to summary
protected char dtdNextChar() throws XMLStreamException
dtdNextFromCurrback to summary
protected char dtdNextFromCurr() throws XMLStreamException
findEntityback to summary
protected EntityDecl findEntity(String id, Object arg)

Implements abstract com.ctc.wstx.sr.StreamScanner.findEntity.

Doc from com.ctc.wstx.sr.StreamScanner.findEntity.

Abstract method for sub-classes to implement, for finding a declared general or parsed entity.

Parameters
id:String

Identifier of the entity to find

arg:Object

Optional argument passed from caller; needed by DTD reader.

Annotations
@Override
findEntityback to summary
public EntityDecl findEntity(String entName)

Method that may need to be called by attribute default value validation code, during parsing....

03-Dec-2004, TSa: This is not particularly elegant: should be able to pass the information some other way. But for now it works and is necessary.

getErrorMsgback to summary
protected String getErrorMsg()
getLocationback to summary
public final Location getLocation()

Implements abstract com.ctc.wstx.sr.StreamScanner.getLocation.

Implements com.ctc.wstx.sr.InputProblemReporter.getLocation.

What DTD reader returns doesn't really matter, so let's just return perceived start location (different from what stream readers actually do)

Annotations
@Override
getNextSkippingPEsback to summary
protected char getNextSkippingPEs() throws XMLStreamException
handleExpandedSurrogateback to summary
protected char handleExpandedSurrogate(char first, char second)
handleIncompleteEntityProblemback to summary
protected void handleIncompleteEntityProblem(WstxInputSource closing) throws XMLStreamException

Implements abstract com.ctc.wstx.sr.StreamScanner.handleIncompleteEntityProblem.

Since improper entity/PE nesting is VC, not WFC, let's not react to this failure at all when only skipping the DTD subset.

Annotations
@Override
handleUndeclaredEntityback to summary
protected void handleUndeclaredEntity(String id) throws XMLStreamException

Implements abstract com.ctc.wstx.sr.StreamScanner.handleUndeclaredEntity.

This is a VC, not WFC, nothing to do when skipping through DTD in non-supporting mode.

Annotations
@Override
skipCommentback to summary
protected void skipComment() throws XMLStreamException
skipCommentContentback to summary
protected void skipCommentContent() throws XMLStreamException
skipDeclarationback to summary
private void skipDeclaration(char c) throws XMLStreamException
skipDTDNameback to summary
private void skipDTDName() throws XMLStreamException
skipInternalSubsetback to summary
public static void skipInternalSubset(WstxInputData srcData, WstxInputSource input, ReaderConfig cfg) throws XMLStreamException

Method that just skims through structure of internal subset, but without doing any sort of validation, or parsing of contents. Method may still throw an exception, if skipping causes EOF or there's an I/O problem.

Parameters
srcData:WstxInputData

Link back to the input buffer shared with the owning stream reader.

skipInternalSubsetback to summary
protected void skipInternalSubset() throws XMLStreamException

Method that will skip through internal DTD subset, without doing any parsing, except for trying to match end of subset properly.

skipLiteralback to summary
private void skipLiteral(char quoteChar) throws XMLStreamException
skipPEback to summary
private void skipPE() throws XMLStreamException
skipPIback to summary
protected void skipPI() throws XMLStreamException
throwIllegalCallback to summary
protected void throwIllegalCall() throws Error