Package com.ctc.wstx.dtd
Class DTDCdataAttr
- java.lang.Object
-
- com.ctc.wstx.dtd.DTDAttribute
-
- com.ctc.wstx.dtd.DTDCdataAttr
-
public final class DTDCdataAttr extends DTDAttribute
SimpleDTDAttributesub-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.
-
-
Field Summary
-
Fields inherited from class com.ctc.wstx.dtd.DTDAttribute
mCfgNsAware, mCfgXml11, mDefValue, mName, mSpecialIndex, TYPE_CDATA, TYPE_ENTITIES, TYPE_ENTITY, TYPE_ENUMERATED, TYPE_ID, TYPE_IDREF, TYPE_IDREFS, TYPE_NMTOKEN, TYPE_NMTOKENS, TYPE_NOTATION
-
-
Constructor Summary
Constructors Constructor Description DTDCdataAttr(PrefixedName name, DefaultAttrValue defValue, int specIndex, boolean nsAware, boolean xml11)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DTDAttributecloneWith(int specIndex)Stringnormalize(DTDValidatorBase v, char[] cbuf, int start, int end)Method called when no validation is to be done, but value is still to be normalized as much as it can.voidnormalizeDefault()Method called to do initial normalization of the default attribute value, without trying to verify its validity.Stringvalidate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)voidvalidateDefault(InputProblemReporter rep, boolean normalize)Method called by theDTDValidatorto ask attribute to verify that the default it has (if any) is valid for such type.-
Methods inherited from class com.ctc.wstx.dtd.DTDAttribute
checkEntity, findEntityDecl, getDefaultValue, getName, getSpecialIndex, getValueType, getValueTypeString, hasDefaultValue, isFixed, isRequired, isSpecial, needsValidation, reportInvalidChar, reportValidationProblem, reportValidationProblem, toString, typeIsId, typeIsNotation, validate, validateDefaultName, validateDefaultNames, validateDefaultNmToken, validateEnumValue
-
-
-
-
Constructor Detail
-
DTDCdataAttr
public DTDCdataAttr(PrefixedName name, DefaultAttrValue defValue, int specIndex, boolean nsAware, boolean xml11)
-
-
Method Detail
-
cloneWith
public DTDAttribute cloneWith(int specIndex)
- Specified by:
cloneWithin classDTDAttribute
-
validate
public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize) throws XMLValidationException
- Specified by:
validatein classDTDAttribute- Throws:
XMLValidationException
-
validateDefault
public void validateDefault(InputProblemReporter rep, boolean normalize) throws XMLStreamException
Description copied from class:DTDAttributeMethod called by theDTDValidatorto ask attribute to verify that the default it has (if any) is valid for such type.- Specified by:
validateDefaultin classDTDAttribute- Throws:
XMLStreamException
-
normalize
public String normalize(DTDValidatorBase v, char[] cbuf, int start, int end)
Description copied from class:DTDAttributeMethod 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:
normalizein classDTDAttribute- 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:DTDAttributeMethod 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:
normalizeDefaultin classDTDAttribute
-
-