KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > debug > eval > EvaluationManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.debug.eval;
12
13  
14 import java.io.File JavaDoc;
15
16 import org.eclipse.jdt.core.IJavaProject;
17 import org.eclipse.jdt.debug.core.IJavaDebugTarget;
18 import org.eclipse.jdt.internal.debug.eval.LocalEvaluationEngine;
19 import org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine;
20
21 /**
22  * The evaluation manager provides factory methods for
23  * creating evaluation engines.
24  * <p>
25  * Clients are not intended subclass or instantiate this
26  * class.
27  * </p>
28  * @see org.eclipse.jdt.debug.eval.IEvaluationEngine
29  * @see org.eclipse.jdt.debug.eval.IClassFileEvaluationEngine
30  * @see org.eclipse.jdt.debug.eval.IAstEvaluationEngine
31  * @see org.eclipse.jdt.debug.eval.IEvaluationResult
32  * @see org.eclipse.jdt.debug.eval.IEvaluationListener
33  * @since 2.0
34  */

35 public class EvaluationManager {
36         
37     /**
38      * Not to be instantiated
39      */

40     private EvaluationManager() {
41     }
42                 
43     /**
44      * Creates and returns a new evaluation engine that
45      * performs evaluations for local Java applications
46      * by deploying class files.
47      *
48      * @param project the Java project in which expressions
49      * are to be compiled
50      * @param target the Java debug target in which expressions
51      * are to be evaluated
52      * @param directory the directory where support class files
53      * are deployed to assist in the evaluation. The directory
54      * must exist.
55      * @return an evaluation engine
56      */

57     public static IClassFileEvaluationEngine newClassFileEvaluationEngine(IJavaProject project, IJavaDebugTarget target, File JavaDoc directory) {
58         return new LocalEvaluationEngine(project, target, directory);
59     }
60      
61     /**
62      * Creates and returns a new evaluation engine that performs evaluations by
63      * compiling expressions into abstract syntax trees (ASTs), and interpreting
64      * the AST over a JDI connection. This type of evaluation engine is capable of
65      * performing remote evaluations.
66      *
67      * @param project the Java project in which expressions are to be compiled
68      * @param target the Java debug target in which expressions are to be evaluated
69      * @return an evaluation engine
70      */

71     public static IAstEvaluationEngine newAstEvaluationEngine(IJavaProject project, IJavaDebugTarget target) {
72         return new ASTEvaluationEngine(project, target);
73     }
74 }
75
76
Popular Tags