Class QueryCompiler

java.lang.Object
io.deephaven.engine.context.QueryCompiler
Direct Known Subclasses:
PoisonedQueryCompiler

public class QueryCompiler extends Object
  • Field Details

  • Method Details

    • create

      public static QueryCompiler create(File cacheDirectory, ClassLoader classLoader)
    • 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

      public File getFakeClassDestination()
    • setParentClassLoader

      public void setParentClassLoader(ClassLoader parentClassLoader)
    • compile

      public final Class<?> compile(String className, String classBody, String packageNameRoot)
    • compile

      public final Class<?> compile(String className, String classBody, String packageNameRoot, Map<String,Class<?>> parameterClasses)
    • 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 name
      classBody - Class body, before update with "$CLASS_NAME$" replacement and package name prefixing
      packageNameRoot - Package name prefix
      codeLog - Optional "log" for final class code
      parameterClasses - Generic parameters, empty if none required
      Returns:
      The compiled class
    • createEscapedJoinedString

      public static String createEscapedJoinedString(String originalString)
      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

      public static String createEscapedJoinedString(String originalString, int maxStringLength)