|
||||||||||
| 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
public abstract class AbstractI18nMojo
Lower level i18n mojo abstraction.
We defines here all commons parameters and shared behaviour.
| 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 String |
artifactId
Name to use as prefix of generated files. |
protected String |
bundles
Locales to treate, separated by comma. |
protected String |
encoding
Encoding used to load and store properties. |
protected boolean |
genSrc
To update generated files to user i18n files. |
protected Locale[] |
locales
locales to process |
protected File |
out
Directory where to generate i18n files. |
protected org.apache.maven.project.MavenProject |
project
Dependance du projet. |
protected boolean |
silent
Silent flag to see only errors in console. |
protected File |
src
Directory where to find project i18n files. |
protected boolean |
strictMode
Strict mode to only keep in user i18n detected i18n keys and remove obsolete keys. |
protected boolean |
verbose
Verbose flag. |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractI18nMojo()
|
|
| Method Summary | |
|---|---|
protected void |
addGetter()
Prend en compte qu'un getter a été détecté. |
protected void |
backupFile(File f)
|
protected void |
checkBundle(Locale locale,
Properties propertiesOut,
boolean showEmpty,
Map<Locale,SortedSet<String>> unsafeHolder)
|
protected boolean |
checkPackaging()
|
String |
getArtifactId()
|
File |
getBackupFile(File file)
|
String |
getEncoding()
|
File |
getGetterFile(File root,
String getter,
boolean create)
|
File |
getI18nFile(File root,
String artifactId,
Locale locale,
boolean create)
|
org.apache.maven.project.MavenProject |
getProject()
|
void |
init()
|
boolean |
isSilent()
|
boolean |
isStrictMode()
|
boolean |
isVerbose()
|
protected boolean |
needGeneration()
|
void |
setEncoding(String encoding)
|
void |
setProject(org.apache.maven.project.MavenProject project)
|
void |
setVerbose(boolean verbose)
|
| 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, 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 Detail |
|---|
protected org.apache.maven.project.MavenProject project
protected String artifactId
protected String bundles
fr_FR,en_GB
protected File src
protected File out
protected String encoding
protected boolean genSrc
protected boolean verbose
maven.verbose property.
protected boolean silent
protected boolean strictMode
protected Locale[] locales
| Constructor Detail |
|---|
public AbstractI18nMojo()
| Method Detail |
|---|
protected boolean checkPackaging()
checkPackaging in class org.nuiton.plugin.AbstractPlugin
public void init()
throws Exception
init in class org.nuiton.plugin.AbstractPluginExceptionpublic String getArtifactId()
protected boolean needGeneration()
true si des getters ont etes enregistres pendant le
cycle de vie, false sinon.protected void addGetter()
public File getI18nFile(File root,
String artifactId,
Locale locale,
boolean create)
throws IOException
root - le repertoire ou sont stockes les fichiers i18nartifactId - le nom de l'artifactlocale - le nom de la locale (peut-être nulle)create - true pour creer le fichier si non present
IOException - si probleme lors de la creation du fichier
public File getGetterFile(File root,
String getter,
boolean create)
throws IOException
root - le repertoire ou sont stockes les fichiers gettergetter - le nom du gettercreate - true pour creer le fichier si non present
IOException - si probleme lors de la creation du fichier
protected void checkBundle(Locale locale,
Properties propertiesOut,
boolean showEmpty,
Map<Locale,SortedSet<String>> unsafeHolder)
public File getBackupFile(File file)
getBackupFile in class org.nuiton.plugin.AbstractPlugin
protected void backupFile(File f)
throws IOException
backupFile in class org.nuiton.plugin.AbstractPluginIOExceptionpublic org.apache.maven.project.MavenProject getProject()
getProject in interface org.nuiton.plugin.Pluginpublic void setProject(org.apache.maven.project.MavenProject project)
setProject in interface org.nuiton.plugin.Pluginpublic boolean isVerbose()
isVerbose in interface org.nuiton.plugin.Pluginpublic void setVerbose(boolean verbose)
setVerbose in interface org.nuiton.plugin.Pluginpublic boolean isSilent()
public boolean isStrictMode()
public String getEncoding()
getEncoding in interface org.nuiton.plugin.PluginWithEncodingpublic void setEncoding(String encoding)
setEncoding in interface org.nuiton.plugin.PluginWithEncoding
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||