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


Java XSType.isComplexType方法代码示例

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


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

示例1: isSubstitutable

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
/**
 * Implements
 * <code>Validation Rule: Schema-Validity Assessment (Element) 1.2.1.2.4</code>
 */
private static boolean isSubstitutable( XSType _base, XSType derived ) {
    // too ugly to the point that it's almost unbearable.
    // I mean, it's not even transitive. Thus we end up calling this method
    // for each candidate
    if( _base.isComplexType() ) {
        XSComplexType base = _base.asComplexType();

        for( ; base!=derived; derived=derived.getBaseType() ) {
            if( base.isSubstitutionProhibited( derived.getDerivationMethod() ) )
                return false;    // Type Derivation OK (Complex)-1
        }
        return true;
    } else {
        // simple type don't have any @block
        return true;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Util.java

示例2: isApplicable

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
public boolean isApplicable(XSComplexType ct) {

        if (!bgmBuilder.isGenerateMixedExtensions()) return false;

        XSType bt = ct.getBaseType();
        if (bt.isComplexType() &&
            bt.asComplexType().isMixed() &&
            ct.isMixed() &&
            ct.getDerivationMethod()==XSType.EXTENSION &&
            ct.getContentType().asParticle() != null &&
            ct.getExplicitContent().asEmpty() == null
            )  {
                return true;
        }

        return false;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:MixedExtendedComplexTypeBuilder.java

示例3: isApplicable

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
public boolean isApplicable(XSComplexType ct) {
    XSType bt = ct.getBaseType();
    if(bt ==schemas.getAnyType() && ct.isMixed())
        return true;    // fresh mixed complex type

    // there's no complex type in the inheritance tree yet
    if (bt.isComplexType() &&
        !bt.asComplexType().isMixed() &&
        ct.isMixed() &&
        ct.getDerivationMethod() == XSType.EXTENSION) {
            if (!bgmBuilder.isGenerateMixedExtensions() && (ct.getContentType().asParticle() == null)) {
                return false;
            }
            return true;
    }

    return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MixedComplexTypeBuilder.java

示例4: updateSubstitutabilityMap

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
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,代码行数:40,代码来源:ElementDecl.java

示例5: isApplicable

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.EXTENSION;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:ExtendedComplexTypeBuilder.java

示例6: isApplicable

import com.sun.xml.internal.xsom.XSType; //导入方法依赖的package包/类
public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.RESTRICTION;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:RestrictedComplexTypeBuilder.java


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