本文整理汇总了Java中com.intellij.debugger.engine.DebugProcessImpl.findClass方法的典型用法代码示例。如果您正苦于以下问题:Java DebugProcessImpl.findClass方法的具体用法?Java DebugProcessImpl.findClass怎么用?Java DebugProcessImpl.findClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.debugger.engine.DebugProcessImpl
的用法示例。
在下文中一共展示了DebugProcessImpl.findClass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToWrapper
import com.intellij.debugger.engine.DebugProcessImpl; //导入方法依赖的package包/类
private static Value convertToWrapper(EvaluationContextImpl context, PrimitiveValue value, String wrapperTypeName) throws
EvaluateException {
final DebugProcessImpl process = context.getDebugProcess();
final ClassType wrapperClass = (ClassType)process.findClass(context, wrapperTypeName, null);
final String methodSignature = "(" + JVMNameUtil.getPrimitiveSignature(value.type().name()) + ")L" + wrapperTypeName.replace('.', '/') + ";";
List<Method> methods = wrapperClass.methodsByName("valueOf", methodSignature);
if (methods.size() == 0) { // older JDK version
methods = wrapperClass.methodsByName(JVMNameUtil.CONSTRUCTOR_NAME, methodSignature);
}
if (methods.size() == 0) {
throw new EvaluateException("Cannot construct wrapper object for value of type " + value.type() + ": Unable to find either valueOf() or constructor method");
}
return process.invokeMethod(context, wrapperClass, methods.get(0), Collections.singletonList(value));
}
示例2: convertToWrapper
import com.intellij.debugger.engine.DebugProcessImpl; //导入方法依赖的package包/类
private static Value convertToWrapper(EvaluationContextImpl context, PrimitiveValue value, String wrapperTypeName) throws
EvaluateException {
final DebugProcessImpl process = context.getDebugProcess();
final ClassType wrapperClass = (ClassType)process.findClass(context, wrapperTypeName, null);
final String methodSignature = "(" + JVMNameUtil.getPrimitiveSignature(value.type().name()) + ")L" + wrapperTypeName.replace('.', '/') + ";";
List<Method> methods = wrapperClass.methodsByName("valueOf", methodSignature);
if (methods.size() == 0) { // older JDK version
methods = wrapperClass.methodsByName("<init>", methodSignature);
}
if (methods.size() == 0) {
throw new EvaluateException("Cannot construct wrapper object for value of type " + value.type() + ": Unable to find either valueOf() or constructor method");
}
final Method factoryMethod = methods.get(0);
final ArrayList args = new ArrayList();
args.add(value);
return process.invokeMethod(context, wrapperClass, factoryMethod, args);
}
示例3: evaluate
import com.intellij.debugger.engine.DebugProcessImpl; //导入方法依赖的package包/类
/**
* @return ReferenceType in the target VM, with the given fully qualified name
*/
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
DebugProcessImpl debugProcess = context.getDebugProcess();
String typeName = myTypeName.getName(debugProcess);
final ReferenceType type = debugProcess.findClass(context, typeName, context.getClassLoader());
if (type == null) {
throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("error.class.not.loaded", typeName));
}
return type;
}