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


Java DebugProcessImpl.findClass方法代码示例

本文整理汇总了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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BoxingEvaluator.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:BoxingEvaluator.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:TypeEvaluator.java


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