public abstract class AbstractParentMojo
extends org.apache.maven.plugin.AbstractMojo
Charset, MavenProject, and so
on.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SOURCE_FILE_EXTENSION
Default value for the C4 PlantUML files extension.
|
| Constructor and Description |
|---|
AbstractParentMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doExecute()
An abstract method to hold the children classes execution logic.
|
void |
execute()
The default implementation of
Mojo.execute(), that sets and validates shared parameters, then
calls the abstract method doExecute(), that needs to be implemented by children
classes. |
protected Charset |
getCurrentCharset()
Returns the current
Charset value. |
protected String |
getOutputDirectory()
Returns the project output directory path.
|
protected org.apache.maven.project.MavenProject |
getProject()
Returns the current
MavenProject instance. |
protected String |
getSourceFileExtension()
Returns the current sources filename extension.
|
protected void |
processOutputDirectoryFiles(Consumer<Path> pumlFileProcessor)
An utility method that enables the processing of the C4 PlantUML sources in the output directory.
|
protected void |
validateSourceFileExtension()
Validates that the current
sourceFileExtension property has a correct value, or sets it to the default
value and displays an error message. |
public static final String DEFAULT_SOURCE_FILE_EXTENSION
public final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
Mojo.execute(), that sets and validates shared parameters, then
calls the abstract method doExecute(), that needs to be implemented by children
classes.
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected abstract void doExecute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException - if there is an issue with the build that makes it impossible to continue.org.apache.maven.plugin.MojoFailureException - if there is any other kind of failures.protected Charset getCurrentCharset()
Charset value.Charset.protected String getOutputDirectory()
protected org.apache.maven.project.MavenProject getProject()
MavenProject instance.MavenProject instance.protected String getSourceFileExtension()
This is how the plugin will determine which files it should process.
protected void processOutputDirectoryFiles(Consumer<Path> pumlFileProcessor) throws IOException
pumlFileProcessor - the source file consumer method.IOException - if any I/O error happens while accessing a source file.protected void validateSourceFileExtension()
sourceFileExtension property has a correct value, or sets it to the default
value and displays an error message.Copyright © 2020. All rights reserved.