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

Java ClassOutlineImpl类代码示例

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

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



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

示例1: generate

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:IsSetField.java


示例2: ConstField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
ConstField( ClassOutlineImpl outline, CPropertyInfo prop ) {
    super(outline,prop);

    // we only support value constraints for a single-value property.
    assert !prop.isCollection();

    JPrimitiveType ptype = implType.boxify().getPrimitiveType();

    // generate the constant
    JExpression defaultValue = null;
    if(prop.defaultValue!=null)
        defaultValue = prop.defaultValue.compute(outline.parent());

    $ref = outline.ref.field(JMod.PUBLIC|JMod.STATIC|JMod.FINAL,
        ptype!=null?ptype:implType, prop.getName(true), defaultValue );
    $ref.javadoc().append(prop.javadoc);

    annotate($ref);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:ConstField.java


示例3: IsSetField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
protected IsSetField( ClassOutlineImpl outline, CPropertyInfo prop,
        FieldOutline core, boolean unsetMethod, boolean issetMethod ) {
    super(outline,prop);
    this.core = core;
    this.generateIsSetMethod = issetMethod;
    this.generateUnSetMethod = unsetMethod;

    generate(outline,prop);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IsSetField.java


示例4: AbstractField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
protected AbstractField( ClassOutlineImpl outline, CPropertyInfo prop ) {
    this.outline = outline;
    this.prop = prop;
    this.codeModel = outline.parent().getCodeModel();
    this.implType = getType(IMPLEMENTATION);
    this.exposedType = getType(Aspect.EXPOSED);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AbstractField.java


示例5: NoExtendedContentField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
/**
 * @param coreList
 *      A concrete class that implements the List interface.
 *      An instance of this class will be used to store data
 *      for this field.
 */
protected NoExtendedContentField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
    // the JAXB runtime picks ArrayList if the signature is List,
    // so don't do eager allocation if it's ArrayList.
    // otherwise we need to do eager allocation so that the collection type specified by the user
    // will be used.
    super(context, prop, false);
    this.coreList = coreList;
    generate();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:NoExtendedContentField.java


示例6: DummyListField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
/**
 * @param coreList
 *      A concrete class that implements the List interface.
 *      An instance of this class will be used to store data
 *      for this field.
 */
protected DummyListField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
    // the JAXB runtime picks ArrayList if the signature is List,
    // so don't do eager allocation if it's ArrayList.
    // otherwise we need to do eager allocation so that the collection type specified by the user
    // will be used.
    super(context, prop, !coreList.fullName().equals("java.util.ArrayList"));
    this.coreList = coreList.narrow(exposedType.boxify());
    generate();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:DummyListField.java


示例7: AbstractListField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
/**
 * Call {@link #generate()} method right after this.
 */
protected AbstractListField(ClassOutlineImpl outline, CPropertyInfo prop, boolean eagerInstanciation) {
    super(outline,prop);
    this.eagerInstanciation = eagerInstanciation;

    if( implType instanceof JPrimitiveType ) {
        // primitive types don't have this tricky distinction
        assert implType==exposedType;
        primitiveType = (JPrimitiveType)implType;
    } else
        primitiveType = null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:AbstractListField.java


示例8: UntypedListField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
/**
 * @param coreList
 *      A concrete class that implements the List interface.
 *      An instance of this class will be used to store data
 *      for this field.
 */
protected UntypedListField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
    // the JAXB runtime picks ArrayList if the signature is List,
    // so don't do eager allocation if it's ArrayList.
    // otherwise we need to do eager allocation so that the collection type specified by the user
    // will be used.
    super(context, prop, !coreList.fullName().equals("java.util.ArrayList"));
    this.coreList = coreList.narrow(exposedType.boxify());
    generate();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:UntypedListField.java


示例9: ContentListField

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
/**
 * @param coreList
 *      A concrete class that implements the List interface.
 *      An instance of this class will be used to store data
 *      for this field.
 */
protected ContentListField(ClassOutlineImpl context, CPropertyInfo prop, JClass coreList) {
    // the JAXB runtime picks ArrayList if the signature is List,
    // so don't do eager allocation if it's ArrayList.
    // otherwise we need to do eager allocation so that the collection type specified by the user
    // will be used.
    super(context, prop, false);
    this.coreList = coreList;
    generate();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:ContentListField.java


示例10: decideRenderer

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


示例11: generate

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
public FieldOutline generate(ClassOutlineImpl context, CPropertyInfo prop) {
    if (dummy) {
        return new DummyListField(context, prop, coreList);
    }
    if (content) {
        return new ContentListField(context, prop, coreList);
    }
    return new UntypedListField(context, prop, coreList);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:UntypedListFieldRenderer.java


示例12: GenericFieldRenderer

import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl; //导入依赖的package包/类
public GenericFieldRenderer( Class fieldClass ) {
    try {
        constructor = fieldClass.getDeclaredConstructor(new Class[]{ClassOutlineImpl.class,CPropertyInfo.class});
    } catch (NoSuchMethodException e) {
        throw new NoSuchMethodError(e.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:GenericFieldRenderer.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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