當前位置: 首頁>>代碼示例>>Java>>正文


Java EvaluationContextImpl類代碼示例

本文整理匯總了Java中com.intellij.debugger.engine.evaluation.EvaluationContextImpl的典型用法代碼示例。如果您正苦於以下問題:Java EvaluationContextImpl類的具體用法?Java EvaluationContextImpl怎麽用?Java EvaluationContextImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EvaluationContextImpl類屬於com.intellij.debugger.engine.evaluation包,在下文中一共展示了EvaluationContextImpl類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
@Nullable
protected PsiType evaluate(final EvaluationContextImpl evaluationContext) throws EvaluateException {
  final Project project = evaluationContext.getProject();

  ExpressionEvaluator evaluator = DebuggerInvocationUtil.commitAndRunReadAction(project, new EvaluatingComputable<ExpressionEvaluator>() {
    public ExpressionEvaluator compute() throws EvaluateException {
      return EvaluatorBuilderImpl.getInstance().build(myElement, ContextUtil.getSourcePosition(evaluationContext));
    }
  });

  final Value value = evaluator.evaluate(evaluationContext);
  if(value != null){
    return getCastableRuntimeType(project, value);
  }

  throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.surrounded.expression.null"));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:RuntimeTypeEvaluator.java

示例2: calcValue

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public void calcValue() {
  final DebuggerContextImpl context = getTree().getDebuggerContext();
  update(
    context,
    new Runnable() {
      @Override
      public void run() {
        EvaluationContextImpl evaluationContext = context.createEvaluationContext();
        getDescriptor().setContext(evaluationContext);
        getDescriptor().updateRepresentation(evaluationContext, new DescriptorLabelListener() {
          @Override
          public void labelChanged() {
            updateCaches();
            DebuggerTreeNodeImpl.this.labelChanged();
          }
        });
        childrenChanged(true);
      }
    }, false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:DebuggerTreeNodeImpl.java

示例3: convertToWrapper

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的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

示例4: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value;
  while (true) {
    value = myConditionEvaluator.evaluate(context);
    if (!(value instanceof BooleanValue)) {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }
    else {
      if (!((BooleanValue)value).booleanValue()) {
        break;
      }
    }

    if (body(context)) break;
  }

  return value;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:WhileStatementEvaluator.java

示例5: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
  while (true) {
    if (body(context)) break;

    value = myConditionEvaluator.evaluate(context);
    if (!(value instanceof BooleanValue)) {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }
    else {
      if (!((BooleanValue)value).booleanValue()) {
        break;
      }
    }
  }

  return value;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:DoWhileStatementEvaluator.java

示例6: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  myEvaluatedIndex = 0;
  myEvaluatedArrayReference = null;
  Value indexValue = (Value)myIndexEvaluator.evaluate(context);
  Value arrayValue = (Value)myArrayReferenceEvaluator.evaluate(context);
  if (!(arrayValue instanceof ArrayReference)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.array.reference.expected"));
  }
  myEvaluatedArrayReference = (ArrayReference)arrayValue;
  if (!DebuggerUtils.isInteger(indexValue)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.invalid.index.expression"));
  }
  myEvaluatedIndex = ((PrimitiveValue)indexValue).intValue();
  try {
    return myEvaluatedArrayReference.getValue(myEvaluatedIndex);
  }
  catch (Exception e) {
    throw EvaluateExceptionUtil.createEvaluateException(e);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:ArrayAccessEvaluator.java

示例7: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
  value = evaluateInitialization(context, value);

  while (true) {
    // condition
    Object codition = evaluateCondition(context);
    if (codition instanceof Boolean) {
      if (!(Boolean)codition) break;
    }
    else if (codition instanceof BooleanValue) {
      if (!((BooleanValue)codition).booleanValue()) break;
    }
    else {
      throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
    }

    // body
    if (body(context)) break;

    // update
    value = evaluateUpdate(context, value);
  }

  return value;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:ForStatementEvaluatorBase.java

示例8: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object value = myConditionEvaluator.evaluate(context);
  if(!(value instanceof BooleanValue)) {
    throw EvaluateExceptionUtil.BOOLEAN_EXPECTED;
  } else {
    if(((BooleanValue)value).booleanValue()) {
      value = myThenEvaluator.evaluate(context);
      myModifier = myThenEvaluator.getModifier();
    }
    else {
      if(myElseEvaluator != null) {
        value = myElseEvaluator.evaluate(context);
        myModifier = myElseEvaluator.getModifier();
      } else {
        value = context.getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
        myModifier = null;
      }
    }
  }
  return value;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:IfStatementEvaluator.java

示例9: batchUpdateRepresentation

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public static void batchUpdateRepresentation(@NotNull final List<HprofFieldDescriptorImpl> descriptors,
                                             @NotNull DebuggerManagerThreadImpl debuggerManagerThread,
                                             @NotNull final SuspendContextImpl suspendContext) {
  debuggerManagerThread.invokeAndWait(new DebuggerCommandImpl() {
    @Override
    protected void action() throws Exception {
      for (HprofFieldDescriptorImpl descriptor : descriptors) {
        descriptor.updateRepresentation(new EvaluationContextImpl(suspendContext, null, descriptor.getValue()),
                                        new DescriptorLabelListener() {
                                          @Override
                                          public void labelChanged() {
                                          }
                                        });
      }
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:HprofFieldDescriptorImpl.java

示例10: calcValue

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
@Override
public Value calcValue(EvaluationContextImpl evaluationContext) {
  assert (myValueData != null);
  switch (myField.getType()) {
    case BOOLEAN:
      return new BooleanValueImpl(myField, myValueData);
    case BYTE:
      return new ByteValueImpl(myField, myValueData);
    case CHAR:
      return new CharValueImpl(myField, myValueData);
    case SHORT:
      return new ShortValueImpl(myField, myValueData);
    case INT:
      return new IntegerValueImpl(myField, myValueData);
    case LONG:
      return new LongValueImpl(myField, myValueData);
    case FLOAT:
      return new FloatValueImpl(myField, myValueData);
    case DOUBLE:
      return new DoubleValueImpl(myField, myValueData);
    default:
      throw new RuntimeException("Invalid type passed ot PrimitiveDescriptorImpl");
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:PrimitiveFieldDescriptorImpl.java

示例11: JavaStaticGroup

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public JavaStaticGroup(StaticDescriptorImpl staticDescriptor,
                       EvaluationContextImpl evaluationContext,
                       NodeManagerImpl nodeManager) {
  super(staticDescriptor.getName());
  myStaticDescriptor = staticDescriptor;
  myEvaluationContext = evaluationContext;
  myNodeManager = nodeManager;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:JavaStaticGroup.java

示例12: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object object = myTypeEvaluator.evaluate(context);
  if (!(object instanceof ReferenceType)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.reference.type.expected"));
  }
  return ((ReferenceType)object).classObject();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:ClassObjectEvaluator.java

示例13: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
@Override
public Value evaluate(final EvaluationContext context) throws EvaluateException {
  if (!context.getDebugProcess().isAttached()) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("error.vm.disconnected"));
  }
  try {
    if (context.getFrameProxy() == null) {
      throw EvaluateExceptionUtil.NULL_STACK_FRAME;
    }

    Object value = myEvaluator.evaluate((EvaluationContextImpl)context);

    if (value != null && !(value instanceof Value)) {
      throw EvaluateExceptionUtil
        .createEvaluateException(DebuggerBundle.message("evaluation.error.invalid.expression", ""));
    }

    myValue = (Value)value;
    return myValue;
  }
  catch (Throwable/*IncompatibleThreadStateException*/ e) {
    if (LOG.isDebugEnabled()) {
      LOG.debug(e);
    }
    if (e instanceof EvaluateException) {
      throw ((EvaluateException)e);
    }
    else {
      throw EvaluateExceptionUtil.createEvaluateException(e);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:33,代碼來源:ExpressionEvaluatorImpl.java

示例14: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  myLeftEvaluator.evaluate(context);
  final Modifier modifier = myLeftEvaluator.getModifier();

  final Object right = myRightEvaluator.evaluate(context);
  if(right != null && !(right instanceof Value)) {
    throw EvaluateExceptionUtil.createEvaluateException(DebuggerBundle.message("evaluation.error.not.rvalue"));
  }

  assign(modifier, right, context);
  
  return right;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:AssignmentEvaluator.java

示例15: evaluate

import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; //導入依賴的package包/類
@Override
public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
  Object result = context.getSuspendContext().getDebugProcess().getVirtualMachineProxy().mirrorOfVoid();
  for (Evaluator statement : myStatements) {
    result = statement.evaluate(context);
  }
  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:BlockStatementEvaluator.java


注:本文中的com.intellij.debugger.engine.evaluation.EvaluationContextImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。