public abstract class AbstractMakeI18nBundleMojo extends AbstractI18nBundleMojo
| Modifier and Type | Field and Description |
|---|---|
protected String |
bundleInputEncoding
Encoding used to load any i18n property files.
|
protected File |
bundleOutputDir
Root directory where to generate aggregated bundles (this directory will
be added as resources of the project).
|
protected String |
bundleOutputEncoding
Encoding used to write any i18n property files.
|
protected String |
bundleOutputName
Name of the bundle to generate.
|
protected String |
bundleOutputPackage
Package name of the generate aggregated bundles.
|
protected boolean |
checkBundle
A flag to check that bundles are complete (no missing i18n translations).
|
protected boolean |
failsIfWarning
A flag to make the build fails if there is some warnings while generating
bundle, says when it misses some translations.
|
protected boolean |
generateDefaultLocale
A flag to generate a bundle with the first locale defined as a default
bundle (with no locale specialization).
|
protected File |
outputFolder
The definitive directory where to generate the bundles (includes the
package of bundle).
|
protected boolean |
showEmpty
A flag to show missing i18n translation.
|
protected Map<Locale,SortedSet<String>> |
unsafeMapping
to keep all none translated i18n keys by locale.
|
collectOutputDir, collectOutputNameartifactId, bundles, encoding, genSrc, locales, out, project, silent, src, strictMode, verbose| Constructor and Description |
|---|
AbstractMakeI18nBundleMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
failsIfWarning() |
protected void |
generateDefaultBundle()
Generates the default bundle, says the bundle with no locale specialized.
|
protected abstract File |
getBundleFile(File root,
String artifactId,
Locale locale,
boolean create)
Gets the bundle file for the given parameters.
|
String |
getBundleInputEncoding() |
String |
getBundleOutputEncoding() |
protected File |
getBundleOutputFolder() |
void |
init() |
getCollectI18nResources, getCollectOutputFileaddGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, isSilent, isStrictMode, isVerbose, needGeneration, setEncoding, setProject, setVerboseacceptPackaging, 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, writeFilegetLog, getPluginContext, setLog, setPluginContext@Parameter(property="i18n.bundleInputEncoding") protected String bundleInputEncoding
AbstractI18nMojo.encoding parameter.@Parameter(property="i18n.bundleOutputEncoding") protected String bundleOutputEncoding
AbstractI18nMojo.encoding parameter.@Parameter(property="i18n.bundleOutputDir",
defaultValue="${basedir}/target/generated-sources/resources",
required=true)
protected File bundleOutputDir
@Parameter(property="i18n.bundleOutputPackage",
defaultValue="META-INF",
required=true)
protected String bundleOutputPackage
META-INF package
since it is the favorite package of I18n runtime initializer.
The package name is dotted as it will be stored as folder like in Java
language.
Example :
package name : foo.bar
directory : foo/bar
@Parameter(property="i18n.bundleOutputName",
defaultValue="${project.artifactId}-i18n",
required=true)
protected String bundleOutputName
@Parameter(property="i18n.generateDefaultLocale",
defaultValue="false")
protected boolean generateDefaultLocale
@Parameter(property="i18n.checkBundle",
defaultValue="true")
protected boolean checkBundle
failsIfWarning is on.@Parameter(property="i18n.showEmpty",
defaultValue="false")
protected boolean showEmpty
checkBundle to be activated).@Parameter(property="i18n.failsIfWarning",
defaultValue="false")
protected boolean failsIfWarning
protected Map<Locale,SortedSet<String>> unsafeMapping
protected File outputFolder
public void init()
throws Exception
init in class AbstractI18nMojoExceptionprotected void failsIfWarning()
throws org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoFailureExceptionprotected abstract File getBundleFile(File root, String artifactId, Locale locale, boolean create) throws IOException
root - the root directory where bundles are storedartifactId - the artifactId (says the prefix of bundle)locale - the locale used in bundle (null means no locale specialized)create - a flag to create the file if none existingIOException - if any IO problem while creating it (if needed).protected void generateDefaultBundle()
throws IOException
IOException - if any IO problem while the copy.protected File getBundleOutputFolder()
public String getBundleOutputEncoding()
public String getBundleInputEncoding()
Copyright © 2007–2013 CodeLutin. All rights reserved.