• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XSType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: buildSubstitutables

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
private static void buildSubstitutables( XSType head, XSType _this, Set substitutables ) {
    if(!isSubstitutable(head,_this))
        return;    // no derived type of _this can substitute head.

    if(substitutables.add(_this)) {
        XSType[] child = listDirectSubstitutables(_this);
        for( int i=0; i<child.length; i++ )
            buildSubstitutables( head, child[i], substitutables );
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:Util.java


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


示例18: elementDecl

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
private void elementDecl( XSElementDecl decl, String extraAtts ) {
    XSType type = decl.getType();

    // TODO: various other attributes

    // qualified attr; Issue
    if(decl.getForm() != null) {
        extraAtts += " form=\"" + (decl.getForm() ? "qualified" : "unqualified" ) + "\"";
    }

    println(MessageFormat.format("<element name=\"{0}\"{1}{2}{3}>",
        decl.getName(),
        type.isLocal()?"":" type=\"{"+
        type.getTargetNamespace()+'}'+
        type.getName()+'\"',
        extraAtts,
        type.isLocal()?"":"/"));

    if(type.isLocal()) {
        indent++;

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

        indent--;
        println("</element>");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:SchemaWriter.java


示例19: mangleClassName

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
/**
 * Transforms the default name produced from XML name
 * by following the customization.
 *
 * This shouldn't be applied to a class name specified
 * by a customization.
 *
 * @param cmp
 *      The schema component from which the default name is derived.
 */
public String mangleClassName( String name, XSComponent cmp ) {
    if( cmp instanceof XSType )
        return nameXmlTransform.typeName.mangle(name);
    if( cmp instanceof XSElementDecl )
        return nameXmlTransform.elementName.mangle(name);
    if( cmp instanceof XSAttributeDecl )
        return nameXmlTransform.attributeName.mangle(name);
    if( cmp instanceof XSModelGroup || cmp instanceof XSModelGroupDecl )
        return nameXmlTransform.modelGroupName.mangle(name);

    // otherwise no modification
    return name;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:BISchemaBinding.java


示例20: refer

import com.sun.xml.internal.xsom.XSType; //导入依赖的package包/类
/**
 * Called for each reference to record the fact.
 *
 * So far we only care about references to types.
 */
private void refer(XSComponent source, XSType target) {
    Set<XSComponent> r = referers.get(target);
    if(r==null) {
        r = new HashSet<XSComponent>();
        referers.put(target,r);
    }
    r.add(source);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:RefererFinder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IPeripheral类代码示例发布时间:2022-05-23
下一篇:
Java Ref类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap