org.nuiton.i18n.plugin.bundle
Class AbstractI18nBundleMojo

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

public abstract class AbstractI18nBundleMojo
extends AbstractI18nMojo

Created: 26 déc. 2009

Version:
$Revision: 1711 $

Mise a jour: $Date: 2010-03-09 19:18:28 +0100 (mar., 09 mars 2010) $ par : $Author: tchemit $

Author:
tchemit

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
protected  File collectOutputDir
          Repertoire ou generer les bundles.
protected  String collectOutputName
          Nom de base des fichiers qui contient les localisations des bundles.
 
Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
artifactId, bundles, encoding, genSrc, locales, out, project, silent, src, strictMode, verbose
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractI18nBundleMojo()
           
 
Method Summary
protected abstract  URL[] getCollectI18nResources(Locale locale)
          Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans ses dépendances).
protected  File getCollectOutputFile(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.i18n.plugin.AbstractI18nMojo
addGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, init, isVerbose, needGeneration, setEncoding, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addTestResourceDir, addUrlToUrlsList, afterExecute, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, doAction, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, 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
getLog, setLog
 

Field Detail

collectOutputDir

protected File collectOutputDir
Repertoire ou generer les bundles.

Since:
1.0.2
Is defined by:
expression:
${i18n.collectOutputDir}
default-value:
${basedir}/target/i18n
Is required.

collectOutputName

protected String collectOutputName
Nom de base des fichiers qui contient les localisations des bundles.

Since:
1.0.2
Is defined by:
expression:
${i18n.collectOutputName}
default-value:
collect-${project.artifactId}-i18n
Is required.
Constructor Detail

AbstractI18nBundleMojo

public AbstractI18nBundleMojo()
Method Detail

getCollectI18nResources

protected abstract URL[] getCollectI18nResources(Locale locale)
                                          throws 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:
Exception - pour tout problème

getCollectOutputFile

protected File getCollectOutputFile(Locale locale,
                                    boolean create)
                             throws 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:
IOException - pour tout pb


Copyright © 2007-2010 CodeLutin. All Rights Reserved.