org.codehaus.stax2.XMLStreamReader2
that builds on TypedStreamReader and adds full DTD-handling
including DTD validation
| Modifier and Type | Field and Description |
|---|---|
| pack-priv XMLValidator | mAutoDtdValidator
Validating reader keeps of automatically created DTD-based validator, since its handling may differ from that of application managed validators. |
| pack-priv DTDValidationSchema | mDTD
Combined DTD set, constructed from parsed internal and external entities (which may have been set via override DTD functionality). |
| pack-priv boolean | mDtdValidatorSet
Flag that indicates whether a DTD validator has been automatically set (as per DOCTYPE declaration or override) |
| protected ValidationProblemHandler | mVldProbHandler
Custom validation problem handler, if any. |
| pack-priv static final String | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| private | ValidatingStreamReader(InputBootstrapper bs, BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputElementStack elemStack, boolean forER)
|
| Modifier and Type | Method and Description |
|---|---|
| protected DTDId | |
| protected DTDId | |
| public static ValidatingStreamReader | createValidatingStreamReader(BranchingReaderSource
Input source used to read the XML document. input, ReaderCreator "Owner" of this reader, factory that created the reader;
needed for returning updated symbol table information after parsing. owner, ReaderConfig Object that contains reader configuration info. cfg, InputBootstrapper Bootstrapper to use, for reading xml declaration etc. bs, boolean 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) forER)Factory method for constructing readers. |
| private DTDSubset | |
| private DTDSubset | findDtdExtSubset(String pubId, String sysId, DTDSubset intSubset)
Method called by |
| protected void | finishDTD(boolean
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. copyContents)Overrides com. This method gets called to handle remainder of DOCTYPE declaration, essentially the optional internal subset. |
| public Object | getProcessedDTD()
Overrides com. Implements org. Note DTD-handling sub-classes need to override this method. |
| public DTDValidationSchema | getProcessedDTDSchema()
Overrides com. Implements org. Sub-class will override this method |
| public Object | getProperty(String
The name of the property, may not be null name)Overrides com. Implements javax. Get the value of a feature/property from the underlying implementation |
| protected void | initValidation()
Overrides com. Method called right before handling the root element, by the base class. |
| protected void | reportInvalidContent(int
Type of event that contained unexpected content evtType)Overrides com. 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. |
| public void | reportValidationProblem(XMLValidationProblem prob)
Overrides com. Implements com. If there is an error handler established, call it. |
| private URI | resolveExtSubsetPath(String systemId)
Method called to resolve path to external DTD subset, given system identifier. |
| public ValidationProblemHandler | setValidationProblemHandler(ValidationProblemHandler
Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be used h)Overrides com. Implements org. Method that application can call to define a custom handler for validation problems encountered during validation process. |
| public XMLValidator | stopValidatingAgainst(XMLValidationSchema schema)
Overrides com. Implements org. Method that can be called by application to stop validating
output against a schema, for which |
| public XMLValidator | stopValidatingAgainst(XMLValidator validator)
Overrides com. Implements org. Method that can be called by application to stop validating output using specified validator. |
| public XMLValidator | validateAgainst(XMLValidationSchema schema)
Overrides com. Implements org. Method that will construct a |
| mAutoDtdValidator | back to summary |
|---|---|
| pack-priv XMLValidator mAutoDtdValidator Validating reader keeps of automatically created DTD-based validator, since its handling may differ from that of application managed validators. | |
| mDTD | back to summary |
|---|---|
| pack-priv DTDValidationSchema mDTD Combined DTD set, constructed from parsed internal and external entities (which may have been set via override DTD functionality). | |
| mDtdValidatorSet | back to summary |
|---|---|
| pack-priv boolean mDtdValidatorSet Flag that indicates whether a DTD validator has been automatically set (as per DOCTYPE declaration or override) | |
| mVldProbHandler | back to summary |
|---|---|
| protected ValidationProblemHandler mVldProbHandler Custom validation problem handler, if any. | |
| STAX_PROP_ENTITIES | back to summary |
|---|---|
| pack-priv static final String STAX_PROP_ENTITIES | |
| STAX_PROP_NOTATIONS | back to summary |
|---|---|
| pack-priv static final String STAX_PROP_NOTATIONS | |
| ValidatingStreamReader | back to summary |
|---|---|
| private ValidatingStreamReader(InputBootstrapper bs, BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputElementStack elemStack, boolean forER) throws XMLStreamException | |
| constructDtdId | back to summary |
|---|---|
| protected DTDId constructDtdId(String pubId, String sysId) throws IOException | |
| constructDtdId | back to summary |
|---|---|
| protected DTDId constructDtdId(URI sysId) throws IOException | |
| createValidatingStreamReader | back to summary |
|---|---|
| public static ValidatingStreamReader createValidatingStreamReader(BranchingReaderSource input, ReaderCreator owner, ReaderConfig cfg, InputBootstrapper bs, boolean forER) throws XMLStreamException Factory method for constructing readers.
| |
| findCachedSubset | back to summary |
|---|---|
| private DTDSubset findCachedSubset(DTDId id, DTDSubset intSubset) throws XMLStreamException | |
| findDtdExtSubset | back to summary |
|---|---|
| private DTDSubset findDtdExtSubset(String pubId, String sysId, DTDSubset intSubset) throws XMLStreamException Method called by | |
| finishDTD | back to summary |
|---|---|
| protected void finishDTD(boolean copyContents) throws XMLStreamException Overrides com. This method gets called to handle remainder of DOCTYPE declaration, essentially the optional internal subset. Internal subset, if such exists, is always read, but whether its contents are added to the read buffer depend on passed-in argument. Note Since this method overrides the default implementation, make sure you do NOT change the method signature.
| |
| getProcessedDTD | back to summary |
|---|---|
| public Object getProcessedDTD() Overrides com. Implements org. Doc from com. Note DTD-handling sub-classes need to override this method.
| |
| getProcessedDTDSchema | back to summary |
|---|---|
| public DTDValidationSchema getProcessedDTDSchema() Overrides com. Implements org. Doc from com. Sub-class will override this method
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name) Overrides com. Implements javax. Doc from javax. Get the value of a feature/property from the underlying implementation | |
| initValidation | back to summary |
|---|---|
| protected void initValidation() throws XMLStreamException Overrides com. Method called right before handling the root element, by the base class. This allows for some initialization and checks to be done (not including ones that need access to actual element name)
| |
| reportInvalidContent | back to summary |
|---|---|
| protected void reportInvalidContent(int evtType) throws XMLStreamException Overrides com. 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. Note that actual DTD element structure problems are not reported through this method.
| |
| reportValidationProblem | back to summary |
|---|---|
| public void reportValidationProblem(XMLValidationProblem prob) throws XMLStreamException Overrides com. Implements com. If there is an error handler established, call it.
| |
| resolveExtSubsetPath | back to summary |
|---|---|
| private URI resolveExtSubsetPath(String systemId) throws IOException Method called to resolve path to external DTD subset, given system identifier. | |
| setValidationProblemHandler | back to summary |
|---|---|
| public ValidationProblemHandler setValidationProblemHandler(ValidationProblemHandler h) Overrides com. Implements org. Doc from org. Method that application can call to define a custom handler for validation problems encountered during validation process.
| |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException Overrides com. Implements org. Doc from org. Method that can be called by application to stop validating
output against a schema, for which
| |
| stopValidatingAgainst | back to summary |
|---|---|
| public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException Overrides com. Implements org. Doc from org. Method that can be called by application to stop validating
output using specified validator. The validator passed should be
an earlier return value for a call to Note the specified validator is compared for identity with validators in use, not for equality.
| |
| validateAgainst | back to summary |
|---|---|
| public XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException Overrides com. Implements org. Doc from org. Method that will construct a Note that while this method can be called at any point in output processing, validator instances are not required to be able to handle addition at other points than right before outputting the root element.
| |