# Package org.codehaus.commons.compiler

package org.codehaus.commons.compiler
This package declares interfaces for the implementation of an `IExpressionEvaluator`, an `IScriptEvaluator`, an `IClassBodyEvaluator` and an `ISimpleCompiler`. All of these adhere to the syntax of the Java programming language.

There are (at least) two implementations of these interfaces available:

- `org.codehaus.janino`: A lightweight, stand-alone implementation that implements Java 1.4 and most of Java 5. Runs on all JREs starting at version 1.3.
- `org.codehaus.commons.compiler.jdk`: Uses the `javax.tools.JavaCompiler` API that is available since Java 1.6. Requires a JDK (not just a JRE).

Notice: Implementations may or may not be prone to "Java injection", i.e. it may or may not be possible to, e.g., break out of the "expression" scope of an `IExpressionEvaluator` by providing a "bogus" expression text. The documentation of each implementation should state clearly whether or not it is prone to Java injection.

Related Packages
Package
Description
org.codehaus.commons.compiler.io
org.codehaus.commons.compiler.jdk
An implementation of the `org.codehaus.commons.compiler` API that uses the "JAVAC" Java compiler that is part of the "Java Development Kit" (JDK).
org.codehaus.commons.compiler.lang
org.codehaus.commons.compiler.samples
Sample applications for the Janino Java compiler.
org.codehaus.commons.compiler.util
Utility functionality for this project.
Class
Description
AbstractCompiler
A base class and wrapper for
invalid reference

    Compiler

that implements all redundant API methods.
AbstractCompilerFactory
Base class for a simple `ICompilerFactory`.
AbstractJavaSourceClassLoader
A `ClassLoader` that, unlike usual `ClassLoader`s, does not load byte code, but reads Java source code and then scans, parses, compiles and loads it into the virtual machine.
AbstractJavaSourceClassLoader.ProtectionDomainFactory
CompileException
Representation of an error condition during compilation.
CompilerFactoryFactory
Utility class that finds implementations of `ICompilerFactory`s.
Cookable
Base class for a simple `ICookable`.
ErrorHandler
Processes an error issued by the compiler.
IClassBodyEvaluator
Parses a class body and returns it as a `Class` object ready for use with `java.lang.reflect`.
ICompiler
A simplified substitute for the `javac` tool.
ICompilerFactory
An entity that produces implementations of `IExpressionEvaluator`, `IScriptEvaluator`, `IClassBodyEvaluator`, `ISimpleCompiler` or `AbstractJavaSourceClassLoader`.
ICookable
An entity that processes a sequence of characters (a "document").
IExpressionEvaluator
An engine that evaluates expressions in JVM bytecode.
IMultiCookable
InternalCompilerException
Indicates an event that is probably related to a bug in JANINO.
IScriptEvaluator
An engine that executes a script in JVM bytecode.
ISimpleCompiler
A simplified Java compiler that can compile only a single compilation unit.
LocatedException
An `Exception` that is associated with an optional `Location` in a source file.
Location
Immutable representation of the location of a character in a document, as defined by an (optional) file name, a line number and a column number.
MultiCookable
Implements all methods of `IMultiCookable`, except for `IMultiCookable.cook(String[], Reader[])`.
Sandbox
Executes a `PrivilegedAction` or `PrivilegedExceptionAction` in a context with restricted permissions.
WarningHandler
Processes a warning issued by the compiler.