Class AbstractI18nBundleMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.i18n.plugin.AbstractI18nMojo
org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding
Direct Known Subclasses:
BundleMojo, CollectI18nArtifactsMojo

public abstract class AbstractI18nBundleMojo
extends AbstractI18nMojo
Created: 26 déc. 2009
Since:
1.0
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 java.io.File collectOutputDir
    Directory where to generate bundles.
    protected java.lang.String collectOutputName
    BAse name of file which contains bundles locations.

    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
    AbstractI18nBundleMojo()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract java.net.URL[] getCollectI18nResources​(java.util.Locale locale)
    Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans ses dépendances).
    protected java.io.File getCollectOutputFile​(java.util.Locale locale, boolean create)
    Pour obtenir le fichier contenant les localisation des bundles i18n du projet pour une locale donnée.

    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

    • collectOutputDir

      @Parameter(property="i18n.collectOutputDir", defaultValue="${basedir}/target/i18n", required=true) protected java.io.File collectOutputDir
      Directory where to generate bundles.
      Since:
      1.0.2
    • collectOutputName

      @Parameter(property="i18n.collectOutputName", defaultValue="collect-${project.artifactId}-i18n", required=true) protected java.lang.String collectOutputName
      BAse name of file which contains bundles locations.
      Since:
      1.0.2
  • Constructor Details

  • Method Details

    • getCollectI18nResources

      protected abstract java.net.URL[] getCollectI18nResources​(java.util.Locale locale) throws java.lang.Exception
      Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans ses dépendances). Note: L'ordre des urls reflète l'ordre des dépendances.
      Parameters:
      locale - la locale a traiter
      Returns:
      les urls des bundles i18n detectees pour le projet.
      Throws:
      java.lang.Exception - pour tout problème
    • getCollectOutputFile

      protected java.io.File getCollectOutputFile​(java.util.Locale locale, boolean create) throws java.io.IOException
      Pour obtenir le fichier contenant les localisation des bundles i18n du projet pour une locale donnée.
      Parameters:
      locale - la locale
      create - un drapeau pour forcer la création du fichier s'il n'existe pas
      Returns:
      le fichier qui contient les urls des bundles i18n pour la locale donnée.
      Throws:
      java.io.IOException - pour tout pb