SimpleCompiler object, proceed as described for ISimpleCompiler. Alternatively, a number
of "convenience constructors" exist that execute the described steps instantly.
| Modifier and Type | Field and Description |
|---|---|
| private Collection | classFiles
|
| private ClassLoaderIClassLoader | |
| private ErrorHandler | |
| private boolean | |
| private boolean | |
| private boolean | |
| private static final boolean | |
| private Map | |
| private ClassLoader | |
| private static final Logger | |
| private EnumSet | |
| private ClassLoader | |
| private int | |
| private int | |
| private WarningHandler |
| Access | Constructor and Description |
|---|---|
| public | SimpleCompiler(String fileName, Reader in)
Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName, in);
|
| public | SimpleCompiler(String fileName, InputStream is)
Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName, is);
|
| public | SimpleCompiler(String fileName)
Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName);
|
| public | SimpleCompiler(Scanner scanner, ClassLoader parentClassLoader)
Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.setParentClassLoader(parentClassLoader);
sc.cook(scanner);
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Collection | |
| private void | |
| protected Java. | classesToTypes(Location location, Class<?>[] classes)
|
| protected Java. | classToType(final Location location, final Class<?> clazz)
|
| protected final ClassLoader | Returns: TheClassLoader into which the compiled classes were definedThe parsed compilation unit abstractCompilationUnitCompiles the given compilation unit. |
| public final void | cook(String
Used when reporting errors and warnings fileName, Reader r)Implements abstract org. Implements org. Reader.
|
| public void | |
| public void | |
| private void | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. SimpleCompilers are regarded equal iff
|
| public Map | |
| private Map | |
| public ClassFile[] | |
| public ClassLoader | getClassLoader()
Implements org. ClassLoader object through which the previously compiled classes can be accessed.
|
| private ClassLoader | |
| public int | |
| public static void | |
| protected Java. | optionalClassToType(final Location location, final Class<?> clazz)
|
| public EnumSet | Returns: A reference to the currently effective compilation options; changes to it take effect immediately
|
| public SimpleCompiler | |
| public void | setCompileErrorHandler(ErrorHandler
null to restore the default behavior (throwing a CompileException)Implements org. ErrorHandler which is invoked during compilation on each error.
|
| public void | setDebuggingInformation(boolean debugSource, boolean debugLines, boolean debugVars)
Implements org. |
| public void | setParentClassLoader(ClassLoader parentClassLoader)
Implements org. |
| public void | setSourceVersion(int version)
Implements org. Parser.
|
| public void | setTargetVersion(int version)
Implements org. UnitCompiler.
|
| public void | setWarningHandler(WarningHandler
null to indicate that no warnings be issuedImplements org. WarningHandler which is
invoked for each warning.
|
| classFiles | back to summary |
|---|---|
| private Collection<ClassFile> classFiles
| |
| classLoaderIClassLoader | back to summary |
|---|---|
| private ClassLoaderIClassLoader classLoaderIClassLoader
| |
| compileErrorHandler | back to summary |
|---|---|
| private ErrorHandler compileErrorHandler
| |
| debugLines | back to summary |
|---|---|
| private boolean debugLines | |
| debugSource | back to summary |
|---|---|
| private boolean debugSource | |
| debugVars | back to summary |
|---|---|
| private boolean debugVars | |
| disassembleClassFilesToStdout | back to summary |
|---|---|
| private static final boolean disassembleClassFilesToStdout | |
| getBytecodesCache | back to summary |
|---|---|
| private Map<String, byte[]> getBytecodesCache
| |
| getClassLoaderCache | back to summary |
|---|---|
| private ClassLoader getClassLoaderCache
| |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| options | back to summary |
|---|---|
| private EnumSet<JaninoOption> options | |
| parentClassLoader | back to summary |
|---|---|
| private ClassLoader parentClassLoader | |
| sourceVersion | back to summary |
|---|---|
| private int sourceVersion | |
| targetVersion | back to summary |
|---|---|
| private int targetVersion | |
| warningHandler | back to summary |
|---|---|
| private WarningHandler warningHandler
| |
| SimpleCompiler | back to summary |
|---|---|
| public SimpleCompiler(String fileName, Reader in) throws IOException, CompileException Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName, in);
| |
| SimpleCompiler | back to summary |
|---|---|
| public SimpleCompiler(String fileName, InputStream is) throws IOException, CompileException Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName, is);
| |
| SimpleCompiler | back to summary |
|---|---|
| public SimpleCompiler(String fileName) throws IOException, CompileException Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.cook(fileName);
| |
| SimpleCompiler | back to summary |
|---|---|
| public SimpleCompiler(Scanner scanner, ClassLoader parentClassLoader) throws IOException, CompileException Equivalent to
SimpleCompiler sc = new SimpleCompiler();
sc.setParentClassLoader(parentClassLoader);
sc.cook(scanner);
| |
| SimpleCompiler | back to summary |
|---|---|
| public SimpleCompiler() | |
| assertCooked | back to summary |
|---|---|
private Collection
| |
| assertUncooked | back to summary |
|---|---|
private void assertUncooked()
| |
| classesToTypes | back to summary |
|---|---|
| protected Java. | |
| classToType | back to summary |
|---|---|
| protected Java. | |
| compileToClassLoader | back to summary |
|---|---|
| protected final ClassLoader compileToClassLoader(Java. Compiles the given compilation unit. (A "compilation unit" is typically the contents of a Java source file.)
| |
| cook | back to summary |
|---|---|
| public final void cook(String fileName, Reader r) throws CompileException, IOException Implements abstract org. Implements org. Scans, parses and compiles a given compilation unit from the given
| |
| cook | back to summary |
|---|---|
| public void cook(Scanner scanner) throws CompileException, IOException Scans, parses and compiles a given compilation unit from the given scanner. After completion, | |
| cook | back to summary |
|---|---|
| public void cook(Java. Cooks this compilation unit directly. | |
| cook2 | back to summary |
|---|---|
| private void cook2(Scanner scanner) throws CompileException, IOException | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Two
| |
| getBytecodes | back to summary |
|---|---|
| public Map Implements org.
| |
| getBytecodes2 | back to summary |
|---|---|
| private Map | |
| getClassFiles | back to summary |
|---|---|
| public ClassFile[] getClassFiles() | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() Implements org. Doc from org. Returns a
This method must only be called after exactly one of the
| |
| getClassLoader2 | back to summary |
|---|---|
| private ClassLoader getClassLoader2() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| main | back to summary |
|---|---|
| public static void main(String[] args) throws Exception | |
| optionalClassToType | back to summary |
|---|---|
| protected Java. Wraps a reflection
| |
| options | back to summary |
|---|---|
public EnumSet
| |
| options | back to summary |
|---|---|
| public SimpleCompiler options(EnumSet<JaninoOption> options) Sets the options for all future compilations. | |
| setCompileErrorHandler | back to summary |
|---|---|
| public void setCompileErrorHandler(ErrorHandler compileErrorHandler) Implements org. Doc from org. Installs an
If the given
If the given
In other words: The
| |
| setDebuggingInformation | back to summary |
|---|---|
| public void setDebuggingInformation(boolean debugSource, boolean debugLines, boolean debugVars) Implements org. Doc from org. Determines what kind of debugging information is included in the generates classes. The default is typically
"
| |
| setParentClassLoader | back to summary | ||||||
|---|---|---|---|---|---|---|---|
| public void setParentClassLoader(ClassLoader parentClassLoader) Implements org. Doc from org. The "parent class loader" is used to load referenced classes. Useful values are:
The parent class loader defaults to the current thread's context class loader.
| |||||||
| setSourceVersion | back to summary |
|---|---|
| public void setSourceVersion(int version) Implements org. Controls the language elements that are accepted by the
| |
| setTargetVersion | back to summary |
|---|---|
| public void setTargetVersion(int version) Implements org. Controls the .class files that are generated by the
| |
| setWarningHandler | back to summary |
|---|---|
| public void setWarningHandler(WarningHandler warningHandler) Implements org. Doc from org. By default, warnings are discarded, but an application my install a custom
| |