| 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.lang | |
| org.codehaus.commons.compiler.util |
Utility functionality for this project.
|
| org.codehaus.commons.compiler.util.iterator | |
| org.codehaus.commons.compiler.util.reflect |
Utility functionality related to
java.util.reflect. |
| org.codehaus.commons.compiler.util.resource |
Classes related to loading "resources" (
ResourceFinder) and
creating resources (ResourceCreator). |
| Modifier and Type | Field and Description |
|---|---|
protected File[] |
AbstractCompiler.bootClassPath
This is always non-
null for JVMs that support BOOTCLASSPATH (1.0-1.8), and
this is always null for JVMs that don't (9+). |
protected ErrorHandler |
AbstractCompiler.compileErrorHandler
Stores the value configured with
AbstractCompiler.setCompileErrorHandler(ErrorHandler). |
static File |
ICompiler.NO_DESTINATION_DIRECTORY
Special value for
ICompiler.setDestinationDirectory(File, boolean)'s first 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.protectionDomainFactory |
protected WarningHandler |
AbstractCompiler.warningHandler
Stores the value configured with
AbstractCompiler.setWarningHandler(WarningHandler). |
| Modifier and Type | Method and Description |
|---|---|
Object |
IExpressionEvaluator.evaluate(int idx,
Object... arguments)
Null arguments is equivalent with new Object[0]. |
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 encoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
Cookable.cook(InputStream is,
String encoding) |
void |
ICookable.cook(String fileName,
InputStream is)
Reads, scans, parses and compiles Java tokens from the given
InputStream, encoded
in the "platform default encoding". |
void |
Cookable.cook(String fileName,
InputStream is) |
void |
ICookable.cook(String fileName,
InputStream is,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
ICookable.cook(String fileName,
InputStream is,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
Cookable.cook(String fileName,
InputStream is,
String encoding) |
void |
Cookable.cook(String fileName,
InputStream is,
String encoding) |
void |
ICookable.cook(String fileName,
Reader r)
Reads, scans, parses and compiles Java tokens from the given
Reader. |
abstract void |
Cookable.cook(String fileName,
Reader reader) |
void |
ICookable.cook(String fileName,
String s)
Reads, scans, parses and compiles Java tokens from the given
String. |
void |
Cookable.cook(String fileName,
String s) |
void |
ICookable.cookFile(File file,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
File with the given encoding. |
void |
Cookable.cookFile(File file,
String encoding) |
void |
ICookable.cookFile(String fileName,
String encoding)
Reads, scans, parses and compiles Java tokens from the named file with the given encoding.
|
void |
Cookable.cookFile(String fileName,
String encoding) |
Object |
IExpressionEvaluator.evaluate(int idx,
Object... arguments)
Null arguments is equivalent with new Object[0]. |
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 location)
May or may not choose to throw a
CompileException. |
void |
WarningHandler.handleWarning(String handle,
String message,
Location location)
May or may not choose to throw a
CompileException. |
void |
WarningHandler.handleWarning(String handle,
String message,
Location location)
May or may not choose to throw a
CompileException. |
void |
ICompiler.setCharacterEncoding(String characterEncoding)
Deprecated.
Use
ICompiler.setSourceCharset(Charset) instead |
void |
AbstractCompiler.setCharacterEncoding(String characterEncoding) |
void |
ISimpleCompiler.setCompileErrorHandler(ErrorHandler compileErrorHandler)
Installs an
ErrorHandler which is invoked during compilation on each error. |
void |
IScriptEvaluator.setCompileErrorHandler(ErrorHandler compileErrorHandler)
Installs an
ErrorHandler which is invoked during compilation on each error. |
void |
IExpressionEvaluator.setCompileErrorHandler(ErrorHandler compileErrorHandler)
Installs an
ErrorHandler which is invoked during compilation on each error. |
void |
ICompiler.setCompileErrorHandler(ErrorHandler errorHandler)
Installs an
ErrorHandler which is invoked during compilation on each error. |
void |
IClassBodyEvaluator.setCompileErrorHandler(ErrorHandler compileErrorHandler)
Installs an
ErrorHandler which is invoked during compilation on each error. |
void |
AbstractCompiler.setCompileErrorHandler(ErrorHandler compileErrorHandler) |
void |
ICompiler.setDestinationDirectory(File destinationDirectory,
boolean rebuild)
Equivalent of
-d and
-rebuild. |
void |
AbstractCompiler.setDestinationDirectory(File destinationDirectory,
boolean rebuild) |
void |
IClassBodyEvaluator.setExtendedClass(Class<?> extendedClass)
Sets a particular superclass that the generated class will extend.
|
void |
IClassBodyEvaluator.setExtendedType(Class<?> extendedClass)
Deprecated.
Use
IClassBodyEvaluator.setExtendedClass(Class) instead |
void |
IScriptEvaluator.setMethodName(String methodName)
Defines the name of the generated method.
|
void |
ISimpleCompiler.setParentClassLoader(ClassLoader parentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
IScriptEvaluator.setParentClassLoader(ClassLoader parentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
IExpressionEvaluator.setParentClassLoader(ClassLoader parentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
IClassBodyEvaluator.setParentClassLoader(ClassLoader parentClassLoader)
The "parent class loader" is used to load referenced classes.
|
void |
AbstractJavaSourceClassLoader.setProtectionDomainFactory(AbstractJavaSourceClassLoader.ProtectionDomainFactory protectionDomainFactory) |
void |
AbstractJavaSourceClassLoader.setSourceFileCharacterEncoding(String charsetName) |
void |
ISimpleCompiler.setWarningHandler(WarningHandler warningHandler)
By default, warnings are discarded, but an application my install a custom
WarningHandler which is
invoked for each warning. |
void |
IScriptEvaluator.setWarningHandler(WarningHandler warningHandler)
By default, warnings are discarded, but an application my install a custom
WarningHandler. |
void |
IExpressionEvaluator.setWarningHandler(WarningHandler warningHandler)
By default, warnings are discarded, but an application my install a custom
WarningHandler. |
void |
IClassBodyEvaluator.setWarningHandler(WarningHandler warningHandler)
By default, warnings are discarded, but an application my install a custom
WarningHandler. |
void |
AbstractCompiler.setWarningHandler(WarningHandler warningHandler) |
| Constructor and Description |
|---|
CompileException(String message,
Location location)
An infix
"NYI" in the message string indicates that the compiler has a known limitation here. |
CompileException(String message,
Location location,
Throwable cause)
An infix
"NYI" in the message string indicates that the compiler has a known limitation here. |
InternalCompilerException(Location location,
String message) |
InternalCompilerException(Location location,
String message) |
InternalCompilerException(Location location,
String message,
Throwable t) |
InternalCompilerException(Location location,
String message,
Throwable t) |
InternalCompilerException(String message) |
InternalCompilerException(String message,
Throwable t) |
LocatedException(String message,
Location location) |
LocatedException(String message,
Location location,
Throwable cause) |
LocatedException(String message,
Location location,
Throwable cause) |
Location(String fileName,
int lineNumber,
int columnNumber) |
| Modifier and Type | Method and Description |
|---|---|
static ClassLoader |
ClassLoaders.getsResourceAsStream(ResourceFinder finder,
ClassLoader parent)
Creates and returns a
ClassLoader that implements ClassLoader.getResourceAsStream(String) via a
ResourceFinder. |
static Map<String,URL> |
ClassLoaders.getSubresources(ClassLoader classLoader,
String name,
boolean includeDirectories,
boolean recurse)
Returns a name-to-URL mapping of all resources "under" a given directory name.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
SystemProperties.getClassProperty(Class<?> targetClass,
String classPropertyName) |
static String |
SystemProperties.getClassProperty(Class<?> targetClass,
String classPropertyName,
String defaultValue)
Gets the value of a "class property".
|
static File[] |
StringUtil.parseOptionalPath(String s)
|
T |
Producer.produce()
Produces the next object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Predicate.evaluate(T subject) |
protected Class<?> |
ResourceFinderClassLoader.findClass(String className) |
static String |
SystemProperties.getClassProperty(Class<?> targetClass,
String classPropertyName,
String defaultValue)
Gets the value of a "class property".
|
static File[] |
StringUtil.parseOptionalPath(String s)
|
static int |
Numbers.parseUnsignedInt(String s,
int radix)
Counterpart of
Integer.parseInt(String, int) for parsing unsigned integers. |
static long |
Numbers.parseUnsignedLong(String s,
int radix)
Counterpart of
Long.parseLong(String, int) for parsing unsigned integers. |
void |
Benchmark.report(String title,
Object o)
Reports the
title, a colon, a space, and the pretty-printed Object. |
void |
Benchmark.report(String title,
Object o)
Reports the
title, a colon, a space, and the pretty-printed Object. |
| Constructor and Description |
|---|
StringPattern(String pattern) |
| Modifier and Type | Method and Description |
|---|---|
void |
FilterListIterator.add(T o)
Calls
FilterListIterator.delegate. |
void |
FilterListIterator.set(T o)
Calls
FilterListIterator.delegate. |
| Modifier and Type | Method and Description |
|---|---|
protected Class<?> |
ByteArrayClassLoader.findClass(String name)
Implements
ClassLoader.findClass(String). |
static <R,EX extends Throwable> |
Methods.invoke(Method method,
Object obj,
Object... args)
A wrapper for {@link Method#invoke(Object, Object...)
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
MapResourceFinder.addResource(String fileName,
byte[] data)
Adds another
Resource, so that it can later be found with MapResourceFinder.findResource(String), ResourceFinder.findResourceAsStream(String) and MapResourceFinder.resources(). |
Resource |
MapResourceFinder.addResource(String fileName,
String data) |
Resource |
ZipFileResourceFinder.findResource(String resourceName) |
abstract Resource |
ResourceFinder.findResource(String resourceName)
Finds a resource by name and return it as a
Resource object. |
Resource |
MultiResourceFinder.findResource(String resourceName) |
Resource |
MapResourceFinder.findResource(String resourceName) |
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.
|
Iterable<Resource> |
MultiResourceFinder.list(String resourceNamePrefix,
boolean recurse) |
Iterable<Resource> |
MapResourceFinder.list(String resourceNamePrefix,
boolean recurse) |
abstract Iterable<Resource> |
ListableResourceFinder.list(String resourceNamePrefix,
boolean recurse)
Returns all resources who's names start with a given string.
|
Iterable<Resource> |
DirectoryResourceFinder.list(String resourceNamePrefix,
boolean recurse) |
Copyright © 2022. All rights reserved.