Package net.solarnetwork.service
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
FieldsModifier and TypeFieldDescriptionstatic final StringParameter key for aClassLoaderinstance to use during compilation. -
Method Summary
Modifier and TypeMethodDescriptioncompileResources(Iterable<org.springframework.core.io.Resource> javaResources, Path root, Map<String, ?> parameters) Compile a set of Java source resources into classes, returning aClassLoaderfor the compiled output.
-
Field Details
-
CLASSLOADER_PARAM
Parameter key for aClassLoaderinstance to use during compilation.- See Also:
-
-
Method Details
-
compileResources
ClassLoader compileResources(Iterable<org.springframework.core.io.Resource> javaResources, Path root, Map<String, ?> parameters) throws IOExceptionCompile a set of Java source resources into classes, returning aClassLoaderfor the compiled output.- Parameters:
javaResources- the Java resources to compileroot- the root path to treat as the root of the Java package hierarchyparameters- optional compilation parameters- Returns:
- a class loaded with the compiled output
- Throws:
IOException- if any compilation error occurs
-