public class ValidatingStreamReader extends TypedStreamReader
XMLStreamReader2
that builds on TypedStreamReader and adds full DTD-handling
including DTD validation| Modifier and Type | Field and Description |
|---|---|
protected org.codehaus.stax2.validation.ValidationProblemHandler |
mVldProbHandler
Custom validation problem handler, if any.
|
_base64Decoder, _decoderFactory, MASK_TYPED_ACCESS_ARRAY, MASK_TYPED_ACCESS_BINARYMASK_GET_ELEMENT_TEXT, MASK_GET_TEXT, MASK_GET_TEXT_WITH_WRITER, MASK_GET_TEXT_XXX, mAttrCollector, mCfgCoalesceText, mCfgLazyParsing, mCfgReportTextAsChars, mCheckIndentation, mConfigFlags, mCurrTextLength, mCurrToken, mDocStandalone, mDtdPublicId, mDtdSystemId, mElementStack, mGeneralEntities, mOwner, mParseState, mPendingException, mReturnNullForDefaultNamespace, mRootLName, mRootPrefix, mSecondaryToken, mShortestTextSegment, mStDoctypeFound, mStEmptyElem, mStTextThreshold, mTextBuffer, mTokenState, mValidateText, mVldContent, mWsStatus, sPrefixXml, sPrefixXmlnsCHAR_CR_LF_OR_NULL, CHAR_FIRST_PURE_TEXT, CHAR_LOWEST_LEGAL_LOCALNAME_CHAR, INT_CR_LF_OR_NULL, mCachedEntities, mCfgNsEnabled, mCfgReplaceEntities, mCfgTreatCharRefsAsEntities, mConfig, mCurrDepth, mCurrEntity, mCurrName, mDocXmlVersion, mEntityExpansionCount, mInput, mInputTopDepth, mNameBuffer, mNormalizeLFs, mRootInput, mTokenInputCol, mTokenInputRow, mTokenInputTotalCHAR_NULL, CHAR_SPACE, INT_NULL, INT_SPACE, MAX_UNICODE_CHAR, mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mInputBuffer, mInputEnd, mInputPtr, mXml11ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENTCFG_AUTO_CLOSE_INPUT, CFG_CACHE_DTDS, CFG_CACHE_DTDS_BY_PUBLIC_ID, CFG_COALESCE_TEXT, CFG_INTERN_NAMES, CFG_INTERN_NS_URIS, CFG_LAZY_PARSING, CFG_NAMESPACE_AWARE, CFG_NORMALIZE_LFS, CFG_PRESERVE_LOCATION, CFG_REPLACE_ENTITY_REFS, CFG_REPORT_CDATA, CFG_REPORT_PROLOG_WS, CFG_SUPPORT_DTD, CFG_SUPPORT_DTDPP, CFG_SUPPORT_EXTERNAL_ENTITIES, CFG_TREAT_CHAR_REFS_AS_ENTS, CFG_VALIDATE_AGAINST_DTD, CFG_XMLID_TYPING, CFG_XMLID_UNIQ_CHECKSSUFFIX_EOF_EXP_NAME, SUFFIX_IN_ATTR_VALUE, SUFFIX_IN_CDATA, SUFFIX_IN_CLOSE_ELEMENT, SUFFIX_IN_COMMENT, SUFFIX_IN_DEF_ATTR_VALUE, SUFFIX_IN_DOC, SUFFIX_IN_DTD, SUFFIX_IN_DTD_EXTERNAL, SUFFIX_IN_DTD_INTERNAL, SUFFIX_IN_ELEMENT, SUFFIX_IN_ENTITY_REF, SUFFIX_IN_EPILOG, SUFFIX_IN_NAME, SUFFIX_IN_PROC_INSTR, SUFFIX_IN_PROLOG, SUFFIX_IN_TEXT, SUFFIX_IN_XML_DECL| Modifier and Type | Method and Description |
|---|---|
protected DTDId |
constructDtdId(String pubId,
String sysId) |
protected DTDId |
constructDtdId(URI sysId) |
static ValidatingStreamReader |
createValidatingStreamReader(BranchingReaderSource input,
ReaderCreator owner,
ReaderConfig cfg,
InputBootstrapper bs,
boolean forER)
Factory method for constructing readers.
|
protected void |
finishDTD(boolean copyContents)
This method gets called to handle remainder of DOCTYPE declaration,
essentially the optional internal subset.
|
Object |
getProcessedDTD()
Note: DTD-handling sub-classes need to override this method.
|
org.codehaus.stax2.validation.DTDValidationSchema |
getProcessedDTDSchema()
Sub-class will override this method
|
Object |
getProperty(String name) |
protected void |
initValidation()
Method called right before handling the root element, by the base
class.
|
protected void |
reportInvalidContent(int evtType)
Method called by lower-level parsing code when invalid content
(anything inside element with 'empty' content spec; text inside
non-mixed element etc) is found during basic scanning.
|
void |
reportValidationProblem(org.codehaus.stax2.validation.XMLValidationProblem prob)
If there is an error handler established, call it.
|
org.codehaus.stax2.validation.ValidationProblemHandler |
setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h) |
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
org.codehaus.stax2.validation.XMLValidator |
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator) |
org.codehaus.stax2.validation.XMLValidator |
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema) |
_base64Decoder, _constructTypeException, _decoderFactory, _verifyQName, createStreamReader, getAttributeAs, getAttributeAsArray, getAttributeAsBinary, getAttributeAsBinary, getAttributeAsBoolean, getAttributeAsDecimal, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLongArray, getAttributeAsQName, getAttributeIndex, getElementAs, getElementAsBinary, getElementAsBinary, getElementAsBoolean, getElementAsDecimal, getElementAsDouble, getElementAsFloat, getElementAsInt, getElementAsInteger, getElementAsLong, getElementAsQName, readElementAsArray, readElementAsBinary, readElementAsBinary, readElementAsDoubleArray, readElementAsFloatArray, readElementAsIntArray, readElementAsLongArray_constructTypeException, _constructUnexpectedInTyped, checkCData, checkKeyword, close, closeCompletely, createElementStack, ensureFinishToken, findEntity, finishToken, fireSaxCharacterEvents, fireSaxCommentEvent, fireSaxEndElement, fireSaxPIEvent, fireSaxSpaceEvents, fireSaxStartElement, getAttributeCollector, getAttributeCount, getAttributeInfo, getAttributeLocalName, getAttributeName, getAttributeNamespace, getAttributePrefix, getAttributeType, getAttributeValue, getAttributeValue, getCharacterEncodingScheme, getCurrentEntityDecl, getDepth, getDTDInfo, getDTDInternalSubset, getDTDPublicId, getDTDRootName, getDTDSystemId, getElementText, getEncoding, getEndingByteOffset, getEndingCharOffset, getEndLocation, getEventType, getFeature, getInputElementStack, getLocalName, getLocation, getLocationInfo, getName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNamespaceURI, getNonTransientNamespaceContext, getPIData, getPITarget, getPrefix, getPrefixedName, getStartingByteOffset, getStartingCharOffset, getText, getText, getTextCharacters, getTextCharacters, getTextLength, getTextStart, getVersion, handleEOF, handleGreedyEntityProblem, handleIncompleteEntityProblem, handleMultiDocStart, handleMultiDocXmlDecl, handleRootElem, handleUndeclaredEntity, hasConfigFlags, hasName, hasNext, hasText, isAttributeSpecified, isCharacters, isEmptyElement, isEndElement, isNamespaceAware, isPropertySupported, isStandalone, isStartElement, isWhiteSpace, next, nextTag, parseQuoted, readCDataSecondary, readCoalescedText, readEndElem, readTextSecondary, require, safeEnsureFinishToken, safeFinishToken, setFeature, setProperty, skipElement, skipEquals, skipWS, standaloneSet, throwNotTextualOrElem, throwUnexpectedEOF, withStartElement_reportProblem, _reportProblem, closeAllInput, constructFromIOE, constructLimitViolation, constructNullCharException, constructWfcException, ensureInput, expandBy50Pct, expandEntity, fullyResolveEntity, getCurrentInput, getCurrentLocation, getIntEntity, getLastCharLocation, getNameBuffer, getNext, getNextAfterWS, getNextChar, getNextCharAfterWS, getNextCharFromCurrent, getNextInCurrAfterWS, getNextInCurrAfterWS, getSource, getStartLocation, getSystemId, initInputSource, inputInBuffer, loadMore, loadMore, loadMoreFromCurrent, loadMoreFromCurrent, markLF, markLF, parseEntityName, parseFNameForError, parseFullName, parseFullName, parseFullName2, parseLocalName, parseLocalName2, parsePublicId, parseSystemId, parseUntil, peekNext, pushback, reportProblem, reportProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, resolveCharOnlyEntity, resolveNonCharEntity, resolveSimpleEntity, skipCRLF, skipFullName, throwFromIOE, throwFromStrE, throwInvalidSpace, throwInvalidSpace, throwLazyError, throwNullChar, throwNullParent, throwParseError, throwParseError, throwUnexpectedChar, throwUnexpectedEOB, throwUnexpectedEOF, throwWfcException, tokenTypeDesc, verifyLimitcopyBufferStateFrom, findIllegalNameChar, findIllegalNmtokenChar, getCharDesc, isNameChar, isNameChar, isNameStartChar, isNameStartChar, isSpaceCharprotected org.codehaus.stax2.validation.ValidationProblemHandler mVldProbHandler
public static ValidatingStreamReader createValidatingStreamReader(BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputBootstrapper bs, boolean forER) throws XMLStreamException
owner - "Owner" of this reader, factory that created the reader;
needed for returning updated symbol table information after parsing.input - Input source used to read the XML document.cfg - Object that contains reader configuration info.bs - Bootstrapper to use, for reading xml declaration etc.forER - True if this reader is to be (configured to be) used by
an event reader. Will cause some changes to default settings, as
required by contracts Woodstox XMLEventReader implementation has
(with respect to lazy parsing, short text segments etc)XMLStreamExceptionpublic Object getProperty(String name)
getProperty in interface XMLStreamReadergetProperty in class BasicStreamReaderpublic Object getProcessedDTD()
BasicStreamReaderNote: DTD-handling sub-classes need to override this method.
getProcessedDTD in interface org.codehaus.stax2.DTDInfogetProcessedDTD in class BasicStreamReaderpublic org.codehaus.stax2.validation.DTDValidationSchema getProcessedDTDSchema()
BasicStreamReadergetProcessedDTDSchema in interface org.codehaus.stax2.DTDInfogetProcessedDTDSchema in class BasicStreamReaderpublic org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
throws XMLStreamException
validateAgainst in interface org.codehaus.stax2.validation.ValidatablevalidateAgainst in class BasicStreamReaderXMLStreamExceptionpublic org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
throws XMLStreamException
stopValidatingAgainst in interface org.codehaus.stax2.validation.ValidatablestopValidatingAgainst in class BasicStreamReaderXMLStreamExceptionpublic org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator)
throws XMLStreamException
stopValidatingAgainst in interface org.codehaus.stax2.validation.ValidatablestopValidatingAgainst in class BasicStreamReaderXMLStreamExceptionpublic org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler(org.codehaus.stax2.validation.ValidationProblemHandler h)
setValidationProblemHandler in interface org.codehaus.stax2.validation.ValidatablesetValidationProblemHandler in class BasicStreamReaderprotected void finishDTD(boolean copyContents)
throws XMLStreamException
NOTE: Since this method overrides the default implementation, make sure you do NOT change the method signature.
finishDTD in class BasicStreamReadercopyContents - If true, will copy contents of the internal
subset of DOCTYPE declaration
in the text buffer (in addition to parsing it for actual use); if
false, will only do parsing.XMLStreamExceptionpublic void reportValidationProblem(org.codehaus.stax2.validation.XMLValidationProblem prob)
throws XMLStreamException
reportValidationProblem in interface InputProblemReporterreportValidationProblem in class StreamScannerXMLStreamExceptionprotected void initValidation()
throws XMLStreamException
initValidation in class BasicStreamReaderXMLStreamExceptionprotected DTDId constructDtdId(String pubId, String sysId) throws IOException
IOExceptionprotected DTDId constructDtdId(URI sysId) throws IOException
IOExceptionprotected void reportInvalidContent(int evtType)
throws XMLStreamException
reportInvalidContent in class BasicStreamReaderevtType - Type of event that contained unexpected contentXMLStreamExceptionCopyright © 2012–2015 FasterXML. All rights reserved.