Klasse AbstractGitOutputMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitOutputMojo
Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Bekannte direkte Unterklassen:
ChangelogMojo, ContributorsMojo

abstract class AbstractGitOutputMojo extends AbstractGitMojo
This abstract Mojo implements writing output to a PrintStream This is either System.out by default, but maybe another PrintStream object wrapped around a file given by outputFile.
Seit:
0.2.2
Autor:
Sebastian Staudt
Siehe auch:
  • Felddetails

    • encoding

      @Parameter(property="mavanagaiata.encoding", defaultValue="UTF-8") String encoding
      The encoding to use for generated output
    • printStream

      PrintStream printStream
  • Konstruktordetails

    • AbstractGitOutputMojo

      AbstractGitOutputMojo()
  • Methodendetails

    • unescapeFormatNewlines

      static String unescapeFormatNewlines(String format)
      Unescapes newlines for format strings
      Parameter:
      format - The escaped format string
      Gibt zurück:
      The unescaped format string
    • initConfiguration

      protected void initConfiguration()
    • init

      protected GitRepository init() throws MavanagaiataMojoException
      Initializes the output stream for the generated content
      Setzt außer Kraft:
      init in Klasse AbstractGitMojo
      Gibt zurück:
      false if the execution should be skipped
      Löst aus:
      MavanagaiataMojoException - if the output file can not be opened
    • getOutputFile

      public abstract File getOutputFile()
      Returns the output file for the generated content

      Has to be implemented by subclassing mojos, so that the output file can be easily configured.

      Gibt zurück:
      The output file for the generated content
    • run

      protected final void run(GitRepository repository) throws MavanagaiataMojoException
      Initializes the PrintStream to use This is System.out if no output file is given (default). Otherwise the parent directories of outputFile are created and a new PrintStream for that file is created.
      Angegeben von:
      run in Klasse AbstractGitMojo
      Parameter:
      repository - The repository instance to use
      Löst aus:
      MavanagaiataMojoException - if the file specified by outputFile cannot be opened for writing or the target directory cannot be created
    • createPrintStream

      Creates a new print stream for the configured output file and encoding
      Gibt zurück:
      A new print stream
      Löst aus:
      FileNotFoundException - if the output file could not be found
      UnsupportedEncodingException - if the encoding is not supported
    • setOutputFile

      public abstract void setOutputFile(File outputFile)
      Sets the output file for the generated content
      Parameter:
      outputFile - The output file for the generated content
    • writeOutput

      protected abstract void writeOutput(GitRepository repository) throws MavanagaiataMojoException
      This must be implemented by mojos for writing their output
      Parameter:
      repository - The repository the mojo is running in
      Löst aus:
      MavanagaiataMojoException - if the output cannot be generated
    • generateOutput

      void generateOutput(GitRepository repository) throws MavanagaiataMojoException
      Writes the (optional) footer and flushes the PrintStream after calling the main mojo implementation
      Parameter:
      repository - The repository the mojo is running in
      Löst aus:
      MavanagaiataMojoException - if the output cannot be generated
      Siehe auch: