Class ParserValidationMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.nuiton.plugin.AbstractPlugin
-
- org.nuiton.i18n.plugin.AbstractI18nMojo
-
- org.nuiton.i18n.plugin.AbstractI18nGenerateMojo
-
- org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
-
- org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
-
- org.nuiton.i18n.plugin.parser.impl.ParserValidationMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,I18nParserConfiguration
,org.nuiton.plugin.Plugin
,org.nuiton.plugin.PluginWithEncoding
@Mojo(name="parserValidation", defaultPhase=GENERATE_RESOURCES) public class ParserValidationMojo extends AbstractParserXmlMojo
Find i18n keys from xworks xml validation files. Note: this goal must always be invoked before theprocess-resources
phase, otherwise all files will be considered as uptodate.- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
AbstractParserXmlMojo.XmlFileParser
-
-
Field Summary
Fields Modifier and Type Field Description protected String
coreRuleFile
Defines the core rules file used to detect i18n keys in xml validation files.static String
DEFAULT_INCLUDES
protected File
defaultBasedir
Root directory of the default entry.protected String
defaultIncludes
Default included files to process (ant-like expression).protected String
outputGetter
Defines the file name of the getter where to put detected i18n keys while getter phase.protected boolean
useLocalResolver
Always use the local xworks dtd to increase performance.-
Fields inherited from class org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
BUFFER_SIZE, documentBuilderFactory, factory, namespaces, rules, userRulesFiles
-
Fields inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
acceptKeyFormat, acceptPattern, backupGetter, cp, entries, force, oldLanguage, oldParser, showTouchedFiles, src, strictMode, t0, treateDefaultEntry
-
Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nGenerateMojo
artifactId, out
-
Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
bundles, encoding, locales, mavenSession, project, silent, verbose
-
-
Constructor Summary
Constructors Constructor Description ParserValidationMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getCoreRuleFile()
File
getDefaultBasedir()
String[]
getDefaultExcludes()
String[]
getDefaultIncludes()
protected String
getOutGetter()
org.nuiton.io.FileUpdater
newFileUpdater(SourceEntry entry)
protected AbstractParserXmlMojo.XmlFileParser
newXmlFileParser(XPath xpath, DocumentBuilder builder)
-
Methods inherited from class org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
getRulefiles, getUserRuleFiles, init, loadRules, loadRulesFile, newFileParser
-
Methods inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
addDefaultEntry, doAction, getLogEntry, getResult, isForce, isShowTouchedFiles, isStrictMode, onEnterEntry, saveGetterFile
-
Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nGenerateMojo
addGetter, getGetterFile, needGeneration
-
Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
backupFile, checkBundle, checkPackaging, failsIfAnyKeyMissingInBundle, failsIfAnyKeyMissingValue, getBackupFile, getEncoding, getProject, isSilent, isVerbose, setEncoding, setProject, setVerbose
-
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, 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, 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.nuiton.i18n.plugin.parser.I18nParserConfiguration
getLog, isSilent, isVerbose
-
-
-
-
Field Detail
-
DEFAULT_INCLUDES
public static final String DEFAULT_INCLUDES
- See Also:
- Constant Field Values
-
defaultBasedir
@Parameter(property="i18n.defaultBasedir", defaultValue="${basedir}/src/main/resources", required=true) protected File defaultBasedir
Root directory of the default entry.
-
defaultIncludes
@Parameter(property="i18n.defaultIncludes", defaultValue="**/*-validation.xml", required=true) protected String defaultIncludes
Default included files to process (ant-like expression). Note: default value is **\/**-validation.xml
-
coreRuleFile
@Parameter(property="i18n.coreRuleFile", defaultValue="validation.rules", required=true) protected String coreRuleFile
Defines the core rules file used to detect i18n keys in xml validation files. Note : If you do not want to use it, set it to empty and fill theAbstractParserXmlMojo.userRulesFiles
parameter.- Since:
- 2.0
-
useLocalResolver
@Parameter(property="i18n.useLocalResolver", defaultValue="true") protected boolean useLocalResolver
Always use the local xworks dtd to increase performance.- Since:
- 1.6.0
-
outputGetter
@Parameter(property="i18n.outputGetter", defaultValue="validation.getter", required=true) protected String outputGetter
Defines the file name of the getter where to put detected i18n keys while getter phase.- Since:
- 2.0
-
-
Method Detail
-
getDefaultIncludes
public String[] getDefaultIncludes()
- Specified by:
getDefaultIncludes
in classAbstractI18nParserMojo
- Returns:
- the default includes to add to directory scanner
-
getDefaultExcludes
public String[] getDefaultExcludes()
- Specified by:
getDefaultExcludes
in classAbstractI18nParserMojo
- Returns:
- the default excludes to add to directory scanner
-
getDefaultBasedir
public File getDefaultBasedir()
- Specified by:
getDefaultBasedir
in classAbstractI18nParserMojo
- Returns:
- the default src directory to use in directory scanner
-
newFileUpdater
public org.nuiton.io.FileUpdater newFileUpdater(SourceEntry entry)
- Specified by:
newFileUpdater
in classAbstractI18nParserMojo
- Parameters:
entry
- the incoming source entry to attach to the file updater- Returns:
- a new file updater to detects files to treate
-
getOutGetter
protected String getOutGetter()
- Specified by:
getOutGetter
in classAbstractI18nParserMojo
- Returns:
- the outGetter to use for the instance (java.getter,...)
-
getCoreRuleFile
protected String getCoreRuleFile()
- Specified by:
getCoreRuleFile
in classAbstractParserXmlMojo
-
newXmlFileParser
protected AbstractParserXmlMojo.XmlFileParser newXmlFileParser(XPath xpath, DocumentBuilder builder)
- Specified by:
newXmlFileParser
in classAbstractParserXmlMojo
-
-