Package com.ctc.wstx.dtd
Class DTDIdAttr
- java.lang.Object
-
- com.ctc.wstx.dtd.DTDAttribute
-
- com.ctc.wstx.dtd.DTDIdAttr
-
public final class DTDIdAttr extends DTDAttribute
Specific attribute class for attributes that contain (unique) identifiers.
-
-
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 DTDIdAttr(PrefixedName name, DefaultAttrValue defValue, int specIndex, boolean nsAware, boolean xml11)Main constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DTDAttributecloneWith(int specIndex)intgetValueType()Returns the value type of this attribute as an enumerated int to match type (CDATA, ...)booleantypeIsId()Stringvalidate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)Method called by the validator to let the attribute do necessary normalization and/or validation for the value.voidvalidateDefault(InputProblemReporter rep, boolean normalize)Method called by the validator to 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, getValueTypeString, hasDefaultValue, isFixed, isRequired, isSpecial, needsValidation, normalize, normalizeDefault, reportInvalidChar, reportValidationProblem, reportValidationProblem, toString, typeIsNotation, validate, validateDefaultName, validateDefaultNames, validateDefaultNmToken, validateEnumValue
-
-
-
-
Constructor Detail
-
DTDIdAttr
public DTDIdAttr(PrefixedName name, DefaultAttrValue defValue, int specIndex, boolean nsAware, boolean xml11)
Main constructor. Note that id attributes can never have default values.note: although ID attributes are not to have default value, this is 'only' a validity constraint, and in dtd-aware-but- not-validating mode it is apparently 'legal' to add default values.
-
-
Method Detail
-
cloneWith
public DTDAttribute cloneWith(int specIndex)
- Specified by:
cloneWithin classDTDAttribute
-
getValueType
public int getValueType()
Description copied from class:DTDAttributeReturns the value type of this attribute as an enumerated int to match type (CDATA, ...)Note:
- Overrides:
getValueTypein classDTDAttribute
-
typeIsId
public boolean typeIsId()
- Overrides:
typeIsIdin classDTDAttribute
-
validate
public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize) throws XMLStreamException
Method called by the validator to let the attribute do necessary normalization and/or validation for the value.- Specified by:
validatein classDTDAttribute- Throws:
XMLStreamException
-
validateDefault
public void validateDefault(InputProblemReporter rep, boolean normalize)
Method called by the validator to ask attribute to verify that the default it has (if any) is valid for such type.- Specified by:
validateDefaultin classDTDAttribute
-
-