/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package evalexpr;
/**
* A file manager for compiling strings to byte arrays.
* This file manager delegates to another file manager
* to lookup classes on boot class path.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own
* risk. This code and its internal interfaces are subject to change
* or deletion without notice.</b></p>
* @author Peter von der Ahé
*/
/**
* Maps binary class names to class files stored as byte arrays.
*/
/**
* Creates a JavaFileObject representing the given compilation unit.
* @param name a name representing this source code, for example, the name of a class
* @param code a compilation unit (source code for a Java program)
* @return a JavaFileObject represtenting the given compilation unit
*/
}
/**
* Construct a memory file manager which delegates to the specified
* file manager for unknown sources.
* @param fileManager a file manager used to look up class files on class path, etc.
*/
super(fileManager);
}
/**
* Get a class loader which first search the classes stored
* by this file mananger.
* @return a class loader for compiled files
*/
return new ByteArrayClassLoader(classes);
}
{
if (originatingSource instanceof JavaSourceFromString) {
return new JavaClassInArray(name);
} else {
throw new UnsupportedOperationException();
}
}
try {
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
}
}
/**
* A file object representing a Java class file stored in a byte array.
*/
/**
* Constructs a JavaClassInArray object.
* @param name binary name of the class to be stored in this file object
*/
}
return new FilterOutputStream(new ByteArrayOutputStream()) {
public void close() throws IOException {
}
};
}
}
/**
* A file object used to represent source coming from a string.
*/
/**
* The source code of this "file".
*/
/**
* Constructs a new JavaSourceFromString.
* @param name the name of the compilation unit represented by this file object
* @param code the source code for the compilation unit represented by this file object
*/
}
return code;
}
}
}