001: /*BEGIN_COPYRIGHT_BLOCK
002: *
003: * Copyright (c) 2001-2007, JavaPLT group at Rice University (javaplt@rice.edu)
004: * All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions are met:
008: * * Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.
010: * * Redistributions in binary form must reproduce the above copyright
011: * notice, this list of conditions and the following disclaimer in the
012: * documentation and/or other materials provided with the distribution.
013: * * Neither the names of DrJava, the JavaPLT group, Rice University, nor the
014: * names of its contributors may be used to endorse or promote products
015: * derived from this software without specific prior written permission.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
018: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
019: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
020: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
021: * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
022: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
023: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
024: * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
025: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
026: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028: *
029: * This software is Open Source Initiative approved Open Source Software.
030: * Open Source Initative Approved is a trademark of the Open Source Initiative.
031: *
032: * This file is part of DrJava. Download the current version of this project
033: * from http://www.drjava.org/ or http://sourceforge.net/projects/drjava/
034: *
035: * END_COPYRIGHT_BLOCK*/
036:
037: package edu.rice.cs.drjava.model.repl;
038:
039: import java.io.File;
040:
041: /** Interface for an interpreter of Java source code.
042: * @version $Id: JavaInterpreter.java 4255 2007-08-28 19:17:37Z mgricken $
043: */
044: public interface JavaInterpreter extends Interpreter {
045:
046: /** Adds the given path to the interpreter's classpath.
047: * @param path Path to add
048: */
049: //public void addClassPath(String path);
050: public void addProjectClassPath(File path);
051:
052: public void addBuildDirectoryClassPath(File path);
053:
054: public void addProjectFilesClassPath(File path);
055:
056: public void addExternalFilesClassPath(File path);
057:
058: public void addExtraClassPath(File path);
059:
060: /** Set the scope for unqualified names to be the given package.
061: * @param packageName Package to use for the current scope.
062: */
063: public void setPackageScope(String packageName);
064:
065: /** Returns the value of the variable with the given name in the interpreter.
066: * @param name Name of the variable
067: * @return Value of the variable
068: */
069: public Object getVariable(String name);
070:
071: /** Returns the class of the variable with the given name in the interpreter.
072: * @param name Name of the variable
073: * @return class of the variable
074: */
075: public Class getVariableClass(String name);
076:
077: /** Assigns the given value to the given name in the interpreter.
078: * @param name Name of the variable
079: * @param value Value to assign
080: */
081: public void defineVariable(String name, Object value);
082:
083: /** Assigns the given value to the given name in the interpreter.
084: * @param name Name of the variable
085: * @param value boolean to assign
086: */
087: public void defineVariable(String name, boolean value);
088:
089: /** Assigns the given value to the given name in the interpreter.
090: * @param name Name of the variable
091: * @param value byte to assign
092: */
093: public void defineVariable(String name, byte value);
094:
095: /** Assigns the given value to the given name in the interpreter.
096: * @param name Name of the variable
097: * @param value char to assign
098: */
099: public void defineVariable(String name, char value);
100:
101: /** Assigns the given value to the given name in the interpreter.
102: * @param name Name of the variable
103: * @param value double to assign
104: */
105: public void defineVariable(String name, double value);
106:
107: /** Assigns the given value to the given name in the interpreter.
108: * @param name Name of the variable
109: * @param value float to assign
110: */
111: public void defineVariable(String name, float value);
112:
113: /** Assigns the given value to the given name in the interpreter.
114: * @param name Name of the variable
115: * @param value int to assign
116: */
117: public void defineVariable(String name, int value);
118:
119: /** Assigns the given value to the given name in the interpreter.
120: * @param name Name of the variable
121: * @param value long to assign
122: */
123: public void defineVariable(String name, long value);
124:
125: /** Assigns the given value to the given name as a constant in the interpreter.
126: * @param name Name of the variable
127: * @param value short to assign
128: */
129: public void defineVariable(String name, short value);
130:
131: /** Assigns the given value to the given name in the interpreter.
132: * @param name Name of the variable
133: * @param value Value to assign
134: */
135: public void defineConstant(String name, Object 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 boolean to assign
140: */
141: public void defineConstant(String name, boolean 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 byte to assign
146: */
147: public void defineConstant(String name, byte 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 char to assign
152: */
153: public void defineConstant(String name, char 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 double to assign
158: */
159: public void defineConstant(String name, double 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 float to assign
164: */
165: public void defineConstant(String name, float 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 int to assign
170: */
171: public void defineConstant(String name, int 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 long to assign
176: */
177: public void defineConstant(String name, long value);
178:
179: /** Assigns the given value to the given name as a constant in the interpreter.
180: * @param name Name of the variable
181: * @param value short to assign
182: */
183: public void defineConstant(String name, short value);
184:
185: /** Sets whether protected and private variables should be accessible in the interpreter.
186: * @param accessible Whether protected and private variable are accessible
187: */
188: public void setPrivateAccessible(boolean accessible);
189:
190: /** Gets whether protected and private variables should be accessible in the interpreter. */
191: public boolean getPrivateAccessible();
192: }
|