Class CompilerJavac
java.lang.Object
io.github.mkoncek.classpathless.impl.CompilerJavac
- All Implemented Interfaces:
ClasspathlessCompiler
An implementation using javax.tools compiler API
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mkoncek.classpathless.api.ClasspathlessCompiler
ClasspathlessCompiler.Arguments
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
areBytecodesValid
(LoggingSwitch loggingSwitch, IdentifiedSource source, Collection<IdentifiedBytecode> bytecodes) compileClass
(ClassesProvider classesProvider, Optional<MessagesListener> messagesConsumer, IdentifiedSource... javaSourceFiles) private static Collection
<String> extractAllDependencies
(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, IdentifiedBytecode bytecode) private static void
extractAllDependenciesCatched
(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, TreeSet<String> availableClasses, IdentifiedSource source, IdentifiedBytecode bytecode) private static ClassIdentifier
getIdentifier
(JavaFileObject object) initializePossibleDependency
(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, IdentifiedSource[] javaSourceFiles) private static boolean
isBytecodeValid
(IdentifiedBytecode bytecode, LoggingSwitch loggingSwitch, IdentifiedSource source)
-
Field Details
-
compiler
-
arguments
-
-
Constructor Details
-
CompilerJavac
-
CompilerJavac
public CompilerJavac()
-
-
Method Details
-
getIdentifier
-
compileClass
public Collection<IdentifiedBytecode> compileClass(ClassesProvider classesProvider, Optional<MessagesListener> messagesConsumer, IdentifiedSource... javaSourceFiles) - Specified by:
compileClass
in interfaceClasspathlessCompiler
- Parameters:
classesProvider
- Provider for missing elements on the classpath.messagesConsumer
- Accepts any diagnostic or logging information from the compiler.javaSourceFiles
- Files to compile.- Returns:
- Compiled bytecode of all javaSourceFiles.
-
initializePossibleDependency
private static TreeSet<String> initializePossibleDependency(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, IdentifiedSource[] javaSourceFiles) -
extractAllDependenciesCatched
private static void extractAllDependenciesCatched(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, TreeSet<String> availableClasses, IdentifiedSource source, IdentifiedBytecode bytecode) -
extractAllDependencies
private static Collection<String> extractAllDependencies(ClassesProvider classesProvider, LoggingSwitch loggingSwitch, IdentifiedBytecode bytecode) -
isBytecodeValid
private static boolean isBytecodeValid(IdentifiedBytecode bytecode, LoggingSwitch loggingSwitch, IdentifiedSource source) -
areBytecodesValid
private static boolean areBytecodesValid(LoggingSwitch loggingSwitch, IdentifiedSource source, Collection<IdentifiedBytecode> bytecodes)
-