| package org.eclipse.jdt.debug.eval; |
| |
| /********************************************************************** |
| Copyright (c) 2000, 2002 IBM Corp. All rights reserved. |
| This file is made available under the terms of the Common Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/cpl-v10.html |
| **********************************************************************/ |
| |
| import java.io.File; |
| |
| import org.eclipse.jdt.core.IJavaProject; |
| import org.eclipse.jdt.debug.core.IJavaDebugTarget; |
| import org.eclipse.jdt.internal.debug.eval.LocalEvaluationEngine; |
| import org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine; |
| |
| /** |
| * The evaluation manager provides factory methods for |
| * creating evaluation engines. |
| * <p> |
| * Clients are not intended subclass or instantiate this |
| * class. |
| * </p> |
| * @see org.eclipse.jdt.debug.eval.IEvaluationEngine |
| * @see org.eclipse.jdt.debug.eval.IClassFileEvaluationEngine |
| * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine |
| * @see org.eclipse.jdt.debug.eval.IEvaluationResult |
| * @see org.eclipse.jdt.debug.eval.IEvaluationListener |
| * @since 2.0 |
| */ |
| public class EvaluationManager { |
| |
| /** |
| * Not to be instantiated |
| */ |
| private EvaluationManager() { |
| } |
| |
| /** |
| * Creates and returns a new evaluation engine that |
| * performs evaluations for local Java applications |
| * by deploying class files. |
| * |
| * @param project the Java project in which expressions |
| * are to be compiled |
| * @param target the Java debug target in which expressions |
| * are to be evaluated |
| * @param directory the directory where support class files |
| * are deployed to assist in the evaluation. The directory |
| * must exist. |
| * @return an evaluation engine |
| */ |
| public static IClassFileEvaluationEngine newClassFileEvaluationEngine(IJavaProject project, IJavaDebugTarget target, File directory) { |
| return new LocalEvaluationEngine(project, target, directory); |
| } |
| |
| /** |
| * Creates and returns a new evaluation engine that performs evaluations by |
| * compiling expressions into abstract syntax trees (ASTs), and interpreting |
| * the AST over a JDI connection. This type of evaluation engine is capable of |
| * performing remote evaluations. |
| * |
| * @param project the Java project in which expressions are to be compiled |
| * @param target the Java debug target in which expressions are to be evaluated |
| * @return an evaluation engine |
| */ |
| public static ASTEvaluationEngine newAstEvaluationEngine(IJavaProject project, IJavaDebugTarget target) { |
| return new ASTEvaluationEngine(project, target); |
| } |
| } |
| |