Class DTDCdataAttr


  • public final class DTDCdataAttr
    extends DTDAttribute
    Simple DTDAttribute sub-class used for plain vanilla CDATA valued attributes. Although base class implements most of the methods, it's better designwise to keep that base class abstract and have separate CDATA type as well.
    • Constructor Detail

    • Method Detail

      • validate

        public java.lang.String validate​(DTDValidatorBase v,
                                         char[] cbuf,
                                         int start,
                                         int end,
                                         boolean normalize)
                                  throws org.codehaus.stax2.validation.XMLValidationException
        Specified by:
        validate in class DTDAttribute
        Throws:
        org.codehaus.stax2.validation.XMLValidationException
      • validateDefault

        public void validateDefault​(InputProblemReporter rep,
                                    boolean normalize)
                             throws javax.xml.stream.XMLStreamException
        Description copied from class: DTDAttribute
        Method called by the DTDValidator to ask attribute to verify that the default it has (if any) is valid for such type.
        Specified by:
        validateDefault in class DTDAttribute
        Throws:
        javax.xml.stream.XMLStreamException
      • normalize

        public java.lang.String normalize​(DTDValidatorBase v,
                                          char[] cbuf,
                                          int start,
                                          int end)
        Description copied from class: DTDAttribute
        Method called when no validation is to be done, but value is still to be normalized as much as it can. What this usually means is that all regular space (parser earlier on converts other white space to spaces, except for specific character entities; and these special cases are NOT to be normalized).

        The only exception is that CDATA will not do any normalization. But for now, let's implement basic functionality that CDTA instance will override

        Overrides:
        normalize in class DTDAttribute
        Parameters:
        v - Validator that invoked normalization
        Returns:
        Normalized value as a String, if any changes were done; null if input was normalized
      • normalizeDefault

        public void normalizeDefault()
        Description copied from class: DTDAttribute
        Method called to do initial normalization of the default attribute value, without trying to verify its validity. Thus, it's called independent of whether we are fully validating the document.
        Overrides:
        normalizeDefault in class DTDAttribute