Package rife.bld.extension
Class GeneratedVersionOperation
java.lang.Object
rife.bld.operations.AbstractOperation<GeneratedVersionOperation>
rife.bld.extension.GeneratedVersionOperation
@NullMarked
public class GeneratedVersionOperation
extends AbstractOperation<GeneratedVersionOperation>
Generates a project version data class.
- Since:
- 1.0
- Author:
- Erik C. Thauvin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the class name.classTemplate(File template) Sets the class template path.classTemplate(String template) Sets the class template path.classTemplate(Path template) Sets the class template path.Sets the destination directory.Sets the destination directory.Sets the destination directory.voidexecute()Sets the file extension.fromProject(BaseProject project) Configure the operation from aBaseProject.generateAnnotation(boolean generate) Determines if theGeneratedannotation class file should be created.Retrieves the generated version instance.packageName(String packageName) Sets the package name.projectName(String projectName) Sets the project name.Methods inherited from class rife.bld.operations.AbstractOperation
executeOnce, executeOnce, silent, silent, verbose, verbose
-
Constructor Details
-
GeneratedVersionOperation
public GeneratedVersionOperation()
-
-
Method Details
-
execute
- Specified by:
executein classAbstractOperation<GeneratedVersionOperation>- Throws:
ExitStatusException
-
className
Sets the class name.- Parameters:
className- the class name- Returns:
- this operation instance
- Throws:
NullPointerException- ifclassNameisnullIllegalArgumentException- ifclassNameis empty or invalid
-
classTemplate
Sets the class template path.- Parameters:
template- the template path- Returns:
- this operation instance
- Throws:
NullPointerException- iftemplateisnullIllegalArgumentException- iftemplateis blank
-
classTemplate
Sets the class template path.- Parameters:
template- the template path- Returns:
- this operation instance
- Throws:
NullPointerException- iftemplateisnull
-
classTemplate
Sets the class template path.- Parameters:
template- the template path- Returns:
- this operation instance
- Throws:
NullPointerException- iftemplateisnull
-
directory
Sets the destination directory.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryisnull
-
directory
Sets the destination directory.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryisnull
-
directory
Sets the destination directory.- Parameters:
directory- the destination directory- Returns:
- this operation instance
- Throws:
NullPointerException- ifdirectoryisnull
-
extension
Sets the file extension. (Default is:.java)The extension is stripped of leading/trailing whitespace and must start with a
.followed by at least one non-whitespace character (e.g.,.java,.kt).- Parameters:
extension- the file extension- Returns:
- this operation instance
- Throws:
NullPointerException- ifextensionisnullIllegalArgumentException- ifextensionafter trimming is not a.followed by at least one character
-
fromProject
Configure the operation from aBaseProject.Sets the following
GeneratedVersionoptions:- The
projectto the given project. - The
destination directoryto theproject's main java sourcedirectory, if not already set.
- Parameters:
project- the project- Returns:
- this operation instance
- Throws:
NullPointerException- ifprojectisnull
- The
-
generateAnnotation
Determines if theGeneratedannotation class file should be created.The class file is not overwritten if it already exists.
- Parameters:
generate-trueto generate the annotation;falseotherwise- Returns:
- this operation instance
-
generatedVersion
Retrieves the generated version instance.The returned object is intentionally mutable. It provides access to properties not directly exposed by this operation's fluent API.
- Returns:
- the generated version
-
packageName
Sets the package name.- Parameters:
packageName- the package name- Returns:
- this operation instance
- Throws:
NullPointerException- ifpackageNameisnull
-
projectName
Sets the project name.- Parameters:
projectName- the project name- Returns:
- this operation instance
- Throws:
NullPointerException- ifprojectNameisnull
-