Class AbstractI18nGenerateMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.i18n.plugin.AbstractI18nMojo
org.nuiton.i18n.plugin.AbstractI18nGenerateMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
Direct Known Subclasses:
AbstractI18nParserMojo, CheckBundlesIntegrityMojo, GenerateMojo, GetterMojo

public abstract class AbstractI18nGenerateMojo extends AbstractI18nMojo
Created on 7/27/14.
Since:
3.3
Author:
Tony Chemit - chemit@codelutin.com
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin

    org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    Name to use as prefix of generated files.
    protected File
    Directory where to generate i18n files.

    Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo

    bundles, encoding, locales, mavenSession, project, silent, verbose

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Prend en compte qu'un getter a été détecté.
    protected File
    getGetterFile(File root, String getter, boolean create)
     
    protected boolean
     

    Methods inherited from class org.nuiton.plugin.AbstractPlugin

    acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, doAction, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile

    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

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

    execute, getLog, setLog
  • Field Details

    • artifactId

      @Parameter(property="i18n.artifactId", defaultValue="${project.artifactId}", readonly=true) protected String artifactId
      Name to use as prefix of generated files. Note : By default, use the artifact id.
    • out

      @Parameter(property="i18n.out", defaultValue="${basedir}/target/generated-sources/i18n", required=true) protected File out
      Directory where to generate i18n files.
  • Constructor Details

    • AbstractI18nGenerateMojo

      public AbstractI18nGenerateMojo()
  • Method Details

    • needGeneration

      protected boolean needGeneration()
      Returns:
      true si des getters ont etes enregistres pendant le cycle de vie, false sinon.
    • addGetter

      protected void addGetter()
      Prend en compte qu'un getter a été détecté. Cela veut dire qu'un goal de parser a détecté des clefs. Il faudra donc activer les goal get et gen.
    • getGetterFile

      protected File getGetterFile(File root, String getter, boolean create) throws IOException
      Parameters:
      root - le repertoire ou sont stockes les fichiers getter
      getter - le nom du getter
      create - true pour creer le fichier si non present
      Returns:
      le fichier i18n
      Throws:
      IOException - si probleme lors de la creation du fichier