Package com.ctc.wstx.dtd
Class DTDTypingNonValidator
java.lang.Object
org.codehaus.stax2.validation.XMLValidator
com.ctc.wstx.dtd.DTDValidatorBase
com.ctc.wstx.dtd.DTDTypingNonValidator
- All Implemented Interfaces:
NsDefaultProvider
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 Summary
FieldsModifier and TypeFieldDescriptionprotected BitSet
Bitset used for keeping track of defaulted attributes for which values have been found.protected boolean
Flag that indicates if current element has any attributes that have default values.protected boolean
Flag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode.protected BitSet
Reusable lazily instantiated BitSet; needed to keep track of 'missing' attributes with default values (normal default, #FIXED).Fields inherited from class com.ctc.wstx.dtd.DTDValidatorBase
DEFAULT_STACK_SIZE, EMPTY_MAP, EXP_MAX_ATTRS, mAttrCount, mAttrSpecs, mContext, mCurrAttrDefs, mCurrElem, mElemCount, mElems, mElemSpecs, mGeneralEntities, mHasNsDefaults, mIdAttrIndex, mNormAttrs, mSchema, mTmpAttrValueBuffer, mTmpKey, NO_ATTRS
Fields inherited from class org.codehaus.stax2.validation.XMLValidator
CONTENT_ALLOW_ANY_TEXT, CONTENT_ALLOW_NONE, CONTENT_ALLOW_UNDEFINED, CONTENT_ALLOW_VALIDATABLE_TEXT, CONTENT_ALLOW_WS, CONTENT_ALLOW_WS_NONSTRICT
-
Constructor Summary
ConstructorsConstructorDescriptionDTDTypingNonValidator
(DTDSubset schema, org.codehaus.stax2.validation.ValidationContext ctxt, boolean hasNsDefaults, Map<PrefixedName, DTDElement> elemSpecs, Map<String, EntityDecl> genEntities) -
Method Summary
Modifier and TypeMethodDescriptionprotected ElementIdMap
getIdMap()
final boolean
void
setAttrValueNormalization
(boolean state) This 'validator' will not normalize any attributes, so let's implement this as no-op.validateAttribute
(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd) validateAttribute
(String localName, String uri, String prefix, String value) int
int
validateElementEnd
(String localName, String uri, String prefix) void
validateElementStart
(String localName, String uri, String prefix) Method called to update information about the newly encountered (start) element.void
validationCompleted
(boolean eod) Methods inherited from class com.ctc.wstx.dtd.DTDValidatorBase
checkNsDefaults, doAddDefaultValue, doReportValidationProblem, getAttributeType, getElemName, getEntityMap, getIdAttrIndex, getLocation, getNotationAttrIndex, getSchema, getTempAttrValueBuffer, hasNsDefaults, mayHaveNsDefaults, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, validateText, validateText
Methods inherited from class org.codehaus.stax2.validation.XMLValidator
getSchemaType
-
Field Details
-
mHasAttrDefaults
protected boolean mHasAttrDefaultsFlag that indicates if current element has any attributes that have default values. -
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 mHasNormalizableAttrsFlag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode. -
mTmpDefaultAttrs
Reusable lazily instantiated BitSet; needed to keep track of 'missing' attributes with default values (normal default, #FIXED).
-
-
Constructor Details
-
DTDTypingNonValidator
public DTDTypingNonValidator(DTDSubset schema, org.codehaus.stax2.validation.ValidationContext ctxt, boolean hasNsDefaults, Map<PrefixedName, DTDElement> elemSpecs, Map<String, EntityDecl> genEntities)
-
-
Method Details
-
reallyValidating
public final boolean reallyValidating()- Specified by:
reallyValidating
in classDTDValidatorBase
- 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 classDTDValidatorBase
-
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 classDTDValidatorBase
- Throws:
XMLStreamException
-
validateAttribute
public String validateAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException - Specified by:
validateAttribute
in classDTDValidatorBase
- Throws:
XMLStreamException
-
validateAttribute
public String validateAttribute(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd) throws XMLStreamException - Specified by:
validateAttribute
in classDTDValidatorBase
- Throws:
XMLStreamException
-
validateElementAndAttributes
- Specified by:
validateElementAndAttributes
in classDTDValidatorBase
- Throws:
XMLStreamException
-
validateElementEnd
public int validateElementEnd(String localName, String uri, String prefix) throws XMLStreamException - Specified by:
validateElementEnd
in classDTDValidatorBase
- Returns:
- Validation state that should be effective for the parent element state
- Throws:
XMLStreamException
-
validationCompleted
public void validationCompleted(boolean eod) - Specified by:
validationCompleted
in classDTDValidatorBase
-
getIdMap
- Specified by:
getIdMap
in classDTDValidatorBase
-