请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CClassInfo类代码示例

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

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



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

示例1: getUsedPackages

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
 * Returns all <i>used</i> JPackages.
 *
 * A JPackage is considered as "used" if a ClassItem or
 * a InterfaceItem resides in that package.
 *
 * This value is dynamically calculated every time because
 * one can freely remove ClassItem/InterfaceItem.
 *
 * @return
 *         Given the same input, the order of packages in the array
 *         is always the same regardless of the environment.
 */
public final JPackage[] getUsedPackages(Aspect aspect) {
    Set<JPackage> s = new TreeSet<JPackage>();

    for (CClassInfo bean : model.beans().values()) {
        JClassContainer cont = getContainer(bean.parent(), aspect);
        if (cont.isPackage()) {
            s.add((JPackage) cont);
        }
    }

    for (CElementInfo e : model.getElementMappings(null).values()) {
        // at the first glance you might think we should be iterating all elements,
        // not just global ones, but if you think about it, local ones live inside
        // another class, so those packages are already enumerated when we were
        // walking over CClassInfos.
        s.add(e._package());
    }

    return s.toArray(new JPackage[s.size()]);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:BeanGenerator.java


示例2: generateClassDef

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
 * Generates the minimum {@link JDefinedClass} skeleton
 * without filling in its body.
 */
private ClassOutlineImpl generateClassDef(CClassInfo bean) {
    ImplStructureStrategy.Result r = model.strategy.createClasses(this, bean);
    JClass implRef;

    if (bean.getUserSpecifiedImplClass() != null) {
        // create a place holder for a user-specified class.
        JDefinedClass usr;
        try {
            usr = codeModel._class(bean.getUserSpecifiedImplClass());
            // but hide that file so that it won't be generated.
            usr.hide();
        } catch (JClassAlreadyExistsException e) {
            // it's OK for this to collide.
            usr = e.getExistingClass();
        }
        usr._extends(r.implementation);
        implRef = usr;
    } else {
        implRef = r.implementation;
    }

    return new ClassOutlineImpl(this, bean, r.exposed, r.implementation, implRef);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:BeanGenerator.java


示例3: containingChoice

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private boolean containingChoice(CClassInfo typeBean) {
    XSComponent component = typeBean.getSchemaComponent();
    if (component instanceof XSComplexType) {
        XSContentType contentType = ((XSComplexType) component).getContentType();
        XSParticle particle = contentType.asParticle();
        if (particle != null) {
            XSTerm term = particle.getTerm();
            XSModelGroup modelGroup = term.asModelGroup();
            if (modelGroup != null) {
                return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE);
            }
        }
    }

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


示例4: toElementRef

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
 * The whole type set can be later bound to a reference property,
 * in which case we need to generate additional code to wrap this
 * type reference into an element class.
 *
 * This method generates such an element class and returns it.
 */
protected void toElementRef(CReferencePropertyInfo prop) {
    CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
    Model model = Ring.get(Model.class);

    CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList();

    if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) {
        CClassInfo bean = new CClassInfo(model,scope,
                        model.getNameConverter().toClassName(decl.getName()),
                        decl.getLocator(), null, BGMBuilder.getName(decl), decl,
                        custs);
        bean.setBaseClass((CClassInfo)target);
        prop.getElements().add(bean);
    } else {
        CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target,
                decl.getDefaultValue(), decl, custs, decl.getLocator());
        prop.getElements().add(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:RawTypeSetBuilder.java


示例5: never

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
/**
     * Makes sure that the component doesn't carry a {@link BIClass}
     * customization.
     *
     * @return
     *      return value is unused. Since most of the caller needs to
     *      return null, to make the code a little bit shorter, this
     *      method always return null (so that the caller can always
     *      say <code>return never(sc);</code>.
     */
    private CClassInfo never() {
        // all we need to do here is just not to acknowledge
        // any class customization. Then this class customization
        // will be reported as an error later when we check all
        // unacknowledged customizations.


//        BIDeclaration cust=owner.getBindInfo(component).get(BIClass.NAME);
//        if(cust!=null) {
//            // error
//            owner.errorReporter.error(
//                cust.getLocation(),
//                "test {0}", NameGetter.get(component) );
//        }
        return null;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:DefaultClassBinder.java


示例6: calcClass

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private CClassInfo calcClass() {
    BIElement e = owner.bindInfo.element(name);
    if(e==null) {
        if(contentModelType!=DTDEventListener.CONTENT_MODEL_MIXED
        || !attributes.isEmpty()
        || mustBeClass)
            return createDefaultClass();
        if(contentModel!=Term.EMPTY) {
            throw new UnsupportedOperationException("mixed content model not supported");
        } else {
            // just #PCDATA
            if(isReferenced)
                return null;
            else
                // if no one else is referencing, assumed to be the root.
                return createDefaultClass();
        }
    } else {
        return e.clazz;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Element.java


示例7: mapToClass

import com.sun.tools.internal.xjc.model.CClassInfo; //导入依赖的package包/类
private void mapToClass(DElementPattern p) {
    NameClass nc = p.getName();
    if(nc.isOpen())
        return;   // infinite name. can't map to a class.

    Set<QName> names = nc.listNames();

    CClassInfo[] types = new CClassInfo[names.size()];
    int i=0;
    for( QName n : names ) {
        // TODO: read class names from customization
        String name = model.getNameConverter().toClassName(n.getLocalPart());

        bindQueue.put(
            types[i++] = new CClassInfo(model,pkg,name,p.getLocation(),null,n,null,null/*TODO*/),
            p.getChild() );
    }

    classes.put(p,types);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:RELAXNGCompiler.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java BaseTreeModel类代码示例发布时间:2022-05-23
下一篇:
Java BIFactoryMethod类代码示例发布时间: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