本文整理汇总了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"));
}
示例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);
}
示例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));
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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() {
}
});
}
}
});
}
示例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");
}
}
示例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;
}
示例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();
}
示例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);
}
}
}
示例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;
}
示例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;
}