Class ValidatingStreamReader

    • Field Detail

      • mVldProbHandler

        protected org.codehaus.stax2.validation.ValidationProblemHandler mVldProbHandler
        Custom validation problem handler, if any.
    • Method Detail

      • createValidatingStreamReader

        public static ValidatingStreamReader createValidatingStreamReader​(BranchingReaderSource input,
                                                                          ReaderCreator owner,
                                                                          ReaderConfig cfg,
                                                                          InputBootstrapper bs,
                                                                          boolean forER)
                                                                   throws XMLStreamException
        Factory method for constructing readers.
        Parameters:
        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)
        Throws:
        XMLStreamException
      • getProcessedDTD

        public Object getProcessedDTD()
        Description copied from class: BasicStreamReader

        Note: DTD-handling sub-classes need to override this method.

        Specified by:
        getProcessedDTD in interface org.codehaus.stax2.DTDInfo
        Overrides:
        getProcessedDTD in class BasicStreamReader
      • getProcessedDTDSchema

        public org.codehaus.stax2.validation.DTDValidationSchema getProcessedDTDSchema()
        Description copied from class: BasicStreamReader
        Sub-class will override this method
        Specified by:
        getProcessedDTDSchema in interface org.codehaus.stax2.DTDInfo
        Overrides:
        getProcessedDTDSchema in class BasicStreamReader
      • validateAgainst

        public org.codehaus.stax2.validation.XMLValidator validateAgainst​(org.codehaus.stax2.validation.XMLValidationSchema schema)
                                                                   throws XMLStreamException
        Specified by:
        validateAgainst in interface org.codehaus.stax2.validation.Validatable
        Overrides:
        validateAgainst in class BasicStreamReader
        Throws:
        XMLStreamException
      • setValidationProblemHandler

        public org.codehaus.stax2.validation.ValidationProblemHandler setValidationProblemHandler​(org.codehaus.stax2.validation.ValidationProblemHandler h)
        Specified by:
        setValidationProblemHandler in interface org.codehaus.stax2.validation.Validatable
        Overrides:
        setValidationProblemHandler in class BasicStreamReader
      • finishDTD

        protected void finishDTD​(boolean copyContents)
                          throws XMLStreamException
        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.

        Overrides:
        finishDTD in class BasicStreamReader
        Parameters:
        copyContents - 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.
        Throws:
        XMLStreamException
      • initValidation

        protected void initValidation()
                               throws XMLStreamException
        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)
        Overrides:
        initValidation in class BasicStreamReader
        Throws:
        XMLStreamException
      • reportInvalidContent

        protected void reportInvalidContent​(int evtType)
                                     throws XMLStreamException
        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.
        Overrides:
        reportInvalidContent in class BasicStreamReader
        Parameters:
        evtType - Type of event that contained unexpected content
        Throws:
        XMLStreamException