本文整理汇总了Java中org.apache.bcel.generic.Type.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Type.toString方法的具体用法?Java Type.toString怎么用?Java Type.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.bcel.generic.Type
的用法示例。
在下文中一共展示了Type.toString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllLocalDecls
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
static String[] getAllLocalDecls(Method m) {
LocalVariable[] lt = getLocalTable(m).getLocalVariableTable();
Vector<String> v = new Vector<String>();
for (int i = 0; i < lt.length; i++) {
LocalVariable l = lt[i];
Type tp = Type.getType(l.getSignature());
String e = tp.toString() + " "
+ generatedLocalName(tp, l.getName()) + ";";
if (!v.contains(e)) {
v.addElement(e);
}
}
String[] result = new String[v.size()];
result = v.toArray(result);
// for (int i = 0; i < v.size(); i++) {
// result[i] = (String) v.elementAt(i);
// System.out.println("localdecls for " + m + ": " + result[i]);
// }
return result;
}
示例2: className
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
private static String className(Type type) {
if (type.getType() <= Constants.T_VOID) {
return PRIMITIVE_NAME;
} else if (type instanceof ArrayType) {
return className(((ArrayType) type).getBasicType());
} else {
return type.toString();
}
}
示例3: visitCHECKCAST
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
public void visitCHECKCAST(CHECKCAST c) {
Type t = c.getType(poolGen);
log.log(" instr(checkcast)=" + t, Project.MSG_DEBUG);
String type = t.toString();
design.checkClass(type);
}
示例4: visitLoadInstruction
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
public void visitLoadInstruction(LoadInstruction l) {
// log.log(" visit load", Project.MSG_DEBUG);
Type t = l.getType(poolGen);
log.log(" instr(loadinstr)=" + t, Project.MSG_DEBUG);
String type = t.toString();
design.checkClass(type);
}
示例5: visitNEW
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
public void visitNEW(NEW n) {
Type t = n.getType(poolGen);
log.log(" instr(new)=" + t, Project.MSG_DEBUG);
String type = t.toString();
design.checkClass(type);
}
示例6: visitANEWARRAY
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
public void visitANEWARRAY(ANEWARRAY n) {
Type t = n.getType(poolGen);
log.log(" instr(anewarray)=" + t, Project.MSG_DEBUG);
String type = t.toString();
design.checkClass(type);
}
示例7: visitINSTANCEOF
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
public void visitINSTANCEOF(INSTANCEOF i) {
Type t = i.getType(poolGen);
log.log(" instr(instanceof)=" + t, Project.MSG_DEBUG);
String type = t.toString();
design.checkClass(type);
}
示例8: getString
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
/**
* Get String representation of a Type including Generic information
*/
public static final String getString(Type type) {
if (type instanceof GenericObjectType)
return ((GenericObjectType) type).toString(true);
else if (type instanceof ArrayType)
return TypeCategory.asString((ArrayType) type);
else
return type.toString();
}
示例9: valueToString
import org.apache.bcel.generic.Type; //导入方法依赖的package包/类
protected String valueToString(Type value) {
return value.toString() + ",";
}