com.ctc.wstx.dtd
Class DTDTypingNonValidator

java.lang.Object
  extended by org.codehaus.stax2.validation.XMLValidator
      extended by com.ctc.wstx.dtd.DTDValidatorBase
          extended by com.ctc.wstx.dtd.DTDTypingNonValidator
All Implemented Interfaces:
NsDefaultProvider

public class DTDTypingNonValidator
extends DTDValidatorBase

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
protected  BitSet mCurrDefaultAttrs
          Bitset used for keeping track of defaulted attributes for which values have been found.
protected  boolean mHasAttrDefaults
          Flag that indicates if current element has any attributes that have default values.
protected  boolean mHasNormalizableAttrs
          Flag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode.
 
Fields inherited from class com.ctc.wstx.dtd.DTDValidatorBase
EMPTY_MAP, mAttrCount, mAttrSpecs, mCurrAttrDefs, mCurrElem, mElemCount, mElems, mIdAttrIndex, mNormAttrs, mTmpKey
 
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
DTDTypingNonValidator(DTDSubset schema, org.codehaus.stax2.validation.ValidationContext ctxt, boolean hasNsDefaults, Map elemSpecs, Map genEntities)
           
 
Method Summary
protected  ElementIdMap getIdMap()
           
 boolean reallyValidating()
           
 void setAttrValueNormalization(boolean state)
          This 'validator' will not normalize any attributes, so let's implement this as no-op.
 String validateAttribute(String localName, String uri, String prefix, char[] valueChars, int valueStart, int valueEnd)
           
 String validateAttribute(String localName, String uri, String prefix, String value)
           
 int validateElementAndAttributes()
           
 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, getIdAttrIndex, getNotationAttrIndex, getSchema, hasNsDefaults, mayHaveNsDefaults, validateText, validateText
 
Methods inherited from class org.codehaus.stax2.validation.XMLValidator
getSchemaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mHasAttrDefaults

protected boolean mHasAttrDefaults
Flag that indicates if current element has any attributes that have default values.


mCurrDefaultAttrs

protected BitSet 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 mHasNormalizableAttrs
Flag that indicates whether any of the attributes is potentially normalizable, and we are in attribute-normalizing mode.

Constructor Detail

DTDTypingNonValidator

public DTDTypingNonValidator(DTDSubset schema,
                             org.codehaus.stax2.validation.ValidationContext ctxt,
                             boolean hasNsDefaults,
                             Map elemSpecs,
                             Map genEntities)
Method Detail

reallyValidating

public final boolean reallyValidating()
Specified by:
reallyValidating in class DTDValidatorBase
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 class DTDValidatorBase

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 class DTDValidatorBase
Throws:
XMLStreamException

validateAttribute

public String validateAttribute(String localName,
                                String uri,
                                String prefix,
                                String value)
                         throws XMLStreamException
Specified by:
validateAttribute in class DTDValidatorBase
Throws:
XMLStreamException

validateAttribute

public String validateAttribute(String localName,
                                String uri,
                                String prefix,
                                char[] valueChars,
                                int valueStart,
                                int valueEnd)
                         throws XMLStreamException
Specified by:
validateAttribute in class DTDValidatorBase
Throws:
XMLStreamException

validateElementAndAttributes

public int validateElementAndAttributes()
                                 throws XMLStreamException
Specified by:
validateElementAndAttributes in class DTDValidatorBase
Throws:
XMLStreamException

validateElementEnd

public int validateElementEnd(String localName,
                              String uri,
                              String prefix)
                       throws XMLStreamException
Specified by:
validateElementEnd in class DTDValidatorBase
Returns:
Validation state that should be effective for the parent element state
Throws:
XMLStreamException

validationCompleted

public void validationCompleted(boolean eod)
Specified by:
validationCompleted in class DTDValidatorBase

getIdMap

protected ElementIdMap getIdMap()
Specified by:
getIdMap in class DTDValidatorBase


Copyright © 2011 Codehaus. All Rights Reserved.