Interface JavaCompiler


public interface JavaCompiler
API for a service to compile Java sources into classes.

This API is designed for small compilation tasks, to support dynamic classes within the runtime.

Since:
1.69
Version:
1.0
Author:
matt
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Parameter key for a ClassLoader instance to use during compilation.
  • Method Summary

    Modifier and Type
    Method
    Description
    compileResources(Iterable<org.springframework.core.io.Resource> javaResources, Path root, Map<String,?> parameters)
    Compile a set of Java source resources into classes, returning a ClassLoader for the compiled output.
  • Field Details

  • Method Details

    • compileResources

      ClassLoader compileResources(Iterable<org.springframework.core.io.Resource> javaResources, Path root, Map<String,?> parameters) throws IOException
      Compile a set of Java source resources into classes, returning a ClassLoader for the compiled output.
      Parameters:
      javaResources - the Java resources to compile
      root - the root path to treat as the root of the Java package hierarchy
      parameters - optional compilation parameters
      Returns:
      a class loaded with the compiled output
      Throws:
      IOException - if any compilation error occurs