Package net.openhft.compiler
Class CachedCompiler
- java.lang.Object
-
- net.openhft.compiler.CachedCompiler
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class CachedCompiler extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private @Nullable java.io.FileclassDirprivate static java.util.List<java.lang.String>DEFAULT_OPTIONSprivate static java.io.PrintWriterDEFAULT_WRITERprivate java.util.Map<java.lang.ClassLoader,MyJavaFileManager>fileManagerMapprivate java.util.concurrent.ConcurrentMap<java.lang.String,javax.tools.JavaFileObject>javaFileObjectsprivate java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.Class<?>>>loadedClassesMapprivate static org.slf4j.LoggerLOGprivate @NotNull java.util.List<java.lang.String>optionsprivate @Nullable java.io.FilesourceDir
-
Constructor Summary
Constructors Constructor Description CachedCompiler(@Nullable java.io.File sourceDir, @Nullable java.io.File classDir)CachedCompiler(@Nullable java.io.File sourceDir, @Nullable java.io.File classDir, @NotNull java.util.List<java.lang.String> options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) @NotNull java.util.Map<java.lang.String,byte[]>compileFromJava(@NotNull java.lang.String className, @NotNull java.lang.String javaCode, @NotNull java.io.PrintWriter writer, MyJavaFileManager fileManager)(package private) @NotNull java.util.Map<java.lang.String,byte[]>compileFromJava(@NotNull java.lang.String className, @NotNull java.lang.String javaCode, MyJavaFileManager fileManager)java.lang.ClassloadFromJava(@NotNull java.lang.ClassLoader classLoader, @NotNull java.lang.String className, @NotNull java.lang.String javaCode)java.lang.ClassloadFromJava(@NotNull java.lang.ClassLoader classLoader, @NotNull java.lang.String className, @NotNull java.lang.String javaCode, @Nullable java.io.PrintWriter writer)java.lang.ClassloadFromJava(@NotNull java.lang.String className, @NotNull java.lang.String javaCode)
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
DEFAULT_WRITER
private static final java.io.PrintWriter DEFAULT_WRITER
-
DEFAULT_OPTIONS
private static final java.util.List<java.lang.String> DEFAULT_OPTIONS
-
loadedClassesMap
private final java.util.Map<java.lang.ClassLoader,java.util.Map<java.lang.String,java.lang.Class<?>>> loadedClassesMap
-
fileManagerMap
private final java.util.Map<java.lang.ClassLoader,MyJavaFileManager> fileManagerMap
-
sourceDir
@Nullable private final @Nullable java.io.File sourceDir
-
classDir
@Nullable private final @Nullable java.io.File classDir
-
options
@NotNull private final @NotNull java.util.List<java.lang.String> options
-
javaFileObjects
private final java.util.concurrent.ConcurrentMap<java.lang.String,javax.tools.JavaFileObject> javaFileObjects
-
-
Constructor Detail
-
CachedCompiler
public CachedCompiler(@Nullable @Nullable java.io.File sourceDir, @Nullable @Nullable java.io.File classDir)
-
CachedCompiler
public CachedCompiler(@Nullable @Nullable java.io.File sourceDir, @Nullable @Nullable java.io.File classDir, @NotNull @NotNull java.util.List<java.lang.String> options)
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
loadFromJava
public java.lang.Class loadFromJava(@NotNull @NotNull java.lang.String className, @NotNull @NotNull java.lang.String javaCode) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
loadFromJava
public java.lang.Class loadFromJava(@NotNull @NotNull java.lang.ClassLoader classLoader, @NotNull @NotNull java.lang.String className, @NotNull @NotNull java.lang.String javaCode) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
compileFromJava
@NotNull @NotNull java.util.Map<java.lang.String,byte[]> compileFromJava(@NotNull @NotNull java.lang.String className, @NotNull @NotNull java.lang.String javaCode, MyJavaFileManager fileManager)
-
compileFromJava
@NotNull @NotNull java.util.Map<java.lang.String,byte[]> compileFromJava(@NotNull @NotNull java.lang.String className, @NotNull @NotNull java.lang.String javaCode, @NotNull @NotNull java.io.PrintWriter writer, MyJavaFileManager fileManager)
-
loadFromJava
public java.lang.Class loadFromJava(@NotNull @NotNull java.lang.ClassLoader classLoader, @NotNull @NotNull java.lang.String className, @NotNull @NotNull java.lang.String javaCode, @Nullable @Nullable java.io.PrintWriter writer) throws java.lang.ClassNotFoundException- Throws:
java.lang.ClassNotFoundException
-
-