|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.janino.Compiler
A simplified substitute for the javac tool. Usage:
java net.janino.Compiler \ [ -d destination-dir ] \ [ -sourcepath dirlist ] \ [ -classpath dirlist ] \ [ -extdirs dirlist ] \ [ -bootclasspath dirlist ] \ [ -encoding encoding ] \ [ -verbose ] \ source-file ... java net.janino.Compiler -help
Inner Class Summary | |
static class |
Compiler.NoClassLoader
A ClassLoader that never loads any class. |
Constructor Summary | |
Compiler(java.io.File[] optionalSourcePath,
java.io.File[] classPath,
java.io.File[] optionalExtDirs,
java.io.File[] optionalBootClassPath,
java.io.File optionalDestinationDirectory,
java.lang.String optionalCharacterEncoding,
boolean verbose,
int debuggingInformation)
Initialize a JavaTM compiler with the given parameters. |
Method Summary | |
void |
compile(java.io.File[] sourceFiles)
Compiles a set of JavaTM compilation units (a.k.a. |
static java.io.File |
getClassFile(java.lang.String className,
java.io.File sourceFile,
java.io.File optionalDestinationDirectory)
Construct the name of a file that could store the byte code of the class with the given name. |
static void |
main(java.lang.String[] args)
Command line interface. |
static java.io.File[] |
parsePath(java.lang.String s)
Break a given string up by a "separator" string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Compiler(java.io.File[] optionalSourcePath, java.io.File[] classPath, java.io.File[] optionalExtDirs, java.io.File[] optionalBootClassPath, java.io.File optionalDestinationDirectory, java.lang.String optionalCharacterEncoding, boolean verbose, int debuggingInformation)
Classes are searched in the following order:
optionalBootClassPath
is null
:
optionalBootClassPath
is not null
:
optionalBootClassPath
optionalExtDirs
is not null
:
optionalExtDirs
classPath
optionalSourcePath
is null
:
classPath
optionalSourcePath
is not null
:
sourcePath
optionalSourcePath
- classPath
- optionalExtDirs
- optionalBootClassPath
- optionalDestinationDirectory
- optionalCharacterEncoding
- verbose
- Method Detail |
public static void main(java.lang.String[] args)
public void compile(java.io.File[] sourceFiles) throws Scanner.ScanException, Parser.ParseException, Java.CompileException, java.io.IOException
For example, if the source path comprises the directories "A/B" and "../C", then the source file for class "com.acme.Main" is searched in
compile(File[])
or if you invoke compile(File[])
multiply:
In the former case, the source files may contain arbitrary references among each
other (even circular ones). In the latter case, only the source files on the source
path may contain circular references, not the sourceFileNames
.sourceFileNames
- Source file path namespublic static java.io.File[] parsePath(java.lang.String s)
Examples:
public static java.io.File getClassFile(java.lang.String className, java.io.File sourceFile, java.io.File optionalDestinationDirectory)
If optionalDestinationDirectory
is non-null, the returned path is the
optionalDestinationDirectory
plus the package of the class (with dots replaced
with file separators) plus the class name plus ".class". Example:
"destdir/pkg1/pkg2/Outer$Inner.class"
If optionalDestinationDirectory
is null, the returned path is the
directory of the sourceFile
plus the class name plus ".class". Example:
"srcdir/Outer$Inner.class"
className
- E.g. "pkg1.pkg2.Outer$Inner"sourceFile
- E.g. "srcdir/Outer.java"optionalDestinationDirectory
- E.g. "destdir"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |