xssimpletypedecl.java

来自「JAVA的一些源码 JAVA2 STANDARD EDITION DEVELO」· Java 代码 · 共 1,439 行 · 第 1/5 页

JAVA
1,439
字号
        if ((presentFacet & FACET_MAXEXCLUSIVE) != 0) {            if ((allowedFacet & FACET_MAXEXCLUSIVE) == 0) {                reportError("cos-applicable-facets", new Object[]{"maxExclusive", fTypeName});            } else {                maxExclusiveAnnotation = facets.maxExclusiveAnnotation;                try {                    fMaxExclusive = 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()});                }                // maxExclusive from 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;                    }                }                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()});                    }                }            }        }        // 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 = 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()});                }                // minExclusive from 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;                    }                }                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()});                    }                }            }        }        // minInclusive        needCheckBase = true;        if ((presentFacet & FACET_MININCLUSIVE) != 0) {            if ((allowedFacet & FACET_MININCLUSIVE) == 0) {                reportError("cos-applicable-facets", new Object[]{"minInclusive", fTypeName});            } else {                minInclusiveAnnotation = facets.minInclusiveAnnotation;                try {                    fMinInclusive = 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()});                }                // minInclusive from base                if (((fBase.fFacetsDefined & FACET_MININCLUSIVE) != 0)) {                    result = fDVs[fValidationDV].compare(fMinInclusive, fBase.fMinInclusive);                    if ((fBase.fFixedFacet & FACET_MININCLUSIVE) != 0 && result != 0) {                        reportError( "FixedFacetValue", new Object[]{"minInclusive", facets.minInclusive, fBase.fMinInclusive, fTypeName});                    }                    if (result == 0) {                        needCheckBase = false;                    }                }                if (needCheckBase) {                    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});                    }                }                else if ( (fBase.fFacetsDefined & FACET_MINLENGTH) != 0 ) {                    if ( (fBase.fFixedFacet & FACET_MINLENGTH) != 0 && fMinLength != fBase.fMinLength ) {                        reportError( "FixedFacetValue", new Object[]{"minLength", Integer.toString(fMinLength), Integer.toString(fBase.fMinLength), fTypeName});                    }                    // check 4.3.2.c2 error: minLength < fBase.minLength                    if ( fMinLength < fBase.fMinLength ) {                        reportError( "minLength-valid-restriction", new Object[]{Integer.toString(fMinLength), Integer.toString(fBase.fMinLength), fTypeName});                    }                }            }            // check 4.3.2.c1 must: maxLength < fBase.minLength            if ( ((fFacetsDefined & FACET_MAXLENGTH ) != 0 ) && ((fBase.fFacetsDefined & FACET_MINLENGTH ) != 0 )) {                if ( fMaxLength < fBase.fMinLength) {                    reportError("minLength-less-than-equal-to-maxLength", new Object[]{Integer.toString(fBase.fMinLength), Integer.toString(fMaxLength)});                }            }            // check 4.3.3.c1 error: maxLength > fBase.maxLength            if ( (fFacetsDefined & FACET_MAXLENGTH) != 0 ) {                if ( (fBase.fFacetsDefined & FACET_MAXLENGTH) != 0 ){                    if(( (fBase.fFixedFacet & FACET_MAXLENGTH) != 0 )&& fMaxLength != fBase.fMaxLength ) {                        reportError( "FixedFacetValue", new Object[]{"maxLength", Integer.toString(fMaxLength), Integer.toString(fBase.fMaxLength), fTypeName});                    }                    if ( fMaxLength > fBase.fMaxLength ) {                        reportError( "maxLength-valid-restriction", new Object[]{Integer.toString(fMaxLength), Integer.toString(fBase.fMaxLength), fTypeName});                    }                }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?