KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > rice > cs > drjava > model > repl > JavaInterpreter


1 /*BEGIN_COPYRIGHT_BLOCK
2  *
3  * This file is part of DrJava. Download the current version of this project from http://www.drjava.org/
4  * or http://sourceforge.net/projects/drjava/
5  *
6  * DrJava Open Source License
7  *
8  * Copyright (C) 2001-2005 JavaPLT group at Rice University (javaplt@rice.edu). All rights reserved.
9  *
10  * Developed by: Java Programming Languages Team, Rice University, http://www.cs.rice.edu/~javaplt/
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
13  * documentation files (the "Software"), to deal with the Software without restriction, including without limitation
14  * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
15  * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
16  *
17  * - Redistributions of source code must retain the above copyright notice, this list of conditions and the
18  * following disclaimers.
19  * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
20  * following disclaimers in the documentation and/or other materials provided with the distribution.
21  * - Neither the names of DrJava, the JavaPLT, Rice University, nor the names of its contributors may be used to
22  * endorse or promote products derived from this Software without specific prior written permission.
23  * - Products derived from this software may not be called "DrJava" nor use the term "DrJava" as part of their
24  * names without prior written permission from the JavaPLT group. For permission, write to javaplt@rice.edu.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
27  * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28  * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
29  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30  * WITH THE SOFTWARE.
31  *
32  *END_COPYRIGHT_BLOCK*/

33
34 package edu.rice.cs.drjava.model.repl;
35
36 import java.net.URL JavaDoc;
37
38 /** Interface for an interpreter of Java source code.
39  * @version $Id: JavaInterpreter.java 4028 2006-11-07 00:21:48Z rcartwright $
40  */

41 public interface JavaInterpreter extends Interpreter {
42   
43   /** Adds the given path to the interpreter's classpath.
44    * @param path Path to add
45    */

46   //public void addClassPath(String path);
47
public void addProjectClassPath(URL JavaDoc path);
48   public void addBuildDirectoryClassPath(URL JavaDoc path);
49   public void addProjectFilesClassPath(URL JavaDoc path);
50   public void addExternalFilesClassPath(URL JavaDoc path);
51   public void addExtraClassPath(URL JavaDoc path);
52   
53   /** Set the scope for unqualified names to be the given package.
54    * @param packageName Package to use for the current scope.
55    */

56   public void setPackageScope(String JavaDoc packageName);
57   
58   /** Returns the value of the variable with the given name in the interpreter.
59    * @param name Name of the variable
60    * @return Value of the variable
61    */

62   public Object JavaDoc getVariable(String JavaDoc name);
63   
64   /** Returns the class of the variable with the given name in the interpreter.
65    * @param name Name of the variable
66    * @return class of the variable
67    */

68   public Class JavaDoc getVariableClass(String JavaDoc name);
69   
70   /** Assigns the given value to the given name in the interpreter.
71    * @param name Name of the variable
72    * @param value Value to assign
73    */

74   public void defineVariable(String JavaDoc name, Object JavaDoc value);
75   
76   /** Assigns the given value to the given name in the interpreter.
77    * @param name Name of the variable
78    * @param value boolean to assign
79    */

80   public void defineVariable(String JavaDoc name, boolean value);
81   
82   /** Assigns the given value to the given name in the interpreter.
83    * @param name Name of the variable
84    * @param value byte to assign
85    */

86   public void defineVariable(String JavaDoc name, byte value);
87   
88   /** Assigns the given value to the given name in the interpreter.
89    * @param name Name of the variable
90    * @param value char to assign
91    */

92   public void defineVariable(String JavaDoc name, char value);
93   
94   /** Assigns the given value to the given name in the interpreter.
95    * @param name Name of the variable
96    * @param value double to assign
97    */

98   public void defineVariable(String JavaDoc name, double value);
99   
100   /** Assigns the given value to the given name in the interpreter.
101    * @param name Name of the variable
102    * @param value float to assign
103    */

104   public void defineVariable(String JavaDoc name, float value);
105   
106   
107   /** Assigns the given value to the given name in the interpreter.
108    * @param name Name of the variable
109    * @param value int to assign
110    */

111   public void defineVariable(String JavaDoc name, int value);
112   
113   /** Assigns the given value to the given name in the interpreter.
114    * @param name Name of the variable
115    * @param value long to assign
116    */

117   public void defineVariable(String JavaDoc name, long value);
118   
119   /** Assigns the given value to the given name as a constant in the interpreter.
120    * @param name Name of the variable
121    * @param value short to assign
122    */

123   public void defineVariable(String JavaDoc name, short value);
124   
125   /** Assigns the given value to the given name in the interpreter.
126    * @param name Name of the variable
127    * @param value Value to assign
128    */

129   public void defineConstant(String JavaDoc name, Object JavaDoc value);
130   
131   /** Assigns the given value to the given name as a constant in the interpreter.
132    * @param name Name of the variable
133    * @param value boolean to assign
134    */

135   public void defineConstant(String JavaDoc name, boolean value);
136   
137   /** Assigns the given value to the given name as a constant in the interpreter.
138    * @param name Name of the variable
139    * @param value byte to assign
140    */

141   public void defineConstant(String JavaDoc name, byte value);
142   
143   /** Assigns the given value to the given name as a constant in the interpreter.
144    * @param name Name of the variable
145    * @param value char to assign
146    */

147   public void defineConstant(String JavaDoc name, char value);
148   
149   /** Assigns the given value to the given name as a constant in the interpreter.
150    * @param name Name of the variable
151    * @param value double to assign
152    */

153   public void defineConstant(String JavaDoc name, double value);
154   
155   /** Assigns the given value to the given name as a constant in the interpreter.
156    * @param name Name of the variable
157    * @param value float to assign
158    */

159   public void defineConstant(String JavaDoc name, float value);
160   
161   /** Assigns the given value to the given name as a constant in the interpreter.
162    * @param name Name of the variable
163    * @param value int to assign
164    */

165   public void defineConstant(String JavaDoc name, int value);
166   
167   /** Assigns the given value to the given name as a constant in the interpreter.
168    * @param name Name of the variable
169    * @param value long to assign
170    */

171   public void defineConstant(String JavaDoc name, long value);
172   
173   /** Assigns the given value to the given name as a constant in the interpreter.
174    * @param name Name of the variable
175    * @param value short to assign
176    */

177   public void defineConstant(String JavaDoc name, short value);
178   
179   /** Sets whether protected and private variables should be accessible in the interpreter.
180    * @param accessible Whether protected and private variable are accessible
181    */

182   public void setPrivateAccessible(boolean accessible);
183   
184   /** Gets whether protected and private variables should be accessible in the interpreter. */
185   public boolean getPrivateAccessible();
186 }
187
Popular Tags