Klasse RtCompiler
java.lang.Object
com.github.hypfvieh.java.rtcompiler.BaseCompiler
com.github.hypfvieh.java.rtcompiler.RtCompiler
Helper class to compile java sources.
- Seit:
- 1.0.0 - 2024-01-25
- Autor:
- hypfvieh
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungCompiles the given source files and writes compilation result to target directory ifcompileToMemory
is false.Returns the classloader containing the results of the lastcompile(File, File...)
call.void
setClasspath
(File[] _classPath) Set the classpath.void
setCompileToMemory
(boolean _compileToMemory) Toggle compiling to memory.void
setDebuggingInformation
(boolean _debugSource, boolean _debugLines, boolean _debugVars) Determines what kind of debugging information is included in the generates classes.Von Klasse geerbte Methoden com.github.hypfvieh.java.rtcompiler.BaseCompiler
compile, compile, getClassFileLocator, getClassPath, getCompileErrors, getCompilerLogs, getCompilerOptions, getMissingSymbols, getSourceLocator, isDebugLines, isDebugSource, isDebugVars, setClassFileCreator, setClassFileLocator, setClassPath, setCompilerOptions, setDebugLines, setDebugSource, setDebugVars, setSourceLocator
-
Konstruktordetails
-
RtCompiler
public RtCompiler()Creates a new compiler.
-
-
Methodendetails
-
setDebuggingInformation
public void setDebuggingInformation(boolean _debugSource, boolean _debugLines, boolean _debugVars) Determines what kind of debugging information is included in the generates classes.- Parameter:
_debugSource
- source name_debugLines
- line information_debugVars
- variable information
-
setCompileToMemory
public void setCompileToMemory(boolean _compileToMemory) Toggle compiling to memory. Per default, compiling to memory is true as long as the process is not running in a debugger.- Parameter:
_compileToMemory
- true to enable compile to memory, false to disable
-
setClasspath
Set the classpath. Setting null resets the classpath to its default.- Parameter:
_classPath
- new class path
-
compile
public Set<String> compile(File _outputClassDir, File... _sourceFiles) throws CompileException, IOException Compiles the given source files and writes compilation result to target directory ifcompileToMemory
is false.- Parameter:
_outputClassDir
- output directory_sourceFiles
- source files to read- Gibt zurück:
- Set of FQCN created by the compiler
- Löst aus:
CompileException
- when compilation failsIOException
- when reading source file fails
-
getClassLoader
Returns the classloader containing the results of the lastcompile(File, File...)
call.- Gibt zurück:
ClassLoader
, maybe null
-