Class DTDTypingNonValidator

  • All Implemented Interfaces:
    NsDefaultProvider

    public class DTDTypingNonValidator
    extends DTDValidatorBase
    This class is a "non-validating validator"; a validator-like object that handles DTD-based non-validation functionality: determining type information and default values. This instance does NOT implement any actual DTD-validation, and is to be used in DTD-aware non-validating mode.
    • Field Detail

      • mHasAttrDefaults

        protected boolean mHasAttrDefaults
        Flag that indicates if current element has any attributes that have default values.
      • mCurrDefaultAttrs

        protected BitSet mCurrDefaultAttrs
        Bitset used for keeping track of defaulted attributes for which values have been found. Only non-null when current element does have such attributes
      • mHasNormalizableAttrs

        protected boolean mHasNormalizableAttrs
        Flag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode.
    • Method Detail

      • reallyValidating

        public final boolean reallyValidating()
        Specified by:
        reallyValidating in class DTDValidatorBase
        Returns:
        False, since this is not a real validator
      • setAttrValueNormalization

        public void setAttrValueNormalization​(boolean state)
        This 'validator' will not normalize any attributes, so let's implement this as no-op.
        Overrides:
        setAttrValueNormalization in class DTDValidatorBase
      • validateElementStart

        public void validateElementStart​(String localName,
                                         String uri,
                                         String prefix)
                                  throws XMLStreamException
        Description copied from class: DTDValidatorBase
        Method called to update information about the newly encountered (start) element. At this point namespace information has been resolved, but no DTD validation has been done. Validator is to do these validations, including checking for attribute value (and existence) compatibility.
        Specified by:
        validateElementStart in class DTDValidatorBase
        Throws:
        XMLStreamException
      • validateAttribute

        public String validateAttribute​(String localName,
                                        String uri,
                                        String prefix,
                                        String value)
                                 throws XMLStreamException
        Description copied from class: XMLValidator
        Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.).
        Specified by:
        validateAttribute in class DTDValidatorBase
        Returns:
        Null, if the passed value is fine as is; or a String, if it needs to be replaced. In latter case, caller will replace the value before passing it to other validators. Also, if the attribute value is accessible via caller (as is the case for stream readers), caller should return this value, instead of the original one.
        Throws:
        XMLStreamException
      • validateAttribute

        public String validateAttribute​(String localName,
                                        String uri,
                                        String prefix,
                                        char[] valueChars,
                                        int valueStart,
                                        int valueEnd)
                                 throws XMLStreamException
        Description copied from class: XMLValidator
        Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.).
        Specified by:
        validateAttribute in class DTDValidatorBase
        valueChars - Character array that contains value (possibly along with some other text)
        valueStart - Index of the first character of the value in in valueChars array
        valueEnd - Index of the character AFTER the last character; so that the length of the value String is valueEnd - valueStart
        Returns:
        Null, if the passed value is fine as is; or a String, if it needs to be replaced. In latter case, caller will replace the value before passing it to other validators. Also, if the attribute value is accessible via caller (as is the case for stream readers), caller should return this value, instead of the original one.
        Throws:
        XMLStreamException
      • validationCompleted

        public void validationCompleted​(boolean eod)
        Description copied from class: XMLValidator
        Method called when the validation is completed; either due to the input stream ending, or due to an explicit 'stop validation' request by the application (via context object).
        Specified by:
        validationCompleted in class DTDValidatorBase
        Parameters:
        eod - Flag that indicates whether this method was called by the context due to the end of the stream (true); or by an application requesting end of validation (false).