blob: d915df1004fe59c3e0cc837cfa95286e1e368e04 [file] [log] [blame]
package org.eclipse.jdt.debug.eval;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
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 evalautions.
*
* @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);
}
}