Interface JctCompiler
- All Known Implementing Classes:
AbstractJctCompiler
JctCompiler objects are often a nexus that will manage configuring an underlying JSR-199 compiler internally in a platform-agnostic way.
- Since:
- 0.0.1
- Author:
- Ashley Scopes
-
Field Summary
Modifier and TypeFieldDescriptionstatic final AnnotationProcessorDiscovery
Default setting for how to apply annotation processor discovery when no processors are explicitly defined (AnnotationProcessorDiscovery.INCLUDE_DEPENDENCIES
).static final CompilationMode
Default setting for the compilation mode to use (CompilationMode.COMPILATION_AND_ANNOTATION_PROCESSING
).static final Set
<DebuggingInfo> Default debugging info to include in the compilation (all possible info).static final LoggingMode
Default setting for logging diagnostics (LoggingMode.ENABLED
).static final boolean
Default setting for displaying warnings as errors (false
).static final LoggingMode
Default setting for logging file manager operations (LoggingMode.DISABLED
).static final boolean
Default setting for fixing modules being placed on the classpath by mistake (true
).static final boolean
Default setting for inclusion of the current class path (true
).static final boolean
Default setting for inclusion of the current module path (true
).static final boolean
Default setting for inclusion of the system module path (true
).static final Locale
Default setting for locale (Locale.ROOT
).static final Charset
Default charset to use for compiler logs (StandardCharsets.UTF_8
).static final boolean
Default preference for including reflective parameter information in compiled classes (true
).static final boolean
Default setting for preview features (false
).static final boolean
Default setting for deprecation warnings (true
).static final boolean
Default setting for displaying warnings (true
).static final boolean
Default setting for verbose logging (false
). -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotationProcessorOptions
(Iterable<String> annotationProcessorOptions) Add options to pass to any annotation processors.default JctCompiler
addAnnotationProcessorOptions
(String... annotationProcessorOptions) Add options to pass to any annotation processors.addAnnotationProcessors
(Iterable<? extends Processor> annotationProcessors) Add annotation processors to invoke.default JctCompiler
addAnnotationProcessors
(Processor... annotationProcessors) Add annotation processors to invoke.addCompilerOptions
(Iterable<String> compilerOptions) Add command line options to pass tojavac
.default JctCompiler
addCompilerOptions
(String... compilerOptions) Add command line options to pass tojavac
.annotationProcessorDiscovery
(AnnotationProcessorDiscovery annotationProcessorDiscovery) Set how to perform annotation processor discovery.compilationMode
(CompilationMode compilationMode) Set the compilation mode to use for this compiler.Invoke the compilation and return the compilation result.default JctCompilation
Invoke the compilation and return the compilation result.compile
(Workspace workspace, Collection<String> classNames) Invoke the compilation and return the compilation result.<E extends Exception>
JctCompilerconfigure
(JctCompilerConfigurer<E> configurer) Apply a given configurer to this compiler.debuggingInfo
(Set<DebuggingInfo> debuggingInfoFlags) Set the debugging info level to use.diagnosticLoggingMode
(LoggingMode diagnosticLoggingMode) Set how to handle diagnostic capture.failOnWarnings
(boolean enabled) Set whether to enable treating warnings as errors or not.fileManagerLoggingMode
(LoggingMode fileManagerLoggingMode) Set how to handle logging calls to underlying file managers.fixJvmModulePathMismatch
(boolean fixJvmModulePathMismatch) Get whether we will attempt to fix modules appearing on the classpath, or non-modules appearing on the module path.Get how to perform annotation processor discovery.Get an immutable snapshot view of the current annotation processor options that are set.Get an immutable snapshot view of the current annotation processors that are explicitly set to be run, in the order that they were provided to the compiler.Get the compilation mode that is in use.Get an immutable snapshot view of the current compiler options that are set.Get the debugging info that is enabled.Get the default release to use if no release or target version is specified.Get the current diagnostic logging mode.Get the effective release to use for the actual compilation.Get the current file manager logging mode.Get the output locale.Get the charset being used to write compiler logs with.getName()
Get the friendly printable name of this compiler object.Get the current release version that is set, ornull
if left to the compiler to decide.Get the current source version that is set, ornull
if left to the compiler to decide.Get the current target version that is set, ornull
if left to the compiler default.inheritClassPath
(boolean inheritClassPath) Set whether the class path is inherited from the active JVM or not.inheritModulePath
(boolean inheritModulePath) Set whether the module path is inherited from the active JVM or not.inheritSystemModulePath
(boolean inheritSystemModulePath) Set whether the system module path is inherited from the active JVM or not.boolean
Determine whether warnings are being treated as errors or not.boolean
Get whether we will attempt to fix modules appearing on the classpath, or non-modules appearing on the module path.boolean
Get whether the class path is inherited from the active JVM or not.boolean
Get whether the module path is inherited from the active JVM or not.boolean
Get whether the system module path is inherited from the active JVM or not.boolean
Determine if including reflective parameter info is enabled or not.boolean
Determine whether preview features are enabled or not.boolean
Determine whether deprecation warnings are enabled or not.boolean
Determine whether warnings are enabled or not.boolean
Determine whether verbose logging is enabled or not.Set the output locale.logCharset
(Charset logCharset) Set the charset being used to write compiler logs with.Set the friendly name of this compiler.parameterInfoEnabled
(boolean parameterInfoEnabled) Set whether to include parameter reflective info by default in compiled classes or not.previewFeatures
(boolean enabled) Set whether to enable compiler preview features or not.default JctCompiler
release
(int release) Set the release version.Set the release version.default JctCompiler
release
(SourceVersion release) Set the release version.showDeprecationWarnings
(boolean enabled) Set whether to enable deprecation warnings or not.showWarnings
(boolean enabled) Set whether to enable displaying warnings or not.default JctCompiler
source
(int source) Set the source version.Set the source version.default JctCompiler
source
(SourceVersion source) Set the source version.default JctCompiler
target
(int target) Set the target version.Set the target version.default JctCompiler
target
(SourceVersion target) Set the target version.default JctCompiler
Request that the compiler uses a language version that corresponds to the runtime language version in use on the current JVM.verbose
(boolean enabled) Set whether to use verbose output or not.
-
Field Details
-
DEFAULT_SHOW_DEPRECATION_WARNINGS
Default setting for deprecation warnings (true
).- See Also:
-
DEFAULT_LOCALE
Default setting for locale (Locale.ROOT
). -
DEFAULT_PREVIEW_FEATURES
Default setting for preview features (false
).- See Also:
-
DEFAULT_VERBOSE
-
DEFAULT_SHOW_WARNINGS
Default setting for displaying warnings (true
).- See Also:
-
DEFAULT_FAIL_ON_WARNINGS
Default setting for displaying warnings as errors (false
).- See Also:
-
DEFAULT_FIX_JVM_MODULE_PATH_MISMATCH
Default setting for fixing modules being placed on the classpath by mistake (true
).- See Also:
-
DEFAULT_INHERIT_CLASS_PATH
Default setting for inclusion of the current class path (true
).- See Also:
-
DEFAULT_INHERIT_MODULE_PATH
Default setting for inclusion of the current module path (true
).- See Also:
-
DEFAULT_INHERIT_SYSTEM_MODULE_PATH
Default setting for inclusion of the system module path (true
).- See Also:
-
DEFAULT_FILE_MANAGER_LOGGING_MODE
Default setting for logging file manager operations (LoggingMode.DISABLED
). -
DEFAULT_DIAGNOSTIC_LOGGING_MODE
Default setting for logging diagnostics (LoggingMode.ENABLED
). -
DEFAULT_COMPILATION_MODE
Default setting for the compilation mode to use (CompilationMode.COMPILATION_AND_ANNOTATION_PROCESSING
). -
DEFAULT_ANNOTATION_PROCESSOR_DISCOVERY
Default setting for how to apply annotation processor discovery when no processors are explicitly defined (AnnotationProcessorDiscovery.INCLUDE_DEPENDENCIES
). -
DEFAULT_LOG_CHARSET
Default charset to use for compiler logs (StandardCharsets.UTF_8
). -
DEFAULT_DEBUGGING_INFO
Default debugging info to include in the compilation (all possible info). -
DEFAULT_PARAMETER_INFO_ENABLED
Default preference for including reflective parameter information in compiled classes (true
).- See Also:
-
-
Method Details
-
compile
Invoke the compilation and return the compilation result.The actual classes to compile will be dynamically discovered. If you wish to specify the specific classes to compile, see
compile(Workspace, String...)
orcompile(Workspace, Collection)
.- Parameters:
workspace
- the workspace to compile.- Returns:
- the compilation result.
- Throws:
JctCompilerException
- if the compiler threw an unhandled exception. This should not occur for compilation failures generally.IllegalStateException
- if no compilation units were found.UncheckedIOException
- if an IO error occurs.- See Also:
-
compile
Invoke the compilation and return the compilation result.Only classes matching the given class names will be compiled.
If you wish to let JCT determine which classes to compile dynamically, see
compile(Workspace)
instead.Note that nested instance/static nested classes cannot be specified individually here. To compile them, you must also compile their outer class that they are defined within.
- Parameters:
workspace
- the workspace to compile.classNames
- the class names to compile.- Returns:
- the compilation result.
- Throws:
JctCompilerException
- if the compiler threw an unhandled exception. This should not occur for compilation failures generally.NullPointerException
- if any class names are null, or if the array is null.IllegalStateException
- if no compilation units were found.UncheckedIOException
- if an IO error occurs.- See Also:
-
compile
Invoke the compilation and return the compilation result.Only classes matching the given class names will be compiled.
If you wish to let JCT determine which classes to compile dynamically, see
compile(Workspace)
instead.Note that nested instance/static nested classes cannot be specified individually here. To compile them, you must also compile their outer class that they are defined within.
- Parameters:
workspace
- the workspace to compile.classNames
- the class names to compile.- Returns:
- the compilation result.
- Throws:
JctCompilerException
- if the compiler threw an unhandled exception. This should not occur for compilation failures usually.NullPointerException
- if theclassNames
collection contains any null values, or if the collection itself is null.IllegalArgumentException
- if the collection is empty.IllegalStateException
- if no compilation units were found.UncheckedIOException
- if an IO error occurs.- See Also:
-
configure
Apply a given configurer to this compiler.Configurers can be lambdas, method references, or objects.
// Using an object configurer var werrorConfigurer = new JctCompilerConfigurer<RuntimeException>() { @Override public void configure(JctCompiler compiler) { compiler.failOnWarnings(true); } }; compiler.configure(werrorConfigurer); // Using a lambda configurer compiler.configure(c -> c.verbose(true));
Configurers take a type parameter that corresponds to an exception type. This is the exception type that can be thrown by the configurer, or
RuntimeException
if no checked exception is thrown. This mechanism allows configurers to propagate checked exceptions to their caller where needed.class FileFlagConfigurer implements JctCompilerConfigurer<IOException> { private final Path path; public FileFlagConfigurer(String... path) { this(Path.of(path)); } public FileFlagConfigurer(Path path) { this.path = path; } @Override public void configure(JctCompiler compiler) throws IOException { var flags = Files.lines(path) .map(String::trim) .filter(not(String::isBlank)) .toList(); compiler.addCompilerOptions(flags); } } @Test void testSomething() throws IOException { ... compiler.configure(new FileFlagConfigurer("src", "test", "resources", "flags.txt")); ... }
- Type Parameters:
E
- any exception that may be thrown.- Parameters:
configurer
- the configurer to invoke.- Returns:
- this compiler object for further call chaining.
- Throws:
E
- any exception that may be thrown by the configurer. If no checked exception is thrown, then this should be treated asRuntimeException
.
-
getName
-
name
Set the friendly name of this compiler.This will be used by the
JUnit5 support
to name unit test cases.- Parameters:
name
- the name to set.- Returns:
- this compiler object for further call chaining.
-
getAnnotationProcessorOptions
Get an immutable snapshot view of the current annotation processor options that are set.- Returns:
- the current annotation processor options that are set.
-
addAnnotationProcessorOptions
Add options to pass to any annotation processors.- Parameters:
annotationProcessorOptions
- the options to pass.- Returns:
- this compiler object for further call chaining.
-
addAnnotationProcessorOptions
Add options to pass to any annotation processors.- Parameters:
annotationProcessorOptions
- options to pass.- Returns:
- this compiler object for further call chaining.
-
getAnnotationProcessors
Get an immutable snapshot view of the current annotation processors that are explicitly set to be run, in the order that they were provided to the compiler.- Returns:
- the current annotation processors that are set.
-
addAnnotationProcessors
Add annotation processors to invoke.Warning: This bypasses the discovery process of annotation processors provided in the annotation processor path and annotation processor module paths, as well as any other locations such as class paths and module paths.
- Parameters:
annotationProcessors
- the processors to invoke.- Returns:
- this compiler object for further call chaining.
-
addAnnotationProcessors
Add annotation processors to invoke.Warning: This bypasses the discovery process of annotation processors provided in the annotation processor path and annotation processor module paths, as well as any other locations such as class paths and module paths.
- Parameters:
annotationProcessors
- processors to invoke.- Returns:
- this compiler object for further call chaining.
-
getCompilerOptions
Get an immutable snapshot view of the current compiler options that are set.- Returns:
- the current compiler options that are set.
-
addCompilerOptions
Add command line options to pass tojavac
.- Parameters:
compilerOptions
- the options to add.- Returns:
- this compiler object for further call chaining.
-
addCompilerOptions
Add command line options to pass tojavac
.- Parameters:
compilerOptions
- options to add.- Returns:
- this compiler object for further call chaining.
-
isVerbose
boolean isVerbose()Determine whether verbose logging is enabled or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_VERBOSE
.Note that enabling this is compiler-specific behaviour. There is no guarantee that the output target or the format or verbosity of output will be consistent between different compiler implementations.
- Returns:
- whether verbose logging is enabled or not.
-
verbose
Set whether to use verbose output or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_VERBOSE
.Note that enabling this is compiler-specific behaviour. There is no guarantee that the output target or the format or verbosity of output will be consistent between different compiler implementations.
- Parameters:
enabled
-true
for verbose output,false
for normal output.- Returns:
- this compiler for further call chaining.
-
isPreviewFeatures
boolean isPreviewFeatures()Determine whether preview features are enabled or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_PREVIEW_FEATURES
.- Returns:
- whether preview features are enabled or not.
-
previewFeatures
Set whether to enable compiler preview features or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_PREVIEW_FEATURES
.Generally, this feature should be avoided if testing across multiple versions of Java, as preview features are often not finalised and may change without warning.
- Parameters:
enabled
-true
to enable preview features, orfalse
to disable them.- Returns:
- this compiler object for further call chaining.
-
isShowWarnings
boolean isShowWarnings()Determine whether warnings are enabled or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_SHOW_WARNINGS
.- Returns:
- whether warnings are enabled or not.
-
showWarnings
Set whether to enable displaying warnings or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_SHOW_WARNINGS
.- Parameters:
enabled
-true
to enable warnings.false
to disable them.- Returns:
- this compiler object for further call chaining.
-
isShowDeprecationWarnings
boolean isShowDeprecationWarnings()Determine whether deprecation warnings are enabled or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_SHOW_DEPRECATION_WARNINGS
.- Returns:
- whether deprecation warnings are enabled or not.
-
showDeprecationWarnings
Set whether to enable deprecation warnings or not.This is ignored if
showWarnings(boolean)
is disabled.Unless otherwise changed or specified, implementations should default to
DEFAULT_SHOW_DEPRECATION_WARNINGS
.- Parameters:
enabled
-true
to enable deprecation warnings.false
to disable them.- Returns:
- this compiler object for further call chaining.
-
isFailOnWarnings
boolean isFailOnWarnings()Determine whether warnings are being treated as errors or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_FAIL_ON_WARNINGS
.- Returns:
- whether warnings are being treated as errors or not.
-
failOnWarnings
Set whether to enable treating warnings as errors or not.Some compilers may call this flag something different, such as "
-Werror
".This is ignored if
showWarnings(boolean)
is disabled.Unless otherwise changed or specified, implementations should default to
DEFAULT_FAIL_ON_WARNINGS
.- Parameters:
enabled
-true
to enable treating warnings as errors.false
to disable them.- Returns:
- this compiler object for further call chaining.
-
getCompilationMode
Get the compilation mode that is in use.Unless otherwise changed or specified, implementations should default to
DEFAULT_COMPILATION_MODE
.- Returns:
- the compilation mode.
-
compilationMode
Set the compilation mode to use for this compiler.This allows you to override whether sources are compiled or annotation-processed without running the full compilation process. Tuning this may provide faster test cases in some situations.
Unless otherwise changed or specified, implementations should default to
DEFAULT_COMPILATION_MODE
.- Parameters:
compilationMode
- the compilation mode to use.- Returns:
- this compiler object for further call chaining.
-
getDefaultRelease
Get the default release to use if no release or target version is specified.This can not be configured generally, as it is defined by the internal compiler implementation.
Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
- Returns:
- the default release version to use.
-
getEffectiveRelease
Get the effective release to use for the actual compilation.Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
This may be determined from the
source
,target
,release
, anddefault release.
- Returns:
- the effective release.
-
getRelease
Get the current release version that is set, ornull
if left to the compiler to decide. default.Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
- Returns:
- the release version string, if set.
-
release
Set the release version.This will clear any source and target version that is set.
Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
- Parameters:
release
- the version to set.- Returns:
- this compiler object for further call chaining.
-
release
Set the release version.This will clear any source and target version that is set.
Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
- Parameters:
release
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
IllegalArgumentException
- if the version is less than 0.UnsupportedOperationException
- if the compiler does not support integer versions.
-
release
Set the release version.This will clear any source and target version that is set.
Generally, this value will be an integer within a string. The value is represented as a string to allow supporting compilers which may use non-integer version numbers.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
- Parameters:
release
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
UnsupportedOperationException
- if the compiler does not support integer versions.NullPointerException
- if the release is null.
-
useRuntimeRelease
Request that the compiler uses a language version that corresponds to the runtime language version in use on the current JVM.For example, running this on JRE 19 would set the release to "19".
This calls
release(int)
internally.- Returns:
- this compiler object for further call chaining.
- Throws:
UnsupportedOperationException
- if the current JVM version does not correspond to a supported Java release version in the compiler, or if the compiler does not support integral version numbers.- Since:
- 1.1.0
-
getSource
-
source
Set the source version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
source
- the version to set.- Returns:
- this compiler object for further call chaining.
-
source
Set the source version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
source
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
IllegalArgumentException
- if the version is less than 0.UnsupportedOperationException
- if the compiler does not support integer versions.
-
source
Set the source version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
source
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
UnsupportedOperationException
- if the compiler does not support integer versions.NullPointerException
- if the source is null.
-
getTarget
-
target
Set the target version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
target
- the version to set.- Returns:
- this compiler object for further call chaining.
-
target
Set the target version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
target
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
IllegalArgumentException
- if the version is less than 0.UnsupportedOperationException
- if the compiler does not support integer versions.
-
target
Set the target version.This will clear any release version that is set.
Unless explicitly defined, the default setting is expected to be a sane compiler-specific default.
Source and target versions have mostly been replaced with the release version mechanism which controls both flags and can ensure other behaviours are consistent. This feature is still provided in case you have a specific use case that is not covered by this functionality.
- Parameters:
target
- the version to set.- Returns:
- this compiler object for further call chaining.
- Throws:
UnsupportedOperationException
- if the compiler does not support integer versions.NullPointerException
- if the target is null.
-
isFixJvmModulePathMismatch
boolean isFixJvmModulePathMismatch()Get whether we will attempt to fix modules appearing on the classpath, or non-modules appearing on the module path.This enables correct classpath and module path detection when the test pack is a module but the code being compiled in the test is not, and vice versa. We need this because many build systems decide whether to populate the
--module-path
or the--classpath
with JPMS-enabled dependencies based on whether the project under compilation is a JPMS module itself.This only applies if
isInheritModulePath()
orisInheritClassPath()
is enabled, and only applies to the current JVM classpath and module path.Unless otherwise changed or specified, implementations should default to
DEFAULT_FIX_JVM_MODULE_PATH_MISMATCH
.- Returns:
true
if enabled, orfalse
if disabled.
-
fixJvmModulePathMismatch
Get whether we will attempt to fix modules appearing on the classpath, or non-modules appearing on the module path.Unless otherwise changed or specified, implementations should default to
DEFAULT_FIX_JVM_MODULE_PATH_MISMATCH
.- Parameters:
fixJvmModulePathMismatch
- whether to enable the mismatch fixing or not.- Returns:
- this compiler object for further call chaining.
-
isInheritClassPath
boolean isInheritClassPath()Get whether the class path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_CLASS_PATH
.- Returns:
- whether the current class path is being inherited or not.
-
inheritClassPath
Set whether the class path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_CLASS_PATH
.- Parameters:
inheritClassPath
-true
to include it, orfalse
to exclude it.- Returns:
- this compiler object for further call chaining.
-
isInheritModulePath
boolean isInheritModulePath()Get whether the module path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_MODULE_PATH
.- Returns:
- whether the module path is being inherited or not.
-
inheritModulePath
Set whether the module path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_MODULE_PATH
.- Parameters:
inheritModulePath
-true
to include it, orfalse
to exclude it.- Returns:
- this compiler object for further call chaining.
-
isInheritSystemModulePath
boolean isInheritSystemModulePath()Get whether the system module path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_SYSTEM_MODULE_PATH
.- Returns:
- whether the system module path is being inherited or not.
-
inheritSystemModulePath
Set whether the system module path is inherited from the active JVM or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_INHERIT_SYSTEM_MODULE_PATH
.- Parameters:
inheritSystemModulePath
-true
to include it, orfalse
to exclude it.- Returns:
- this compiler object for further call chaining.
-
getLocale
Get the output locale.Unless otherwise changed or specified, implementations should default to
DEFAULT_LOCALE
.- Returns:
- the output locale to use.
-
locale
Set the output locale.Unless otherwise changed or specified, implementations should default to
DEFAULT_LOCALE
.- Parameters:
locale
- the locale to use.- Returns:
- this compiler for further call chaining.
-
getLogCharset
Get the charset being used to write compiler logs with.Unless otherwise changed or specified, implementations should default to
DEFAULT_LOG_CHARSET
.- Returns:
- the charset.
-
logCharset
Set the charset being used to write compiler logs with.Unless otherwise changed or specified, implementations should default to
DEFAULT_LOG_CHARSET
.- Parameters:
logCharset
- the charset to use.- Returns:
- this compiler for further call chaining.
-
getFileManagerLoggingMode
Get the current file manager logging mode.Unless otherwise changed or specified, implementations should default to
DEFAULT_FILE_MANAGER_LOGGING_MODE
.- Returns:
- the current file manager logging mode.
-
fileManagerLoggingMode
Set how to handle logging calls to underlying file managers.Unless otherwise changed or specified, implementations should default to
DEFAULT_FILE_MANAGER_LOGGING_MODE
.- Parameters:
fileManagerLoggingMode
- the mode to use for file manager logging.- Returns:
- this compiler for further call chaining.
-
getDiagnosticLoggingMode
Get the current diagnostic logging mode.Unless otherwise changed or specified, implementations should default to
DEFAULT_DIAGNOSTIC_LOGGING_MODE
.- Returns:
- the current diagnostic logging mode.
-
diagnosticLoggingMode
Set how to handle diagnostic capture.Unless otherwise changed or specified, implementations should default to
DEFAULT_DIAGNOSTIC_LOGGING_MODE
.- Parameters:
diagnosticLoggingMode
- the mode to use for diagnostic capture.- Returns:
- this compiler for further call chaining.
-
getAnnotationProcessorDiscovery
Get how to perform annotation processor discovery.Unless otherwise changed or specified, implementations should default to
DEFAULT_ANNOTATION_PROCESSOR_DISCOVERY
.Specifying any annotation processors explicitly with
addAnnotationProcessors(Iterable)
oraddAnnotationProcessors(Processor...)
will bypass this setting, treating it as being disabled.- Returns:
- the processor discovery mode to use.
-
annotationProcessorDiscovery
Set how to perform annotation processor discovery.Unless otherwise changed or specified, implementations should default to
DEFAULT_ANNOTATION_PROCESSOR_DISCOVERY
.Specifying any annotation processors explicitly with
addAnnotationProcessors(Iterable)
oraddAnnotationProcessors(Processor...)
will bypass this setting, treating it as being disabled.- Parameters:
annotationProcessorDiscovery
- the processor discovery mode to use.- Returns:
- this compiler for further call chaining.
-
getDebuggingInfo
Get the debugging info that is enabled.Unless otherwise changed or specified, implementations should default to
DEFAULT_DEBUGGING_INFO
.- Returns:
- the set of debugging info flags that are enabled.
- Since:
- 3.0.0
-
debuggingInfo
Set the debugging info level to use.- Parameters:
debuggingInfoFlags
- the set of debugging info flags to enable.- Returns:
- this compiler for further call chaining.
- Since:
- 3.0.0
-
isParameterInfoEnabled
boolean isParameterInfoEnabled()Determine if including reflective parameter info is enabled or not.Unless otherwise changed or specified, implementations should default to
DEFAULT_PARAMETER_INFO_ENABLED
.- Returns:
- the parameter info inclusion preference.
- Since:
- 3.0.0
-
parameterInfoEnabled
Set whether to include parameter reflective info by default in compiled classes or not.- Parameters:
parameterInfoEnabled
- whether to include the parameter reflective info or not.- Returns:
- this compiler for further call chaining.
- Since:
- 3.0.0
-