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


Java ORB.get_primitive_tc方法代码示例

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


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

示例1: getPrimitiveTypeCodeForClass

import org.omg.CORBA.ORB; //导入方法依赖的package包/类
public static TypeCode getPrimitiveTypeCodeForClass (ORB orb,
                                                     Class c,
                                                     ValueHandler vh) {

    if (c == Integer.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_long);
    } else if (c == Byte.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_octet);
    } else if (c == Long.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_longlong);
    } else if (c == Float.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_float);
    } else if (c == Double.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_double);
    } else if (c == Short.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_short);
    } else if (c == Character.TYPE) {
        return orb.get_primitive_tc (((ValueHandlerImpl)vh).getJavaCharTCKind());
    } else if (c == Boolean.TYPE) {
        return orb.get_primitive_tc (TCKind.tk_boolean);
    } else {
        // _REVISIT_ Not sure if this is right.
        return orb.get_primitive_tc (TCKind.tk_any);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ValueUtility.java

示例2: translateMembers

import org.omg.CORBA.ORB; //导入方法依赖的package包/类
private static ValueMember[] translateMembers (ORB orb,
                                               ObjectStreamClass osc,
                                               ValueHandler vh,
                                               IdentityKeyValueStack createdIDs)
{
    ValueHandlerImpl vhandler = (com.sun.corba.se.impl.io.ValueHandlerImpl) vh;
    ObjectStreamField fields[] = osc.getFields();
    int fieldsLength = fields.length;
    ValueMember[] members = new ValueMember[fieldsLength];
    // Note : fields come out of ObjectStreamClass in correct order for
    // writing.  So, we will create the same order in the members array.
    for (int i = 0; i < fieldsLength; i++) {
        String valRepId = vhandler.getRMIRepositoryID(fields[i].getClazz());
        members[i] = new ValueMember();
        members[i].name = fields[i].getName();
        members[i].id = valRepId; // _REVISIT_ : Manglings
        members[i].defined_in = vhandler.getDefinedInId(valRepId);// _REVISIT_ : Manglings
        members[i].version = "1.0";
        members[i].type_def = new _IDLTypeStub(); // _REVISIT_ : IDLType implementation missing

        if (fields[i].getField() == null) {
            // When using serialPersistentFields, the class may
            // no longer have an actual Field that corresponds
            // to one of the items.  The Java to IDL spec
            // ptc-00-01-06 1.3.5.6 says that the IDL field
            // should be private in this case.
            members[i].access = PRIVATE_MEMBER;
        } else {
            int m = fields[i].getField().getModifiers();
            if (Modifier.isPublic(m))
                members[i].access = PUBLIC_MEMBER;
            else
                members[i].access = PRIVATE_MEMBER;
        }

        switch (fields[i].getTypeCode()) {
        case 'B':
            members[i].type = orb.get_primitive_tc(TCKind.tk_octet); //11638
            break;
        case 'C':
            members[i].type
                = orb.get_primitive_tc(vhandler.getJavaCharTCKind()); // 11638
            break;
        case 'F':
            members[i].type = orb.get_primitive_tc(TCKind.tk_float); //11638
            break;
        case 'D' :
            members[i].type = orb.get_primitive_tc(TCKind.tk_double); //11638
            break;
        case 'I':
            members[i].type = orb.get_primitive_tc(TCKind.tk_long); //11638
            break;
        case 'J':
            members[i].type = orb.get_primitive_tc(TCKind.tk_longlong); //11638
            break;
        case 'S':
            members[i].type = orb.get_primitive_tc(TCKind.tk_short); //11638
            break;
        case 'Z':
            members[i].type = orb.get_primitive_tc(TCKind.tk_boolean); //11638
            break;
    // case '[':
    //      members[i].type = orb.get_primitive_tc(TCKind.tk_value_box); //11638
    //      members[i].id = RepositoryId.createForAnyType(fields[i].getType());
    //      break;
        default:
            members[i].type = createTypeCodeForClassInternal(orb, fields[i].getClazz(), vhandler,
                              createdIDs);
            members[i].id = vhandler.createForAnyType(fields[i].getType());
            break;
        } // end switch

    } // end for loop

    return members;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:77,代码来源:ValueUtility.java


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