本文整理汇总了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());
}
}
示例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);
}
}
示例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('/', '.');
}