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


Java TypeUse.isCollection方法代码示例

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


在下文中一共展示了TypeUse.isCollection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createValueProperty

import com.sun.tools.internal.xjc.model.TypeUse; //导入方法依赖的package包/类
public CValuePropertyInfo createValueProperty(String defaultName,boolean forConstant,
    XSComponent source,TypeUse tu, QName typeName) {

    markAsAcknowledged();
    constantPropertyErrorCheck();

    String name = getPropertyName(forConstant);
    if(name==null) {
        name = defaultName;
        if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode())
            name = JJavaName.getPluralForm(name);
    }

    CValuePropertyInfo prop = wrapUp(new CValuePropertyInfo(name, source, getCustomizations(source), source.getLocator(), tu, typeName), source);
    BIInlineBinaryData.handle(source, prop);
    return prop;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:BIProperty.java

示例2: createAttributeProperty

import com.sun.tools.internal.xjc.model.TypeUse; //导入方法依赖的package包/类
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) {

        boolean forConstant =
            getCustomization(use).isConstantProperty() &&
            use.getFixedValue()!=null;

        String name = getPropertyName(forConstant);
        if(name==null) {
            NameConverter conv = getBuilder().getNameConverter();
            if(forConstant)
                name = conv.toConstantName(use.getDecl().getName());
            else
                name = conv.toPropertyName(use.getDecl().getName());
            if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode())
                name = JJavaName.getPluralForm(name);
        }

        markAsAcknowledged();
        constantPropertyErrorCheck();

        return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(),
                BGMBuilder.getName(use.getDecl()), tu,
                BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use);
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:BIProperty.java

示例3: attributeUse

import com.sun.tools.internal.xjc.model.TypeUse; //导入方法依赖的package包/类
/**
 * Attribute use always becomes a property.
 */
public void attributeUse(XSAttributeUse use) {
    boolean hasFixedValue = use.getFixedValue()!=null;
    BIProperty pc = BIProperty.getCustomization(use);

    // map to a constant property ?
    boolean toConstant = pc.isConstantProperty() && hasFixedValue;
    TypeUse attType = bindAttDecl(use.getDecl());

    CPropertyInfo prop = pc.createAttributeProperty( use, attType );

    if(toConstant) {
        prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue());
        prop.realization = builder.fieldRendererFactory.getConst(prop.realization);
    } else
    if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) {
        // don't support a collection default value. That's difficult to do.
        // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases

        if(use.getDefaultValue()!=null) {
            // this attribute use has a default value.
            // the item type is guaranteed to be a leaf type... or TODO: is it really so?
            // don't support default values if it's a list
            prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue());
        } else
        if(use.getFixedValue()!=null) {
            prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue());
        }
    } else if(prop.baseType != null && prop.baseType.isPrimitive()) {
        ErrorReporter errorReporter = Ring.get(ErrorReporter.class);

        errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name());
    }

    getCurrentBean().addProperty(prop);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:BindPurple.java


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