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


Java XSType类代码示例

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


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

示例1: getLastRestrictedType

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
/**
 * 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:AbstractExtendedComplexTypeBuilder.java

示例2: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:MixedComplexTypeBuilder.java

示例3: 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

示例4: elementDecl

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
/**
 * Creates node for element declaration with additional attributes.
 *
 * @param decl      Element declaration.
 * @param extraAtts Additional attributes.
 */
private void elementDecl(XSElementDecl decl, String extraAtts) {
    XSType type = decl.getType();

    // TODO: various other attributes

    String str = MessageFormat.format("Element name=\"{0}\"{1}{2}",
            new Object[]{
                decl.getName(),
                type.isLocal() ? "" : " type=\"{"
            + type.getTargetNamespace() + "}"
            + type.getName() + "\"", extraAtts});

    SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
    this.currNode.add(newNode);
    this.currNode = newNode;

    if (type.isLocal()) {
        if (type.isLocal()) {
            type.visit(this);
        }
    }

    this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:SchemaTreeTraverser.java

示例5: getAttributeUse

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public XSAttributeUse getAttributeUse( String nsURI, String localName ) {
    UName name = new UName(nsURI,localName);

    if(prohibitedAtts.contains(name))       return null;

    XSAttributeUse o = attributes.get(name);


    if(o==null) {
        Iterator itr = iterateAttGroups();
        while(itr.hasNext() && o==null)
            o = ((XSAttGroupDecl)itr.next()).getAttributeUse(nsURI,localName);
    }

    if(o==null) {
        XSType base = getBaseType();
        if(base.asComplexType()!=null)
            o = base.asComplexType().getAttributeUse(nsURI,localName);
    }

    return o;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:ComplexTypeImpl.java

示例6: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:MixedExtendedComplexTypeBuilder.java

示例7: isApplicable

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public boolean isApplicable(XSComplexType ct) {
    if (!bgmBuilder.model.options.contentForWildcard) {
        return false;
    }
    XSType bt = ct.getBaseType();
    if (bt ==schemas.getAnyType() && ct.getContentType() != null) {
        XSParticle part = ct.getContentType().asParticle();
        if ((part != null) && (part.getTerm().isModelGroup())) {
            XSParticle[] parts = part.getTerm().asModelGroup().getChildren();
            int wildcardCount = 0;
            int i = 0;
            while ((i < parts.length) && (wildcardCount <= 1)) {
                if (parts[i].getTerm().isWildcard()) {
                    wildcardCount += 1;
                }
                i++;
            }
            return (wildcardCount > 1);
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:MultiWildcardComplexTypeBuilder.java

示例8: getSoleElementReferer

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
/**
 * If only one global {@link XSElementDecl} is refering to {@link XSType},
 * return that element, otherwise null.
 */
private @Nullable XSElementDecl getSoleElementReferer(@NotNull XSType t) {
    Set<XSComponent> referer = builder.getReferer(t);

    XSElementDecl sole = null;
    for (XSComponent r : referer) {
        if(r instanceof XSElementDecl) {
            XSElementDecl x = (XSElementDecl) r;
            if(!x.isGlobal())
                // local element references can be ignored, as their names are either given
                // by the property, or by the JAXBElement (for things like mixed contents)
                continue;
            if(sole==null)  sole=x;
            else            return null;    // more than one
        } else {
            // if another type refers to this type, that means
            // this type has a sub-type, so type substitution is possible now.
            return null;
        }
    }

    return sole;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DefaultClassBinder.java

示例9: contains

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public boolean contains(XSType type) {
    if( typeSet.contains(type) ) {
        return true;
    } else {
        XSType baseType = type.getBaseType();
        if( baseType == null ) {
            return false;
        } else {
            // climb the super type hierarchy
            return contains(baseType);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:TypeClosure.java

示例10: getSubtypes

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public List<XSComplexType> getSubtypes() {
    ArrayList subtypeList = new ArrayList();
    Iterator<XSComplexType> cTypes = getRoot().iterateComplexTypes();
    while (cTypes.hasNext()) {
        XSComplexType cType= cTypes.next();
        XSType base = cType.getBaseType();
        if ((base != null) && (base.equals(this))) {
            subtypeList.add(cType);
        }
    }
    return subtypeList;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:ComplexTypeImpl.java

示例11: BaseContentRef

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public BaseContentRef(final NGCCRuntimeEx $runtime, Ref.Type _baseType) {
    this.baseType = _baseType;
    $runtime.addPatcher(this);
    $runtime.addErrorChecker(new Patch() {
        public void run() throws SAXException {
            XSType t = baseType.getType();
            if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) {
                $runtime.reportError(
                    Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED,
                        t.getTargetNamespace(), t.getName()), loc);
            }
        }
    });
    this.loc = $runtime.copyLocator();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:BaseContentRef.java

示例12: getContentType

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public XSContentType getContentType() {
    XSType t = baseType.getType();
    if(t.asComplexType()!=null)
        return t.asComplexType().getContentType();
    else
        return t.asSimpleType();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:BaseContentRef.java

示例13: getAttributeWildcard

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public XSWildcard getAttributeWildcard() {
    WildcardImpl complete = localAttWildcard;

    Iterator itr = iterateAttGroups();
    while( itr.hasNext() ) {
        WildcardImpl w = (WildcardImpl)((XSAttGroupDecl)itr.next()).getAttributeWildcard();

        if(w==null)     continue;

        if(complete==null)
            complete = w;
        else
            // TODO: the spec says it's intersection,
            // but I think it has to be union.
            complete = complete.union(ownerDocument,w);
    }

    if( getDerivationMethod()==RESTRICTION )    return complete;

    WildcardImpl base=null;
    XSType baseType = getBaseType();
    if(baseType.asComplexType()!=null)
        base = (WildcardImpl)baseType.asComplexType().getAttributeWildcard();

    if(complete==null)  return base;
    if(base==null)      return complete;

    return complete.union(ownerDocument,base);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:ComplexTypeImpl.java

示例14: isDerivedFrom

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
public boolean isDerivedFrom(XSType t) {
    XSType x = this;
    while(true) {
        if(t==x)
            return true;
        XSType s = x.getBaseType();
        if(s==x)
            return false;
        x = s;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SimpleTypeImpl.java

示例15: listDirectSubstitutables

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
private static XSType[] listDirectSubstitutables( XSType _this ) {
    ArrayList r = new ArrayList();

    // TODO: handle @block
    Iterator itr = ((SchemaImpl)_this.getOwnerSchema()).parent.iterateTypes();
    while( itr.hasNext() ) {
        XSType t = (XSType)itr.next();
        if( t.getBaseType()==_this )
            r.add(t);
    }
    return (XSType[]) r.toArray(new XSType[r.size()]);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Util.java


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