Package org.nuiton.i18n.plugin
Class AbstractI18nMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.i18n.plugin.AbstractI18nMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.nuiton.plugin.Plugin,org.nuiton.plugin.PluginWithEncoding
- Direct Known Subclasses:
AbstractCsvBundleMojo,AbstractI18nBundleMojo,AbstractI18nGenerateMojo,GenerateI18nEnumHelperMojo
public abstract class AbstractI18nMojo
extends org.nuiton.plugin.AbstractPlugin
implements org.nuiton.plugin.PluginWithEncoding
Lower level i18n mojo abstraction.
We defines here all commons parameters and shared behaviour.
- Author:
- Tony Chemit - chemit@codelutin.com, Julien Ruchaud - ruchaud@codelutin.com
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringbundlesLocales to treate, separated by comma.protected java.lang.StringencodingEncoding used to load and store properties.protected java.util.Locale[]localeslocales to processprotected org.apache.maven.execution.MavenSessionmavenSessionprotected org.apache.maven.project.MavenProjectprojectDependance du projet.protected booleansilentSilent flag to see only errors in console.protected booleanverboseVerbose flag. -
Constructor Summary
Constructors Constructor Description AbstractI18nMojo() -
Method Summary
Modifier and Type Method Description protected voidbackupFile(java.io.File f)protected voidcheckBundle(java.util.Locale locale, java.util.Properties propertiesOut, boolean showEmpty, BundleValidation bundleValidation)protected booleancheckPackaging()protected voidfailsIfAnyKeyMissingInBundle(boolean failsIfWarning, BundleValidation bundleValidation)protected voidfailsIfAnyKeyMissingValue(boolean failsIfWarning, BundleValidation bundleValidation)java.io.FilegetBackupFile(java.io.File file)java.lang.StringgetEncoding()org.apache.maven.project.MavenProjectgetProject()voidinit()booleanisSilent()booleanisVerbose()voidsetEncoding(java.lang.String encoding)voidsetProject(org.apache.maven.project.MavenProject project)voidsetVerbose(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, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
mavenSession
@Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession mavenSession -
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectDependance du projet.- Since:
- 1.0.2
-
bundles
@Parameter(property="i18n.bundles", defaultValue="fr_FR,en_GB", required=true) protected java.lang.String bundlesLocales to treate, separated by comma. Example :fr_FR,en_GB
-
encoding
@Parameter(property="i18n.encoding", defaultValue="${project.build.sourceEncoding}", required=true) protected java.lang.String encodingEncoding used to load and store properties. -
verbose
@Parameter(property="i18n.verbose", defaultValue="${maven.verbose}") protected boolean verboseVerbose flag. Note : if not setted, we used themaven.verboseproperty. -
silent
@Parameter(property="i18n.silent", defaultValue="false") protected boolean silentSilent flag to see only errors in console.- Since:
- 1.0.0-rc-5
-
locales
protected java.util.Locale[] localeslocales to process
-
-
Constructor Details
-
AbstractI18nMojo
public AbstractI18nMojo()
-
-
Method Details
-
checkPackaging
protected boolean checkPackaging()- Overrides:
checkPackagingin classorg.nuiton.plugin.AbstractPlugin
-
init
public void init() throws java.lang.Exception- Specified by:
initin classorg.nuiton.plugin.AbstractPlugin- Throws:
java.lang.Exception
-
checkBundle
protected void checkBundle(java.util.Locale locale, java.util.Properties propertiesOut, boolean showEmpty, BundleValidation bundleValidation) -
getBackupFile
public java.io.File getBackupFile(java.io.File file)- Overrides:
getBackupFilein classorg.nuiton.plugin.AbstractPlugin
-
backupFile
protected void backupFile(java.io.File f) throws java.io.IOException- Overrides:
backupFilein classorg.nuiton.plugin.AbstractPlugin- Throws:
java.io.IOException
-
getProject
public org.apache.maven.project.MavenProject getProject()- Specified by:
getProjectin interfaceorg.nuiton.plugin.Plugin
-
setProject
public void setProject(org.apache.maven.project.MavenProject project)- Specified by:
setProjectin interfaceorg.nuiton.plugin.Plugin
-
isVerbose
public boolean isVerbose()- Specified by:
isVerbosein interfaceorg.nuiton.plugin.Plugin
-
setVerbose
public void setVerbose(boolean verbose)- Specified by:
setVerbosein interfaceorg.nuiton.plugin.Plugin
-
isSilent
public boolean isSilent() -
getEncoding
public java.lang.String getEncoding()- Specified by:
getEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-
setEncoding
public void setEncoding(java.lang.String encoding)- Specified by:
setEncodingin interfaceorg.nuiton.plugin.PluginWithEncoding
-
failsIfAnyKeyMissingValue
protected void failsIfAnyKeyMissingValue(boolean failsIfWarning, BundleValidation bundleValidation) throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
failsIfAnyKeyMissingInBundle
protected void failsIfAnyKeyMissingInBundle(boolean failsIfWarning, BundleValidation bundleValidation) throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-