当前位置: 首页>>代码示例>>Java>>正文


Java XSConstants.DERIVATION_NONE属性代码示例

本文整理汇总了Java中mf.org.apache.xerces.xs.XSConstants.DERIVATION_NONE属性的典型用法代码示例。如果您正苦于以下问题:Java XSConstants.DERIVATION_NONE属性的具体用法?Java XSConstants.DERIVATION_NONE怎么用?Java XSConstants.DERIVATION_NONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在mf.org.apache.xerces.xs.XSConstants的用法示例。


在下文中一共展示了XSConstants.DERIVATION_NONE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reset

public void reset(){
    fName = null;
    fTargetNamespace = null;
    fBaseType = null;
    fDerivedBy = XSConstants.DERIVATION_RESTRICTION;
    fFinal = XSConstants.DERIVATION_NONE;
    fBlock = XSConstants.DERIVATION_NONE;

    fMiscFlags = 0;

    // reset attribute group
    fAttrGrp.reset();
    fContentType = CONTENTTYPE_EMPTY;
    fXSSimpleType = null;
    fParticle = null;
    fCMValidator = null;
    fUPACMValidator = null;
    if(fAnnotations != null) {
        // help out the garbage collector
        fAnnotations.clearXSObjectList();
    }
    fAnnotations = null;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:23,代码来源:XSComplexTypeDecl.java

示例2: reset

/**
  * Reset current element declaration
  */
public void reset(){
    fScope = XSConstants.SCOPE_ABSENT;
    fName = null;
    fTargetNamespace = null;
    fType = null;
    fUnresolvedTypeName = null;
    fMiscFlags = 0;
    fBlock = XSConstants.DERIVATION_NONE;
    fFinal = XSConstants.DERIVATION_NONE;
    fDefault = null;
    fAnnotations = null;
    fSubGroup = null;
    // reset identity constraints
    for (int i=0;i<fIDCPos;i++) {
        fIDConstraints[i] = null;
    }

    fIDCPos = 0;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:22,代码来源:XSElementDecl.java

示例3: getAndCheckXsiType

XSTypeDefinition getAndCheckXsiType(QName element, String xsiType, XMLAttributes attributes) {
    // This method also deals with clause 1.2.1.2 of the constraint
    // Validation Rule: Schema-Validity Assessment (Element)

    // Element Locally Valid (Element)
    // 4 If there is an attribute information item among the element information item's [attributes] whose [namespace name] is identical to http://www.w3.org/2001/XMLSchema-instance and whose [local name] is type, then all of the following must be true:
    // 4.1 The normalized value of that attribute information item must be valid with respect to the built-in QName simple type, as defined by String Valid (3.14.4);
    QName typeName = null;
    try {
        typeName = (QName) fQNameDV.validate(xsiType, fValidationState, null);
    } catch (InvalidDatatypeValueException e) {
        reportSchemaError(e.getKey(), e.getArgs());
        reportSchemaError(
            "cvc-elt.4.1",
            new Object[] {
                element.rawname,
                SchemaSymbols.URI_XSI + "," + SchemaSymbols.XSI_TYPE,
                xsiType });
        return null;
    }

    // 4.2 The local name and namespace name (as defined in QName Interpretation (3.15.3)), of the actual value of that attribute information item must resolve to a type definition, as defined in QName resolution (Instance) (3.15.4)
    XSTypeDefinition type = null;
    // if the namespace is schema namespace, first try built-in types
    if (typeName.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
        type = SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(typeName.localpart);
    }
    // if it's not schema built-in types, then try to get a grammar
    if (type == null) {
        //try to find schema grammar by different means....
        SchemaGrammar grammar =
            findSchemaGrammar(
                XSDDescription.CONTEXT_XSITYPE,
                typeName.uri,
                element,
                typeName,
                attributes);

        if (grammar != null)
            type = grammar.getGlobalTypeDecl(typeName.localpart);
    }
    // still couldn't find the type, report an error
    if (type == null) {
        reportSchemaError("cvc-elt.4.2", new Object[] { element.rawname, xsiType });
        return null;
    }

    // if there is no current type, set this one as current.
    // and we don't need to do extra checking
    if (fCurrentType != null) {
        short block = XSConstants.DERIVATION_NONE;
        // 4.3 The local type definition must be validly derived from the {type definition} given the union of the {disallowed substitutions} and the {type definition}'s {prohibited substitutions}, as defined in Type Derivation OK (Complex) (3.4.6) (if it is a complex type definition), or given {disallowed substitutions} as defined in Type Derivation OK (Simple) (3.14.6) (if it is a simple type definition).
        // Note: It's possible to have fCurrentType be non-null and fCurrentElemDecl
        // be null, if the current type is set using the property "root-type-definition".
        // In that case, we don't disallow any substitutions. -PM
        if (fCurrentElemDecl != null) {
            block = fCurrentElemDecl.fBlock;
        }
        if (fCurrentType.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
            block |= ((XSComplexTypeDecl) fCurrentType).fBlock;
        }
        if (!XSConstraints.checkTypeDerivationOk(type, fCurrentType, block)) {
            reportSchemaError(
                    "cvc-elt.4.3",
                    new Object[] { element.rawname, xsiType, fCurrentType.getName()});
        }
    }

    return type;
}
 
开发者ID:MaTriXy,项目名称:xerces-for-android,代码行数:70,代码来源:XMLSchemaValidator.java


注:本文中的mf.org.apache.xerces.xs.XSConstants.DERIVATION_NONE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。