Package io.deephaven.engine.context
Class QueryCompiler
java.lang.Object
io.deephaven.engine.context.QueryCompiler
- Direct Known Subclasses:
PoisonedQueryCompiler
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
compile
(@NotNull String className, @NotNull String classBody, @NotNull String packageNameRoot, @Nullable StringBuilder codeLog, @NotNull Map<String, Class<?>> parameterClasses) Compile a class.final Class<?>
final Class<?>
compile
(String className, String classBody, String packageNameRoot, StringBuilder codeLog) final Class<?>
compile
(String className, String classBody, String packageNameRoot, Map<String, Class<?>> parameterClasses) static QueryCompiler
create
(File cacheDirectory, ClassLoader classLoader) static String
createEscapedJoinedString
(String originalString) Transform a string into the corresponding Java source code that compiles into that string.static String
createEscapedJoinedString
(String originalString, int maxStringLength) static boolean
setLogEnabled
(boolean logEnabled) Enables or disables compilation logging.void
setParentClassLoader
(ClassLoader parentClassLoader) static void
writeClass
(File destinationDirectory, String className, byte[] data) static void
writeClass
(File destinationDirectory, String className, byte[] data, String message)
-
Field Details
-
FORMULA_PREFIX
- See Also:
-
DYNAMIC_GROOVY_CLASS_PREFIX
- See Also:
-
-
Method Details
-
create
-
setLogEnabled
public static boolean setLogEnabled(boolean logEnabled) Enables or disables compilation logging.- Parameters:
logEnabled
- Whether or not logging should be enabled- Returns:
- The value of
logEnabled
before calling this method.
-
writeClass
public static void writeClass(File destinationDirectory, String className, byte[] data) throws IOException - Throws:
IOException
-
writeClass
public static void writeClass(File destinationDirectory, String className, byte[] data, String message) throws IOException - Throws:
IOException
-
getFakeClassDestination
-
setParentClassLoader
-
compile
-
compile
-
compile
public final Class<?> compile(String className, String classBody, String packageNameRoot, StringBuilder codeLog) -
compile
public Class<?> compile(@NotNull @NotNull String className, @NotNull @NotNull String classBody, @NotNull @NotNull String packageNameRoot, @Nullable @Nullable StringBuilder codeLog, @NotNull @NotNull Map<String, Class<?>> parameterClasses) Compile a class.- Parameters:
className
- Class nameclassBody
- Class body, before update with "$CLASS_NAME$" replacement and package name prefixingpackageNameRoot
- Package name prefixcodeLog
- Optional "log" for final class codeparameterClasses
- Generic parameters, empty if none required- Returns:
- The compiled class
-
createEscapedJoinedString
Transform a string into the corresponding Java source code that compiles into that string. This involves escaping special characters, surrounding it with quotes, and (if the string is larger than the max string length for Java literals), splitting it into substrings and constructing a call to String.join() that combines those substrings. -
createEscapedJoinedString
-