|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.i18n.plugin.AbstractI18nMojo
org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo
org.nuiton.i18n.plugin.bundle.BundleMojo
public class BundleMojo
Créer un bundle pour une application finale.
Cela génère un merge de tous les fichiers i18n utilisés en un seul. On utilise la dépendance sur les artifacts pour connaitre l'ordre le chargement des bundles. Si dans un bundle childs, la valeur de la clef est vide, on conserve alors celui du parent, Ainsi on obtient un bundle dont toutes les clefs sont traduites. Le but aussi d'utiliser un unique bundle est de gagner du temps au runtime car la recherche des bundles devient trop couteuse en temps lorsque l'on a de nombreuses dépendances (au dessus de 100 deps cela peut prendre plusieurs secondes, ce qui 'est pas acceptable). On a ajoute un second mode d'initialisation dans la clesse I18n pour n'utiliser qu'un seul bundle et courcircuiter le chargement couteux...
| 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 |
bundleOutputDir
Repertoire ou generer les bundles. |
protected String |
bundleOutputName
Nom du bundle a generer. |
protected boolean |
checkBundle
Un drapeau pour vérifier que les bundles ne contiennent pas d'entrées vides. |
protected boolean |
showEmpty
Un drapeau pour afficher les entrées vides. |
| Fields inherited from class org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo |
|---|
collectOutputDir, collectOutputName |
| 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 | |
|---|---|
BundleMojo()
|
|
| Method Summary | |
|---|---|
protected void |
doAction()
|
protected URL[] |
getCollectI18nResources(Locale locale)
Pour obtenir les urls des fichiers i18n d'un projet (avec recherche dans ses dépendances). |
void |
init()
|
| Methods inherited from class org.nuiton.i18n.plugin.bundle.AbstractI18nBundleMojo |
|---|
getCollectOutputFile, getLinesAsURL |
| Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo |
|---|
addGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, isSilent, isStrictMode, 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, 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 |
|---|
protected File bundleOutputDir
protected String bundleOutputName
protected boolean checkBundle
protected boolean showEmpty
checkBundle activé).
| Constructor Detail |
|---|
public BundleMojo()
| Method Detail |
|---|
public void init()
throws Exception
init in class AbstractI18nMojoException
protected void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginException
protected URL[] getCollectI18nResources(Locale locale)
throws IOException
AbstractI18nBundleMojo
getCollectI18nResources in class AbstractI18nBundleMojolocale - la locale a traiter
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||