public class SourceCompiler extends Object
Constructor and Description |
---|
SourceCompiler() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getClass(String packageAndClassName)
Get the class object for the given name.
|
CompiledScript |
getCompiledScript(String packageAndClassName)
Get the compiled script.
|
Method |
getMethod(String className)
Get the first public static method of the given class.
|
static boolean |
isJavaxScriptSource(String source)
Whether the passed source can be compiled using
ScriptEngineManager . |
void |
setJavaSystemCompiler(boolean enabled)
Enable or disable the usage of the Java system compiler.
|
void |
setSource(String className,
String source)
Set the source code for the specified class.
|
public void setSource(String className, String source)
className
- the class namesource
- the source codepublic void setJavaSystemCompiler(boolean enabled)
enabled
- true to enablepublic Class<?> getClass(String packageAndClassName) throws ClassNotFoundException
packageAndClassName
- the class nameClassNotFoundException
public static boolean isJavaxScriptSource(String source)
ScriptEngineManager
.source
- the source to test.true
if getCompiledScript(String)
can be called.public CompiledScript getCompiledScript(String packageAndClassName) throws ScriptException
packageAndClassName
- the package and class nameScriptException
public Method getMethod(String className) throws ClassNotFoundException
className
- the class nameClassNotFoundException
Copyright © 2020 JBoss by Red Hat. All rights reserved.