public interface ICookable
IClassBodyEvaluator, then the tokens are interpreted as a Java class body and compiled into a Class which
is accessible through IClassBodyEvaluator.getClazz().| Modifier and Type | Method and Description |
|---|---|
void |
cook(InputStream is)
Reads, scans, parses and compiles Java tokens from the given
InputStream, encoded
in the "platform default encoding". |
void |
cook(InputStream is,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
cook(Reader r)
Reads, scans, parses and compiles Java tokens from the given
Reader. |
void |
cook(String s)
Reads, scans, parses and compiles Java tokens from the given
String. |
void |
cook(String fileName,
InputStream is)
Reads, scans, parses and compiles Java tokens from the given
InputStream, encoded
in the "platform default encoding". |
void |
cook(String fileName,
InputStream is,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
InputStream with the given encoding. |
void |
cook(String fileName,
Reader r)
Reads, scans, parses and compiles Java tokens from the given
Reader. |
void |
cook(String fileName,
String s)
Reads, scans, parses and compiles Java tokens from the given
String. |
void |
cookFile(File file)
Reads, scans, parses and compiles Java tokens from the given
File, encoded in the "platform default
encoding". |
void |
cookFile(File file,
String encoding)
Reads, scans, parses and compiles Java tokens from the given
File with the given encoding. |
void |
cookFile(String fileName)
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".
|
void |
cookFile(String fileName,
String encoding)
Reads, scans, parses and compiles Java tokens from the named file with the given encoding.
|
Map<String,byte[]> |
getBytecodes() |
void |
setSourceVersion(int version)
Specifies the version of source code accepted, in analogy with JAVAC's
-source command line option. |
void |
setTargetVersion(int version)
Generates class files that target a specified release of the virtual machine, in analogy with JAVAC's
-target command line option. |
void cook(@Nullable String fileName, Reader r) throws CompileException, IOException
Reader.fileName - Used when reporting errors and warningsCompileExceptionIOExceptionvoid cook(Reader r) throws CompileException, IOException
Reader.CompileExceptionIOExceptionvoid cook(InputStream is) throws CompileException, IOException
InputStream, encoded
in the "platform default encoding".CompileExceptionIOExceptionvoid cook(@Nullable String fileName, InputStream is) throws CompileException, IOException
InputStream, encoded
in the "platform default encoding".fileName - Used when reporting errors and warningsCompileExceptionIOExceptionvoid cook(InputStream is, @Nullable String encoding) throws CompileException, IOException
InputStream with the given encoding.CompileExceptionIOExceptionvoid cook(@Nullable String fileName, InputStream is, @Nullable String encoding) throws CompileException, IOException
InputStream with the given encoding.fileName - Used when reporting errors and warningsCompileExceptionIOExceptionvoid cook(String s) throws CompileException
String.CompileExceptionvoid cook(@Nullable String fileName, String s) throws CompileException
String.fileName - Used when reporting errors and warningsCompileExceptionvoid cookFile(File file) throws CompileException, IOException
File, encoded in the "platform default
encoding".CompileExceptionIOExceptionvoid cookFile(File file, @Nullable String encoding) throws CompileException, IOException
File with the given encoding.CompileExceptionIOExceptionvoid cookFile(String fileName) throws CompileException, IOException
CompileExceptionIOExceptionvoid cookFile(String fileName, @Nullable String encoding) throws CompileException, IOException
CompileExceptionIOExceptionvoid setSourceVersion(int version)
-source command line option.
May be ignored by an implementation (e.g. the janino implementation always accepts the language features
as described on the home page).
Allowed values, and the default value, depend on the implementation.
-1 means to use a default version.void setTargetVersion(int version)
-target command line option.
Allowed values depend on the implementation.
The default value also depends on the implementation.
The only invariant is that the generated class files are suitable for the currently executing JVM.
-1 means to use a default version.Map<String,byte[]> getBytecodes()
IllegalStateException - This IClassBodyEvaluator is not yet cookedCopyright © 2023. All rights reserved.