📄 xssimpletypedecl.java
字号:
"maxInclusive", fBase.getName()}); } // check against fixed value in base if (((fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) { if ((fBase.fFixedFacet & FACET_MAXINCLUSIVE) != 0) { if (fDVs[fValidationDV].compare(fMaxInclusive, fBase.fMaxInclusive) != 0) reportError( "FixedFacetValue", new Object[]{"maxInclusive", fMaxInclusive, fBase.fMaxInclusive, fTypeName}); } } // maxInclusive from base try { fBase.validate(context, tempInfo); } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxInclusive, "maxInclusive", fBase.getName()}); } } } // maxExclusive boolean needCheckBase = true; if ((presentFacet & FACET_MAXEXCLUSIVE) != 0) { if ((allowedFacet & FACET_MAXEXCLUSIVE) == 0) { reportError("cos-applicable-facets", new Object[]{"maxExclusive", fTypeName}); } else { maxExclusiveAnnotation = facets.maxExclusiveAnnotation; try { fMaxExclusive = fBase.getActualValue(facets.maxExclusive, context, tempInfo, true); fFacetsDefined |= FACET_MAXEXCLUSIVE; if ((fixedFacet & FACET_MAXEXCLUSIVE) != 0) fFixedFacet |= FACET_MAXEXCLUSIVE; } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxExclusive, "maxExclusive", fBase.getName()}); } // check against fixed value in base if (((fBase.fFacetsDefined & FACET_MAXEXCLUSIVE) != 0)) { result = fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxExclusive); if ((fBase.fFixedFacet & FACET_MAXEXCLUSIVE) != 0 && result != 0) { reportError( "FixedFacetValue", new Object[]{"maxExclusive", facets.maxExclusive, fBase.fMaxExclusive, fTypeName}); } if (result == 0) { needCheckBase = false; } } // maxExclusive from base if (needCheckBase) { try { fBase.validate(context, tempInfo); } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.maxExclusive, "maxExclusive", fBase.getName()}); } } // If maxExclusive == base.maxExclusive, then we only need to check // maxExclusive <= base.maxInclusive else if (((fBase.fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) { if (fDVs[fValidationDV].compare(fMaxExclusive, fBase.fMaxInclusive) > 0) { reportError( "maxExclusive-valid-restriction.2", new Object[]{facets.maxExclusive, fBase.fMaxInclusive}); } } } } // minExclusive needCheckBase = true; if ((presentFacet & FACET_MINEXCLUSIVE) != 0) { if ((allowedFacet & FACET_MINEXCLUSIVE) == 0) { reportError("cos-applicable-facets", new Object[]{"minExclusive", fTypeName}); } else { minExclusiveAnnotation = facets.minExclusiveAnnotation; try { fMinExclusive = fBase.getActualValue(facets.minExclusive, context, tempInfo, true); fFacetsDefined |= FACET_MINEXCLUSIVE; if ((fixedFacet & FACET_MINEXCLUSIVE) != 0) fFixedFacet |= FACET_MINEXCLUSIVE; } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minExclusive, "minExclusive", fBase.getName()}); } // check against fixed value in base if (((fBase.fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) { result = fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinExclusive); if ((fBase.fFixedFacet & FACET_MINEXCLUSIVE) != 0 && result != 0) { reportError( "FixedFacetValue", new Object[]{"minExclusive", facets.minExclusive, fBase.fMinExclusive, fTypeName}); } if (result == 0) { needCheckBase = false; } } // minExclusive from base if (needCheckBase) { try { fBase.validate(context, tempInfo); } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minExclusive, "minExclusive", fBase.getName()}); } } // If minExclusive == base.minExclusive, then we only need to check // minExclusive >= base.minInclusive else if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) { if (fDVs[fValidationDV].compare(fMinExclusive, fBase.fMinInclusive) < 0) { reportError( "minExclusive-valid-restriction.3", new Object[]{facets.minExclusive, fBase.fMinInclusive}); } } } } // minInclusive if ((presentFacet & FACET_MININCLUSIVE) != 0) { if ((allowedFacet & FACET_MININCLUSIVE) == 0) { reportError("cos-applicable-facets", new Object[]{"minInclusive", fTypeName}); } else { minInclusiveAnnotation = facets.minInclusiveAnnotation; try { fMinInclusive = fBase.getActualValue(facets.minInclusive, context, tempInfo, true); fFacetsDefined |= FACET_MININCLUSIVE; if ((fixedFacet & FACET_MININCLUSIVE) != 0) fFixedFacet |= FACET_MININCLUSIVE; } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minInclusive, "minInclusive", fBase.getName()}); } // check against fixed value in base if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) { if ((fBase.fFixedFacet & FACET_MININCLUSIVE) != 0) { if (fDVs[fValidationDV].compare(fMinInclusive, fBase.fMinInclusive) != 0) reportError( "FixedFacetValue", new Object[]{"minInclusive", facets.minInclusive, fBase.fMinInclusive, fTypeName}); } } // minInclusive from base try { fBase.validate(context, tempInfo); } catch (InvalidDatatypeValueException ide) { reportError(ide.getKey(), ide.getArgs()); reportError("FacetValueFromBase", new Object[]{fTypeName, facets.minInclusive, "minInclusive", fBase.getName()}); } } } // totalDigits if ((presentFacet & FACET_TOTALDIGITS) != 0) { if ((allowedFacet & FACET_TOTALDIGITS) == 0) { reportError("cos-applicable-facets", new Object[]{"totalDigits", fTypeName}); } else { totalDigitsAnnotation = facets.totalDigitsAnnotation; fTotalDigits = facets.totalDigits; fFacetsDefined |= FACET_TOTALDIGITS; if ((fixedFacet & FACET_TOTALDIGITS) != 0) fFixedFacet |= FACET_TOTALDIGITS; } } // fractionDigits if ((presentFacet & FACET_FRACTIONDIGITS) != 0) { if ((allowedFacet & FACET_FRACTIONDIGITS) == 0) { reportError("cos-applicable-facets", new Object[]{"fractionDigits", fTypeName}); } else { fFractionDigits = facets.fractionDigits; fractionDigitsAnnotation = facets.fractionDigitsAnnotation; fFacetsDefined |= FACET_FRACTIONDIGITS; if ((fixedFacet & FACET_FRACTIONDIGITS) != 0) fFixedFacet |= FACET_FRACTIONDIGITS; } } // token type: internal use, so do less checking if (patternType != SPECIAL_PATTERN_NONE) { fPatternType = patternType; } // step 2: check facets against each other: length, bounds if(fFacetsDefined != 0) { // check 4.3.1.c1 error: length & (maxLength | minLength) if((fFacetsDefined & FACET_LENGTH) != 0 ){ if ((fFacetsDefined & FACET_MINLENGTH) != 0) { if ((fFacetsDefined & FACET_MAXLENGTH) != 0) { // length, minLength and maxLength defined reportError("length-minLength-maxLength.a", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMinLength), Integer.toString(fMaxLength)}); } else { // length and minLength defined reportError("length-minLength-maxLength.b", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMinLength)}); } } else if ((fFacetsDefined & FACET_MAXLENGTH) != 0) { // length and maxLength defined reportError("length-minLength-maxLength.c", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fMaxLength)}); } } // check 4.3.2.c1 must: minLength <= maxLength if(((fFacetsDefined & FACET_MINLENGTH ) != 0 ) && ((fFacetsDefined & FACET_MAXLENGTH) != 0)) { if(fMinLength > fMaxLength) reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fMinLength), Integer.toString(fMaxLength), fTypeName}); } // check 4.3.8.c1 error: maxInclusive + maxExclusive if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MAXINCLUSIVE) != 0)) { reportError( "maxInclusive-maxExclusive", new Object[]{fMaxInclusive, fMaxExclusive, fTypeName}); } // check 4.3.9.c1 error: minInclusive + minExclusive if (((fFacetsDefined & FACET_MINEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) { reportError("minInclusive-minExclusive", new Object[]{fMinInclusive, fMinExclusive, fTypeName}); } // check 4.3.7.c1 must: minInclusive <= maxInclusive if (((fFacetsDefined & FACET_MAXINCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) { result = fDVs[fValidationDV].compare(fMinInclusive, fMaxInclusive); if (result != -1 && result != 0) reportError("minInclusive-less-than-equal-to-maxInclusive", new Object[]{fMinInclusive, fMaxInclusive, fTypeName}); } // check 4.3.8.c2 must: minExclusive <= maxExclusive ??? minExclusive < maxExclusive if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) { result = fDVs[fValidationDV].compare(fMinExclusive, fMaxExclusive); if (result != -1 && result != 0) reportError( "minExclusive-less-than-equal-to-maxExclusive", new Object[]{fMinExclusive, fMaxExclusive, fTypeName}); } // check 4.3.9.c2 must: minExclusive < maxInclusive if (((fFacetsDefined & FACET_MAXINCLUSIVE) != 0) && ((fFacetsDefined & FACET_MINEXCLUSIVE) != 0)) { if (fDVs[fValidationDV].compare(fMinExclusive, fMaxInclusive) != -1) reportError( "minExclusive-less-than-maxInclusive", new Object[]{fMinExclusive, fMaxInclusive, fTypeName}); } // check 4.3.10.c1 must: minInclusive < maxExclusive if (((fFacetsDefined & FACET_MAXEXCLUSIVE) != 0) && ((fFacetsDefined & FACET_MININCLUSIVE) != 0)) { if (fDVs[fValidationDV].compare(fMinInclusive, fMaxExclusive) != -1) reportError( "minInclusive-less-than-maxExclusive", new Object[]{fMinInclusive, fMaxExclusive, fTypeName}); } // check 4.3.12.c1 must: fractionDigits <= totalDigits if (((fFacetsDefined & FACET_FRACTIONDIGITS) != 0) && ((fFacetsDefined & FACET_TOTALDIGITS) != 0)) { if (fFractionDigits > fTotalDigits) reportError( "fractionDigits-totalDigits", new Object[]{Integer.toString(fFractionDigits), Integer.toString(fTotalDigits), fTypeName}); } // step 3: check facets against base // check 4.3.1.c1 error: length & (fBase.maxLength | fBase.minLength) if((fFacetsDefined & FACET_LENGTH) != 0 ){ if ((fBase.fFacetsDefined & FACET_MINLENGTH) != 0 && fLength < fBase.fMinLength) { // length, fBase.minLength and fBase.maxLength defined reportError("length-minLength-maxLength.d", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMinLength)}); } if ((fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 && fLength > fBase.fMaxLength) { // length and fBase.maxLength defined reportError("length-minLength-maxLength.e", new Object[]{fTypeName, Integer.toString(fLength), Integer.toString(fBase.fMaxLength)}); } if ( (fBase.fFacetsDefined & FACET_LENGTH) != 0 ) { // check 4.3.1.c2 error: length != fBase.length if ( fLength != fBase.fLength ) reportError( "length-valid-restriction", new Object[]{Integer.toString(fLength), Integer.toString(fBase.fLength), fTypeName}); } } // check 4.3.1.c1 error: fBase.length & (maxLength | minLength) else if((fBase.fFacetsDefined & FACET_LENGTH) != 0 ){ if ((fFacetsDefined & FACET_MINLENGTH) != 0 && fBase.fLength < fMinLength) { // fBase.length, minLength and maxLength defined reportError("length-minLength-maxLength.d", new Object[]{fTypeName, Integer.toString(fBase.fLength), Integer.toString(fMinLength)}); } if ((fFacetsDefined & FACET_MAXLENGTH) != 0 && fBase.fLength > fMaxLength) { // fBase.length and maxLength defined reportError("length-minLength-maxLength.e", new Object[]{this, Integer.toString(fBase.fLength), Integer.toString(fMaxLength)}); } } // check 4.3.2.c1 must: minLength <= fBase.maxLength if ( ((fFacetsDefined & FACET_MINLENGTH ) != 0 ) ) { if ( (fBase.fFacetsDefined & FACET_MAXLENGTH ) != 0 ) { if ( fMinLength > fBase.fMaxLength ) { reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fMinLength), Integer.toString(fBase.fMaxLength), fTypeName}); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -