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

Java CReferencePropertyInfo类代码示例

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

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



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

示例1: build

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
@Override
public void build( XSParticle p, Collection<XSParticle> forcedProps ) {
    Checker checker = checkCollision(p,forcedProps);

    if(checker.hasNameCollision()) {
        CReferencePropertyInfo prop = new CReferencePropertyInfo(
            getCurrentBean().getBaseClass()==null?"Content":"Rest",
            true, false, false, p,
            builder.getBindInfo(p).toCustomizationList(),
            p.getLocator(), false, false, false);
        RawTypeSetBuilder.build(p,false).addTo(prop);
        prop.javadoc = Messages.format( Messages.MSG_FALLBACK_JAVADOC,
                checker.getCollisionInfo().toString() );

        getCurrentBean().addProperty(prop);
    } else {
        new Builder(checker.markedParticles).particle(p);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DefaultParticleBinder.java


示例2: toElementRef

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的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


示例3: annotate

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
/**
 * Annotate the field according to the recipes given as {@link CPropertyInfo}.
 */
protected void annotate( JAnnotatable field ) {

    assert(field!=null);

    /*
    TODO: consider moving this logic to somewhere else
    so that it can be better shared, for how a field gets
    annotated doesn't really depend on how we generate accessors.

    so perhaps we should separate those two.
    */

    // TODO: consider a visitor
    if (prop instanceof CAttributePropertyInfo) {
        annotateAttribute(field);
    } else if (prop instanceof CElementPropertyInfo) {
        annotateElement(field);
    } else if (prop instanceof CValuePropertyInfo) {
        field.annotate(XmlValue.class);
    } else if (prop instanceof CReferencePropertyInfo) {
        annotateReference(field);
    }

    outline.parent().generateAdapterIfNecessary(prop,field);

    QName st = prop.getSchemaType();
    if(st!=null)
        field.annotate2(XmlSchemaTypeWriter.class)
            .name(st.getLocalPart())
            .namespace(st.getNamespaceURI());

    if(prop.inlineBinaryData())
        field.annotate(XmlInlineBinaryData.class);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:AbstractField.java


示例4: getType

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
@Override
protected JType getType(final Aspect aspect) {
    if (Aspect.IMPLEMENTATION.equals(aspect)) {
        return super.getType(aspect);
    }

    if (prop instanceof CReferencePropertyInfo) {
        Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
        if ((elements != null) && (elements.size() > 0)) {
            return codeModel.ref(Serializable.class);
        }
    }

    return codeModel.ref(String.class);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:NoExtendedContentField.java


示例5: annotate

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
/**
 * Annotate the field according to the recipes given as {@link CPropertyInfo}.
 */
@Override
protected void annotate( JAnnotatable field ) {
    super.annotate(field);

    if (prop instanceof CReferencePropertyInfo) {
        CReferencePropertyInfo pref = (CReferencePropertyInfo)prop;
        if (pref.isDummy()) {
            annotateDummy(field);
        }
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:DummyListField.java


示例6: decideRenderer

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
private FieldRenderer decideRenderer(ClassOutlineImpl outline, CPropertyInfo prop) {

        if (prop instanceof CReferencePropertyInfo) {
            CReferencePropertyInfo p = (CReferencePropertyInfo)prop;
            if (p.isDummy()) {
                return frf.getDummyList(outline.parent().getCodeModel().ref(ArrayList.class));
            }
            if (p.isContent() && (p.isMixedExtendedCust())) {
                return frf.getContentList(outline.parent().getCodeModel().ref(ArrayList.class).narrow(Serializable.class));
            }
        }

        if(!prop.isCollection()) {
            // non-collection field

            // TODO: check for bidning info for optionalPrimitiveType=boxed or
            // noHasMethod=false and noDeletedMethod=false
            if(prop.isUnboxable())
                // this one uses a primitive type as much as possible
                return frf.getRequiredUnboxed();
            else
                // otherwise use the default non-collection field
                return frf.getSingle();
        }

        if( defaultCollectionFieldRenderer==null ) {
            return frf.getList(outline.parent().getCodeModel().ref(ArrayList.class));
        }

        // this field is a collection field.
        // use untyped list as the default. This is consistent
        // to the JAXB spec.
        return defaultCollectionFieldRenderer;
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:DefaultFieldRenderer.java


示例7: createDummyExtendedMixedReferenceProperty

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createDummyExtendedMixedReferenceProperty(
        String defaultName, XSComponent source, RawTypeSet types) {
        return createReferenceProperty(
                defaultName,
                false,
                source,
                types,
                true,
                true,
                false,
                true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java


示例8: createContentExtendedMixedReferenceProperty

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createContentExtendedMixedReferenceProperty(
        String defaultName, XSComponent source, RawTypeSet types) {
        return createReferenceProperty(
                defaultName,
                false,
                source,
                types,
                true,
                false,
                true,
                true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:BIProperty.java


示例9: createReferenceProperty

import com.sun.tools.internal.xjc.model.CReferencePropertyInfo; //导入依赖的package包/类
public CReferencePropertyInfo createReferenceProperty(
        String defaultName, boolean forConstant, XSComponent source,
        RawTypeSet types, boolean isMixed, boolean dummy, boolean content, boolean isMixedExtended) {

    if (types == null) {    // this is a special case where we need to generate content because potential subtypes would need to be able to override what's store inside
        content = true;
    } else {
        if(!types.refs.isEmpty())
            // if this property is empty, don't acknowleedge the customization
            // this allows pointless property customization to be reported as an error
            markAsAcknowledged();
    }
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if(name==null)
        name = defaultName;

    CReferencePropertyInfo prop = wrapUp(
                                        new CReferencePropertyInfo(
                                            name,
                                            (types == null) ? true : types.getCollectionMode().isRepeated()||isMixed,
                                            (types == null) ? false : types.isRequired(),
                                            isMixed,
                                            source,
                                            getCustomizations(source), source.getLocator(), dummy, content, isMixedExtended),
                                    source);
    if (types != null) {
        types.addTo(prop);
    }

    BIInlineBinaryData.handle(source, prop);
    return prop;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:BIProperty.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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