Class JavaTool
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.core.AbstractGenerator
org.jdrupes.builder.java.JavaTool
- All Implemented Interfaces:
Generator, Renamable, ResourceProvider
- Direct Known Subclasses:
JavaCompiler, Javadoc
A base class for generators that invoke java tools.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumControls how Java compilation handles JPMS modules. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JavaTool.ModuleModeDetermines the effective module mode, resolvingModuleMode.AUTOto eitherModuleMode.MODULEorModuleMode.CLASSPATHbased on whether amodule-info.javaexists among the sources.protected abstract booleanChecks whether amodule-info.javaexists among the configured sources.protected voidlogDiagnostic(Diagnostic<? extends JavaFileObject> diagnostic) Log diagnostic.protected voidlogDiagnostics(DiagnosticCollector<JavaFileObject> diagnostics) Log diagnostics.Returns the current module compilation mode.moduleMode(JavaTool.ModuleMode moduleMode) Sets the module compilation mode.optionArgument(String... names) Find the argument for the given option.options()Return the options.Adds the given options.Adds the given options.Methods inherited from class AbstractGenerator
cleanup, name, project, toStringMethods inherited from class AbstractProvider
context, doProvide, name, of, rename, vavrStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
context, name, of, resources
-
Constructor Details
-
JavaTool
-
-
Method Details
-
moduleMode
Returns the current module compilation mode. Defaults toModuleMode.AUTO, which activates module-path compilation when amodule-info.javais found among the sources.- Returns:
- the module mode
-
moduleMode
Sets the module compilation mode.- Parameters:
moduleMode- the new mode- Returns:
- the java compiler
-
effectiveModuleMode
Determines the effective module mode, resolvingModuleMode.AUTOto eitherModuleMode.MODULEorModuleMode.CLASSPATHbased on whether amodule-info.javaexists among the sources.- Returns:
- the effective mode
-
hasModuleInfo
Checks whether amodule-info.javaexists among the configured sources.- Returns:
- true, if module-info.java is present
-
options
-
options
-
options
-
optionArgument
Find the argument for the given option. As some options are allows in different styles, several names can be specified.- Parameters:
names- the names- Returns:
- the optional
-
logDiagnostic
Log diagnostic.- Parameters:
diagnostic- the diagnostic
-
logDiagnostics
Log diagnostics.- Parameters:
diagnostics- the diagnostics
-