|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ctc.wstx.io.WstxInputData
com.ctc.wstx.sr.StreamScanner
com.ctc.wstx.sr.BasicStreamReader
com.ctc.wstx.sr.TypedStreamReader
com.ctc.wstx.sr.ValidatingStreamReader
public class ValidatingStreamReader
Implementation of XMLStreamReader2
that builds on TypedStreamReader and adds full DTD-handling
including DTD validation
| Field Summary | |
|---|---|
protected org.codehaus.stax2.validation.ValidationProblemHandler |
mVldProbHandler
Custom validation problem handler, if any. |
| Fields inherited from class com.ctc.wstx.sr.TypedStreamReader |
|---|
_base64Decoder, _decoderFactory, MASK_TYPED_ACCESS_ARRAY, MASK_TYPED_ACCESS_BINARY |
| Fields inherited from class com.ctc.wstx.sr.StreamScanner |
|---|
CHAR_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, mInput, mInputTopDepth, mNameBuffer, mNormalizeLFs, mRootInput, mTokenInputCol, mTokenInputRow, mTokenInputTotal |
| Fields inherited from class com.ctc.wstx.io.WstxInputData |
|---|
CHAR_NULL, CHAR_SPACE, INT_NULL, INT_SPACE, MAX_UNICODE_CHAR, mCurrInputProcessed, mCurrInputRow, mCurrInputRowStart, mInputBuffer, mInputEnd, mInputPtr, mXml11 |
| Fields inherited from interface org.codehaus.stax2.XMLStreamReader2 |
|---|
FEATURE_DTD_OVERRIDE |
| Fields inherited from interface javax.xml.stream.XMLStreamConstants |
|---|
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT |
| Method Summary | |
|---|---|
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. |
void |
setFeature(String name,
Object value)
|
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)
|
| Methods inherited from class com.ctc.wstx.io.WstxInputData |
|---|
copyBufferStateFrom, findIllegalNameChar, findIllegalNmtokenChar, getCharDesc, isNameChar, isNameChar, isNameStartChar, isNameStartChar, isSpaceChar |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.codehaus.stax2.LocationInfo |
|---|
getCurrentLocation, getStartLocation |
| Field Detail |
|---|
protected org.codehaus.stax2.validation.ValidationProblemHandler mVldProbHandler
| Method Detail |
|---|
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 BasicStreamReader
public void setFeature(String name,
Object value)
setFeature in interface org.codehaus.stax2.XMLStreamReader2setFeature 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()
BasicStreamReader
getProcessedDTDSchema in interface org.codehaus.stax2.DTDInfogetProcessedDTDSchema in class BasicStreamReader
public org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
throws XMLStreamException
validateAgainst in interface org.codehaus.stax2.validation.ValidatablevalidateAgainst in class BasicStreamReaderXMLStreamException
public org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
throws XMLStreamException
stopValidatingAgainst in interface org.codehaus.stax2.validation.ValidatablestopValidatingAgainst in class BasicStreamReaderXMLStreamException
public 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 BasicStreamReader
protected 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.
XMLStreamException
public void reportValidationProblem(org.codehaus.stax2.validation.XMLValidationProblem prob)
throws XMLStreamException
reportValidationProblem in interface InputProblemReporterreportValidationProblem in class StreamScannerXMLStreamException
protected void initValidation()
throws XMLStreamException
initValidation in class BasicStreamReaderXMLStreamException
protected DTDId constructDtdId(String pubId,
String sysId)
throws IOException
IOException
protected DTDId constructDtdId(URI sysId)
throws IOException
IOException
protected void reportInvalidContent(int evtType)
throws XMLStreamException
reportInvalidContent in class BasicStreamReaderXMLStreamException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||