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


Java Constants.T_REFERENCE属性代码示例

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


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

示例1: addConstant

private int addConstant() {
  switch(type.getType()) {
  case Constants.T_INT: case Constants.T_CHAR: case Constants.T_BYTE:
  case Constants.T_BOOLEAN: case Constants.T_SHORT:
    return cp.addInteger(((Integer)value).intValue());

  case Constants.T_FLOAT:
    return cp.addFloat(((Float)value).floatValue());

  case Constants.T_DOUBLE:
    return cp.addDouble(((Double)value).doubleValue());

  case Constants.T_LONG:
    return cp.addLong(((Long)value).longValue());

  case Constants.T_REFERENCE:
    return cp.addString(((String)value));

  default:
    throw new RuntimeException("Oops: Unhandled : " + type.getType());
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:FieldGen.java

示例2: typeOfSignature

/**
 * Return type of signature as a byte value as defined in <em>Constants</em>
 *
 * @param  signature in format described above
 * @return type of signature
 * @see    Constants
 */
public static final byte typeOfSignature(String signature)
  throws ClassFormatException
{
  try {
    switch(signature.charAt(0)) {
    case 'B' : return Constants.T_BYTE;
    case 'C' : return Constants.T_CHAR;
    case 'D' : return Constants.T_DOUBLE;
    case 'F' : return Constants.T_FLOAT;
    case 'I' : return Constants.T_INT;
    case 'J' : return Constants.T_LONG;
    case 'L' : return Constants.T_REFERENCE;
    case '[' : return Constants.T_ARRAY;
    case 'V' : return Constants.T_VOID;
    case 'Z' : return Constants.T_BOOLEAN;
    case 'S' : return Constants.T_SHORT;
    default:
      throw new ClassFormatException("Invalid method signature: " + signature);
    }
  } catch(StringIndexOutOfBoundsException e) {
    throw new ClassFormatException("Invalid method signature: " + signature);
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:Utility.java

示例3: ObjectType

/**
 * @param class_name fully qualified class name, e.g. java.lang.String
 */
public ObjectType(String class_name) {
  super(Constants.T_REFERENCE, "L" + class_name.replace('.', '/') + ";");
  this.class_name = class_name.replace('/', '.');
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:ObjectType.java


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