| Package | Description |
|---|---|
| org.codehaus.commons.compiler |
This package declares interfaces for the implementation of an
IExpressionEvaluator, an IScriptEvaluator, an
IClassBodyEvaluator and an ISimpleCompiler. |
| org.codehaus.commons.compiler.util | |
| org.codehaus.commons.compiler.util.reflect | |
| org.codehaus.commons.compiler.util.resource |
Classes related to loading "resources" (
ResourceFinder) and
creating resources (ResourceCreator). |
| Modifier and Type | Field and Description |
|---|---|
static ResourceCreator |
ICompiler.CREATE_NEXT_TO_SOURCE_FILE
Special value for
ICompiler.setClassFileCreator(ResourceCreator): Indicates that .class resources are to be
created in the directory of the .java resource from which they are generated. |
static ResourceFinder |
ICompiler.FIND_NEXT_TO_SOURCE_FILE
Special value for
ICompiler.setClassFileFinder(ResourceFinder). |
static File |
ICompiler.NO_DESTINATION_DIRECTORY
Special value for
ICompiler.setDestinationDirectory(File)'s parameter: Indicates that .class files are to be
created in the directory of the .java file from which they are generated. |
protected AbstractJavaSourceClassLoader.ProtectionDomainFactory |
AbstractJavaSourceClassLoader.optionalProtectionDomainFactory |
| Modifier and Type | Method and Description |
|---|---|
Object |
IScriptEvaluator.evaluate(int idx,
Object[] arguments)
Same as
IScriptEvaluator.evaluate(Object[]), but for multiple scripts. |
Object |
IScriptEvaluator.evaluate(Object[] arguments)
Calls the script with concrete parameter values.
|
Object |
IExpressionEvaluator.evaluate(Object[] arguments)
Evaluates the expression with concrete parameter values.
|
String |
Location.getFileName() |
Location |
LocatedException.getLocation() |
| Modifier and Type | Method and Description |
|---|---|
void |
ICookable.cook(InputStream is,
String optionalEncoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
Cookable.cook(InputStream is,
String optionalEncoding) |
void |
IScriptEvaluator.cook(String[] optionalFileNames,
Reader[] readers)
Same as
ICookable.cook(String, Reader), but cooks a set of scripts into one class. |
void |
IScriptEvaluator.cook(String[] optionalFileNames,
String[] strings)
Same as
ICookable.cook(String, String), but for multiple scripts. |
void |
ICookable.cook(String optionalFileName,
InputStream is)
Reads, scans, parses and compiles Java tokens from the given
InputStream, encoded
in the "platform default encoding". |
void |
Cookable.cook(String optionalFileName,
InputStream is) |
void |
ICookable.cook(String optionalFileName,
InputStream is,
String optionalEncoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
ICookable.cook(String optionalFileName,
InputStream is,
String optionalEncoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
Cookable.cook(String optionalFileName,
InputStream is,
String optionalEncoding) |
void |
Cookable.cook(String optionalFileName,
InputStream is,
String optionalEncoding) |
void |
ICookable.cook(String optionalFileName,
Reader r)
Reads, scans, parses and compiles Java tokens from the given
Reader. |
void |
ICookable.cook(String optionalFileName,
String s)
Reads, scans, parses and compiles Java tokens from the given
String. |
void |
Cookable.cook(String optionalFileName,
String s) |
void |
ICookable.cookFile(File file,
String optionalEncoding)
Reads, scans, parses and compiles Java tokens from the given
File with the given encoding. |
void |
Cookable.cookFile(File file,
String optionalEncoding) |
void |
ICookable.cookFile(String fileName,
String optionalEncoding)
Reads, scans, parses and compiles Java tokens from the named file with the given optionalEncoding.
|
void |
Cookable.cookFile(String fileName,
String optionalEncoding) |
Object |
IScriptEvaluator.evaluate(int idx,
Object[] arguments)
Same as
IScriptEvaluator.evaluate(Object[]), but for multiple scripts. |
Object |
IScriptEvaluator.evaluate(Object[] arguments)
Calls the script with concrete parameter values.
|
Object |
IExpressionEvaluator.evaluate(Object[] arguments)
Evaluates the expression with concrete parameter values.
|
void |
ErrorHandler.handleError(String message,
Location optionalLocation)
May or may not choose to throw a
CompileException. |
void |
WarningHandler.handleWarning(String handle,
String message,
Location optionalLocation)
May or may not choose to throw a
CompileException. |
void |
WarningHandler.handleWarning(String handle,
String message,
Location optionalLocation)
May or may not choose to throw a
CompileException. |
void |
ICompiler.setCharacterEncoding(String characterEncoding) |
abstract void |
ICompiler.setClassFileCreator(ResourceCreator classFileCreator) |
abstract void |
ICompiler.setClassFileFinder(ResourceFinder resourceFinder)
This
ResourceFinder is used to check whether a .class resource already exists and is younger than the
.java resource from which it was generated. |
void |
ICookable.setCompileErrorHandler(ErrorHandler optionalCompileErrorHandler)
By default,
CompileExceptions are thrown on compile errors, but an application my install its own
ErrorHandler. |
abstract void |
ICompiler.setCompileErrorHandler(ErrorHandler errorHandler)
By default,
CompileExceptions are thrown on compile errors, but an application my install its own
ErrorHandler. |
void |
IClassBodyEvaluator.setDefaultImports(String... optionalDefaultImports)
"Default imports" add to the system import "java.lang", i.e. the evaluator may refer to classes imported by
default imports without having to explicitly declare IMPORT statements.
|
void |
ICompiler.setDestinationDirectory(File destinationDirectory)
Equivalent of
-d.
|
abstract void |
ICompiler.setEncoding(Charset encoding)
Equivalent of -encoding.
|
void |
IClassBodyEvaluator.setExtendedClass(Class<?> optionalExtendedClass)
Sets a particular superclass that the generated class will extend.
|
void |
IClassBodyEvaluator.setExtendedType(Class<?> optionalExtendedClass)
Deprecated.
Use
IClassBodyEvaluator.setExtendedClass(Class) instead |
void |
ICookable.setParentClassLoader(ClassLoader optionalParentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
AbstractJavaSourceClassLoader.setProtectionDomainFactory(AbstractJavaSourceClassLoader.ProtectionDomainFactory optionalProtectionDomainFactory) |
abstract void |
AbstractJavaSourceClassLoader.setSourceFileCharacterEncoding(String optionalCharacterEncoding) |
void |
ICookable.setWarningHandler(WarningHandler optionalWarningHandler)
By default, warnings are discarded, but an application my install a custom
WarningHandler. |
| Constructor and Description |
|---|
CompileException(String message,
Location optionalLocation) |
CompileException(String message,
Location optionalLocation,
Throwable cause) |
LocatedException(String message,
Location optionalLocation) |
LocatedException(String message,
Location optionalLocation,
Throwable optionalCause) |
LocatedException(String message,
Location optionalLocation,
Throwable optionalCause) |
Location(String optionalFileName,
int lineNumber,
int columnNumber) |
| Modifier and Type | Method and Description |
|---|---|
static File[] |
StringUtil.parseOptionalPath(String s)
|
| Modifier and Type | Method and Description |
|---|---|
static File[] |
StringUtil.parseOptionalPath(String s)
|
| Modifier and Type | Method and Description |
|---|---|
static <R,EX extends Throwable> |
Methods.invoke(Method method,
Object obj,
Object... args) |
| Modifier and Type | Method and Description |
|---|---|
abstract Resource |
ResourceFinder.findResource(String resourceName)
Finds a resource by name and return it as a
Resource object. |
Resource |
FileResourceFinder.findResource(String resourceName) |
protected abstract File |
FileResourceFinder.findResourceAsFile(String resourceName)
Converts a given resource resource name into a
File. |
protected File |
DirectoryResourceFinder.findResourceAsFile(String resourceName) |
InputStream |
ResourceFinder.findResourceAsStream(String resourceName)
Finds a resource by name and open it for reading.
|
Copyright © 2020. All rights reserved.