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


Java XSType.RESTRICTION属性代码示例

本文整理汇总了Java中com.sun.xml.internal.xsom.XSType.RESTRICTION属性的典型用法代码示例。如果您正苦于以下问题:Java XSType.RESTRICTION属性的具体用法?Java XSType.RESTRICTION怎么用?Java XSType.RESTRICTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.xml.internal.xsom.XSType的用法示例。


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

示例1: getLastRestrictedType

/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:AbstractExtendedComplexTypeBuilder.java

示例2: updateSubstitutabilityMap

public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:ElementDecl.java

示例3: isApplicable

public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.RESTRICTION;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:RestrictedComplexTypeBuilder.java

示例4: getDerivationMethod

public int getDerivationMethod() { return XSType.RESTRICTION; } 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:1,代码来源:SchemaSetImpl.java

示例5: getDerivationMethod

public final int getDerivationMethod() { return XSType.RESTRICTION; } 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:1,代码来源:SimpleTypeImpl.java


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