public abstract class AbstractI18nParserMojo extends AbstractI18nGenerateMojo implements I18nParserConfiguration
| Modifier and Type | Field and Description |
|---|---|
protected String |
acceptKeyFormat
A regex pattern to accept incoming keys.
|
protected Pattern |
acceptPattern |
protected boolean |
backupGetter
Flag to save previous getter in a backup before doing parsing.
|
protected File |
cp
Build directory (used to know if files in sources are up-to-date).
|
protected I18nSourceEntry[] |
entries
Source entries (src+includes+excludes) to process.
|
protected boolean |
force
To force reparse of all sources.
|
protected org.nuiton.io.SortedProperties |
oldLanguage |
protected org.nuiton.io.SortedProperties |
oldParser |
protected boolean |
showTouchedFiles
Flag to display touched files while parsing.
|
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 long |
t0 |
protected boolean |
treateDefaultEntry
To treat default entry offered by the mojo.
|
artifactId, outbundles, encoding, locales, mavenSession, project, silent, verbose| Constructor and Description |
|---|
AbstractI18nParserMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDefaultEntry()
Add the default entry to entries given in configuration.
|
protected void |
doAction() |
protected abstract File |
getDefaultBasedir() |
protected abstract String[] |
getDefaultExcludes() |
protected abstract String[] |
getDefaultIncludes() |
static String |
getLogEntry(String msg,
int nbFiles,
long time,
long all)
Construit une chaine de log formatée.
|
protected abstract String |
getOutGetter() |
org.nuiton.io.SortedProperties |
getResult() |
void |
init() |
boolean |
isForce() |
boolean |
isShowTouchedFiles() |
boolean |
isStrictMode() |
abstract FileParser |
newFileParser(Pattern acceptPattern) |
abstract org.nuiton.io.FileUpdater |
newFileUpdater(SourceEntry entry) |
protected boolean |
onEnterEntry(I18nSourceEntry entry) |
protected void |
saveGetterFile()
Save the result in the getter file.
|
addGetter, getGetterFile, needGenerationbackupFile, checkBundle, checkPackaging, failsIfAnyKeyMissingInBundle, failsIfAnyKeyMissingValue, getBackupFile, getEncoding, getProject, isSilent, isVerbose, setEncoding, setProject, setVerboseacceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFilegetLog, getPluginContext, setLog, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLog, isSilent, isVerbose@Parameter(property="i18n.src",
defaultValue="${basedir}/src/main/resources/i18n",
required=true)
protected File src
@Parameter(property="i18n.strictMode",
defaultValue="false")
protected boolean strictMode
@Parameter(property="i18n.cp",
defaultValue="${basedir}/target/classes")
protected File cp
@Parameter(property="i18n.treateDefaultEntry",
defaultValue="true")
protected boolean treateDefaultEntry
@Parameter(property="i18n.entries") protected I18nSourceEntry[] entries
@Parameter(property="i18n.showTouchedFiles",
defaultValue="${maven.verbose}")
protected boolean showTouchedFiles
true if AbstractI18nMojo.verbose is
set at true.@Parameter(property="i18n.backupGetter",
defaultValue="false")
protected boolean backupGetter
@Parameter(property="i18n.force",
defaultValue="false")
protected boolean force
@Parameter(property="i18n.acceptKeyFormat") protected String acceptKeyFormat
protected Pattern acceptPattern
protected org.nuiton.io.SortedProperties oldParser
protected org.nuiton.io.SortedProperties oldLanguage
protected long t0
protected abstract String getOutGetter()
protected abstract String[] getDefaultIncludes()
protected abstract String[] getDefaultExcludes()
protected abstract File getDefaultBasedir()
public abstract FileParser newFileParser(Pattern acceptPattern)
acceptPattern - optional pattern to accept incoming keyspublic abstract org.nuiton.io.FileUpdater newFileUpdater(SourceEntry entry)
entry - the incoming source entry to attach to the file updaterpublic boolean isForce()
public void init()
throws Exception
init in class AbstractI18nMojoExceptionprotected boolean onEnterEntry(I18nSourceEntry entry)
protected void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginExceptionpublic boolean isShowTouchedFiles()
isShowTouchedFiles in interface I18nParserConfigurationpublic org.nuiton.io.SortedProperties getResult()
getResult in interface I18nParserConfigurationpublic boolean isStrictMode()
protected void addDefaultEntry()
protected void saveGetterFile()
throws IOException
IOException - if any io pbpublic static String getLogEntry(String msg, int nbFiles, long time, long all)
msg - le prefix du messagenbFiles - le nombre de fichiers actuellement traitéstime - le time de traitement de ce fichierall - le temps de traitement de tous les fichiersCopyright © 2007–2017 CodeLutin. All rights reserved.