java.lang.Object
java.lang.Record
com.github.sormuras.bach.command.JavacCommand
- Record Components:
release
- Compile source code according to the rules of the Java programming language for the specified Java SE release, generating class files which target that release.modules
- Compiles those source files in the named modules that are newer than the corresponding files in the output directory.moduleSourcePathPatterns
- Specifies where to find source files when compiling code in multiple modules: a module-pattern form, in which the source path for each module is specified by a pattern.moduleSourcePathSpecifics
- Specifies where to find source files when compiling code in multiple modules: a module-specific form, in which a package path is given for each module containing code to be compiled.modulePathsOption
- Specifies where to find application modules.verbose
- Outputs messages about what the compiler is doing. Messages include information about each class loaded and each source file compiled.outputDirectoryForClasses
- Specify where to place generated class files.additionals
- Aggregates additional command-line arguments.
- All Implemented Interfaces:
Command<JavacCommand>
public record JavacCommand(JavacCommand.ReleaseOption release, ModulesOption modules, ModuleSourcePathPatternsOption moduleSourcePathPatterns, ModuleSourcePathSpecificsOption moduleSourcePathSpecifics, ModulePathsOption modulePathsOption, VerboseOption verbose, OutputDirectoryOption outputDirectoryForClasses, AdditionalArgumentsOption additionals)
extends Record
implements Command<JavacCommand>
The javac command reads Java declarations and compiles them into class files.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
Java SE release feature version option. -
Constructor Summary
ConstructorDescriptionJavacCommand
(JavacCommand.ReleaseOption release, ModulesOption modules, ModuleSourcePathPatternsOption moduleSourcePathPatterns, ModuleSourcePathSpecificsOption moduleSourcePathSpecifics, ModulePathsOption modulePathsOption, VerboseOption verbose, OutputDirectoryOption outputDirectoryForClasses, AdditionalArgumentsOption additionals) Creates an instance of aJavacCommand
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionals
record component.additionals
(AdditionalArgumentsOption additionals) Creates a new instance of the implementing class with the given option object.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.modulePaths
(Path... paths) modulePathsAdd
(Path path, Path... more) Returns the value of themodulePathsOption
record component.modules()
Returns the value of themodules
record component.moduleSourcePathAddPattern
(String segment) moduleSourcePathAddSpecific
(String module, Path... paths) Returns the value of themoduleSourcePathPatterns
record component.moduleSourcePathPatterns
(String... patterns) Returns the value of themoduleSourcePathSpecifics
record component.name()
Returns the name of the command.Creates a new instance of the implementing class with the given option object.Returns the value of theoutputDirectoryForClasses
record component.release()
Returns the value of therelease
record component.Returns a list of all aggregated arguments.final String
toString()
Returns a string representation of this record class.verbose()
Returns the value of theverbose
record component.
-
Constructor Details
-
JavacCommand
public JavacCommand() -
JavacCommand
public JavacCommand(JavacCommand.ReleaseOption release, ModulesOption modules, ModuleSourcePathPatternsOption moduleSourcePathPatterns, ModuleSourcePathSpecificsOption moduleSourcePathSpecifics, ModulePathsOption modulePathsOption, VerboseOption verbose, OutputDirectoryOption outputDirectoryForClasses, AdditionalArgumentsOption additionals) Creates an instance of aJavacCommand
record class.- Parameters:
release
- the value for therelease
record componentmodules
- the value for themodules
record componentmoduleSourcePathPatterns
- the value for themoduleSourcePathPatterns
record componentmoduleSourcePathSpecifics
- the value for themoduleSourcePathSpecifics
record componentmodulePathsOption
- the value for themodulePathsOption
record componentverbose
- the value for theverbose
record componentoutputDirectoryForClasses
- the value for theoutputDirectoryForClasses
record componentadditionals
- the value for theadditionals
record component
-
-
Method Details
-
name
Description copied from interface:Command
Returns the name of the command.- Specified by:
name
in interfaceCommand<JavacCommand>
- Returns:
- the name of the command
-
option
Description copied from interface:Command
Creates a new instance of the implementing class with the given option object.- Specified by:
option
in interfaceCommand<JavacCommand>
- Parameters:
option
- the option object to use- Returns:
- a new instance of the implementing class
-
release
-
modules
-
modules
-
moduleSourcePathPatterns
-
moduleSourcePathAddPattern
-
moduleSourcePathAddSpecific
-
modulePaths
-
modulePathsAdd
-
verbose
-
outputDirectoryForClasses
-
additionals
Description copied from interface:Command
Creates a new instance of the implementing class with the given option object.- Specified by:
additionals
in interfaceCommand<JavacCommand>
- Parameters:
additionals
- the option object to use- Returns:
- a new instance of the implementing class
- See Also:
-
toArguments
Description copied from interface:Command
Returns a list of all aggregated arguments.- Specified by:
toArguments
in interfaceCommand<JavacCommand>
- Returns:
- a list of all aggregated arguments
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
release
Returns the value of therelease
record component.- Returns:
- the value of the
release
record component
-
modules
Returns the value of themodules
record component.- Returns:
- the value of the
modules
record component
-
moduleSourcePathPatterns
Returns the value of themoduleSourcePathPatterns
record component.- Returns:
- the value of the
moduleSourcePathPatterns
record component
-
moduleSourcePathSpecifics
Returns the value of themoduleSourcePathSpecifics
record component.- Returns:
- the value of the
moduleSourcePathSpecifics
record component
-
modulePathsOption
Returns the value of themodulePathsOption
record component.- Returns:
- the value of the
modulePathsOption
record component
-
verbose
Returns the value of theverbose
record component.- Returns:
- the value of the
verbose
record component
-
outputDirectoryForClasses
Returns the value of theoutputDirectoryForClasses
record component.- Returns:
- the value of the
outputDirectoryForClasses
record component
-
additionals
Returns the value of theadditionals
record component.- Specified by:
additionals
in interfaceCommand<JavacCommand>
- Returns:
- the value of the
additionals
record component
-