public class InMemoryJavaCompiler extends Object
| Modifier and Type | Method and Description |
|---|---|
InMemoryJavaCompiler |
addSource(String className,
String sourceCode)
Add source code to the compiler
|
Class<?> |
compile(String className,
String sourceCode)
Compile single source
|
Map<String,Class<?>> |
compileAll()
Compile all sources
|
ClassLoader |
getClassloader() |
InMemoryJavaCompiler |
ignoreWarnings()
Ignore non-critical compiler output, like unchecked/unsafe operation
warnings.
|
static InMemoryJavaCompiler |
newInstance() |
InMemoryJavaCompiler |
useOptions(String... options)
Options used by the compiler, e.g.
|
InMemoryJavaCompiler |
useParentClassLoader(ClassLoader parent) |
public static InMemoryJavaCompiler newInstance()
public InMemoryJavaCompiler useParentClassLoader(ClassLoader parent)
public ClassLoader getClassloader()
public InMemoryJavaCompiler useOptions(String... options)
options - public InMemoryJavaCompiler ignoreWarnings()
public Map<String,Class<?>> compileAll() throws Exception
Exceptionpublic Class<?> compile(String className, String sourceCode) throws Exception
className - sourceCode - Exceptionpublic InMemoryJavaCompiler addSource(String className, String sourceCode) throws Exception
className - sourceCode - Exception#compileAll()}Copyright © 2017. All rights reserved.