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 BitSetBitset used for keeping track of defaulted attributes for which values have been found.protected booleanFlag that indicates if current element has any attributes that have default values.protected booleanFlag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode.protected BitSetReusable lazily instantiated BitSet; needed to keep track of 'missing' attributes with default values (normal default, #FIXED).Fields inherited from class 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_ATTRSFields 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 ElementIdMapgetIdMap()final booleanvoidsetAttrValueNormalization(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) intintvalidateElementEnd(String localName, String uri, String prefix) voidvalidateElementStart(String localName, String uri, String prefix) Method called to update information about the newly encountered (start) element.voidvalidationCompleted(boolean eod) Methods inherited from class DTDValidatorBase
checkNsDefaults, doAddDefaultValue, doReportValidationProblem, getAttributeType, getElemName, getEntityMap, getIdAttrIndex, getLocation, getNotationAttrIndex, getSchema, getTempAttrValueBuffer, hasNsDefaults, mayHaveNsDefaults, reportValidationProblem, reportValidationProblem, reportValidationProblem, reportValidationProblem, validateText, validateTextMethods 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:
reallyValidatingin 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:
setAttrValueNormalizationin classDTDValidatorBase
-
validateElementStart
public void validateElementStart(String localName, String uri, String prefix) throws XMLStreamException Description copied from class:DTDValidatorBaseMethod 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:
validateElementStartin classDTDValidatorBase- Throws:
XMLStreamException
-
validateAttribute
public String validateAttribute(String localName, String uri, String prefix, String value) throws XMLStreamException - Specified by:
validateAttributein classDTDValidatorBase- Throws:
XMLStreamException
-
validateAttribute
public String validateAttribute(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd) throws XMLStreamException - Specified by:
validateAttributein classDTDValidatorBase- Throws:
XMLStreamException
-
validateElementAndAttributes
- Specified by:
validateElementAndAttributesin classDTDValidatorBase- Throws:
XMLStreamException
-
validateElementEnd
public int validateElementEnd(String localName, String uri, String prefix) throws XMLStreamException - Specified by:
validateElementEndin classDTDValidatorBase- Returns:
- Validation state that should be effective for the parent element state
- Throws:
XMLStreamException
-
validationCompleted
public void validationCompleted(boolean eod) - Specified by:
validationCompletedin classDTDValidatorBase
-
getIdMap
- Specified by:
getIdMapin classDTDValidatorBase
-