1 Compiler

Class Ax.java.Compiler


Java in memory compiler This class allows to dynamically install a Java class in classloader

Constructor Summary

MethodDescription
JSCompiler()Creates a new java compiler instance.

Method Summary

Modifier and TypeMethodDescription
String compile(String className, String code)Compiles the specified class, whose implementation is in the code parameter.
ArrayList getDiagnostics()Returns the compilation diagnostics.
String getError()Returns the compilation error, pr null if the compilation did not have any error.
boolean isCompiled()Checks if the compilation was successful.

Method Detail

JSCompiler

 JSCompiler()
Info:
Creates a new java compiler instance.

compile

                        String compile(String className, String code)
Info:
Compiles the specified class, whose implementation is in the code parameter.
Parameters:
className - name of the class to compile
code - code implementing the class
Returns:
The output from the compiler, or Class

getDiagnostics

                        ArrayList getDiagnostics()
Info:
Returns the compilation diagnostics.
Returns:
thecompilation diagnostics

getError

                        String getError()
Info:
Returns the compilation error, pr null if the compilation did not have any error.
Returns:
the compilation error, or null if no error

isCompiled

boolean isCompiled()
Info:
Checks if the compilation was successful.
Returns:
true if the compilation wass successful, false otherwise