Class FormatMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.spring.format.maven.FormatMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ApplyMojo, ValidateMojo

public abstract class FormatMojo extends org.apache.maven.plugin.AbstractMojo
Base class for formatter Mojo.
Author:
Phillip Webb
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.maven.project.MavenProject
    The Maven Project Object.
    protected org.apache.maven.execution.MavenSession
    The Maven Session Object.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
     
    protected abstract void
    execute(List<File> files, Charset encoding, String lineSeparator)
    Perform the formatting build-process behavior this Mojo implements.
    protected final FileFormatter
     
    protected boolean
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • project

      @Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
      The Maven Project Object.
    • session

      @Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
      The Maven Session Object.
  • Constructor Details

    • FormatMojo

      public FormatMojo()
  • Method Details

    • execute

      public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • execute

      protected abstract void execute(List<File> files, Charset encoding, String lineSeparator) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Perform the formatting build-process behavior this Mojo implements.
      Parameters:
      files - the files to process
      encoding - the encoding
      lineSeparator - the line separator
      Throws:
      org.apache.maven.plugin.MojoExecutionException - on execution error
      org.apache.maven.plugin.MojoFailureException - on failure
    • getFormatter

      protected final FileFormatter getFormatter()
    • skipGlobally

      protected boolean skipGlobally()