ICompiler.
| Modifier and Type | Class and Description |
|---|---|
| private class | Compiler.CompilerIClassLoader
A specialized
|
| Modifier and Type | Field and Description |
|---|---|
| private Benchmark | |
| public static final StringPattern[] | DEFAULT_WARNING_HANDLE_PATTERNS
The default value for the warningHandlerPatterns parameter of |
| private IClassLoader | |
| private static final Logger | |
| private EnumSet | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Compiler(ResourceFinder sourceFinder, IClassLoader parentIClassLoader)
Deprecated
Use
Compiler() and the various configuration setters instead
|
| public | Compiler(final File[] sourcePath, final File[] classPath, final File[] extDirs, final File[] bootClassPath, final File destinationDirectory, final String characterEncoding, boolean verbose, boolean debugSource, boolean debugLines, boolean debugVars, StringPattern[] warningHandlePatterns, boolean rebuild)
Deprecated
Use
Compiler() and the various configuration setters instead
|
| Modifier and Type | Method and Description |
|---|---|
| public void | compile(Resource[]
Contain the compilation units to compile sourceResources)Implements org. compile(File[]).
|
| private void | |
| public static File | getClassFile(String
E.g. className, File "pkg1.pkg2.Outer$Inner"E.g. sourceFile, File "srcdir/Outer.java"E.g. destinationDirectory)"destdir"Constructs the name of a file that could store the byte code of the class with the given name. |
| private IClassLoader | Returns: Loads "auxiliary classes", either through theIClassLoader that was explicitly set with
setIClassLoader(IClassLoader), or otherwise from setBootClassPath(File[]), setExtensionDirectories(File[]) and setClassPath(File[])
|
| private static <T> T[] | |
| public EnumSet | Returns: A reference to the currently effective compilation options; changes to it take effect immediately
|
| public Compiler | |
| private Java. | Returns: the parsed compilation unitReads one compilation unit from a file and parses it. |
| public void | setIClassLoader(IClassLoader iClassLoader)
Explicitly sets the |
| public void | setVerbose(boolean verbose)
Implements org. -verbose.
|
| public void | storeClassFile(ClassFile classFile, final File
Required to compute class file path if no destination directory given sourceFile)Stores the byte code of this |
| benchmark | back to summary |
|---|---|
| private Benchmark benchmark | |
| DEFAULT_WARNING_HANDLE_PATTERNS | back to summary |
|---|---|
| public static final StringPattern[] DEFAULT_WARNING_HANDLE_PATTERNS The default value for the warningHandlerPatterns parameter of | |
| iClassLoader | back to summary |
|---|---|
| private IClassLoader iClassLoader
| |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| options | back to summary |
|---|---|
| private EnumSet<JaninoOption> options | |
| parsedCompilationUnits | back to summary |
|---|---|
| private final List<UnitCompiler> parsedCompilationUnits | |
| Compiler | back to summary |
|---|---|
| public Compiler() Initializes a new compiler. | |
| Compiler | back to summary |
|---|---|
| public Compiler(ResourceFinder sourceFinder, IClassLoader parentIClassLoader)
Deprecated Use
| |
| Compiler | back to summary |
|---|---|
| public Compiler(final File[] sourcePath, final File[] classPath, final File[] extDirs, final File[] bootClassPath, final File destinationDirectory, final String characterEncoding, boolean verbose, boolean debugSource, boolean debugLines, boolean debugVars, StringPattern[] warningHandlePatterns, boolean rebuild)
Deprecated Use
| |
| compile | back to summary |
|---|---|
| public void compile(Resource[] sourceResources) throws CompileException, IOException Implements org. Doc from org. See | |
| compile2 | back to summary |
|---|---|
| private void compile2(Resource[] sourceResources) throws CompileException, IOException | |
| getClassFile | back to summary |
|---|---|
| public static File getClassFile(String className, File sourceFile, File destinationDirectory) Constructs the name of a file that could store the byte code of the class with the given name.
If destinationDirectory is non- If destinationDirectory is null, the returned path is the directory of the sourceFile plus the class name plus ".class". Example: "srcdir/Outer$Inner.class" | |
| getIClassLoader | back to summary |
|---|---|
private IClassLoader getIClassLoader()
| |
| nullToEmptyArray | back to summary |
|---|---|
private static <T> T[] nullToEmptyArray(T[] a, Class<T> elementType)
| |
| options | back to summary |
|---|---|
public EnumSet
| |
| options | back to summary |
|---|---|
| public Compiler options(EnumSet<JaninoOption> options) Sets the options for all future compilations. | |
| parseAbstractCompilationUnit | back to summary |
|---|---|
| private Java. Reads one compilation unit from a file and parses it. The inputStream is closed before the method returns.
| |
| setIClassLoader | back to summary |
|---|---|
| public void setIClassLoader(IClassLoader iClassLoader) Explicitly sets the | |
| setVerbose | back to summary |
|---|---|
| public void setVerbose(boolean verbose) Implements org. Doc from org. Equivalent of
| |
| storeClassFile | back to summary |
|---|---|
| public void storeClassFile(ClassFile classFile, final File sourceFile) throws IOException Stores the byte code of this
| |
IClassLoader that loads IClasses from the following sources:
Notice that the CompilerIClassLoader is an inner class of Compiler and heavily uses Compiler's members.
| Modifier and Type | Field and Description |
|---|---|
| private final ResourceFinder | |
| private final ResourceFinder |
| Access | Constructor and Description |
|---|---|
| pack-priv | CompilerIClassLoader(ResourceFinder
Where to look for more source files sourceFinder, ResourceFinder Where to look for previously generated .class resources, or classFileFinder, IClassLoader FIND_NEXT_TO_SOURCE_FILEIClassLoader through which IClasses are to be loaded
|
| Modifier and Type | Method and Description |
|---|---|
| private IClass | defineIClassFromClassFileResource(Resource classFileResource)
Opens the given classFileResource, reads its contents, defines it in the |
| private IClass | defineIClassFromSourceResource(Resource sourceResource, String className)
Parses the compilation unit stored in the given sourceResource, remembers it in |
| protected IClass | Returns: null if a the type could not be foundfield descriptor of the type)IClass to load, e.g. "Lpkg1/pkg2/Outer$Inner;"Implements abstract org. IClass by descriptor and calls defineIClass(IClass).
|
| classFileFinder | back to summary |
|---|---|
| private final ResourceFinder classFileFinder
| |
| sourceFinder | back to summary |
|---|---|
| private final ResourceFinder sourceFinder | |
| CompilerIClassLoader | back to summary |
|---|---|
pack-priv CompilerIClassLoader(ResourceFinder sourceFinder, ResourceFinder classFileFinder, IClassLoader parentIClassLoader)
| |
| defineIClassFromClassFileResource | back to summary |
|---|---|
| private IClass defineIClassFromClassFileResource(Resource classFileResource) throws ClassNotFoundException Opens the given classFileResource, reads its contents, defines it in the | |
| defineIClassFromSourceResource | back to summary |
|---|---|
| private IClass defineIClassFromSourceResource(Resource sourceResource, String className) throws ClassNotFoundException Parses the compilation unit stored in the given sourceResource, remembers it in Notice that the compilation unit is not compiled here! | |
| findIClass | back to summary |
|---|---|
| protected IClass findIClass(final String type) throws ClassNotFoundException Implements abstract org. Doc from org. Finds a new
Similar
The format of a
Notice that this method is never called for array types. Notice that this method is never called from more than one thread at a time. In other words, implementations of this method need not be thread-safe. | |