Class ParserXmlUserMojo
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.ParserXmlUserMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,I18nParserConfiguration,org.nuiton.plugin.Plugin,org.nuiton.plugin.PluginWithEncoding
@Mojo(name="parserXml",
defaultPhase=GENERATE_RESOURCES)
public class ParserXmlUserMojo
extends AbstractParserXmlMojo
To obtain i18n keys from xml files using the
userRulesFiles (and
an optional coreRuleFile if any serves your purpose).
Note: this goal must always be invoked before the
process-resources phase, otherwise all files will be considered as
uptodate.- Since:
- 2.0
- 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 java.io.FilebasedirDefault directory where to look for files.protected java.lang.StringcoreRuleFileDefines an optional files which contain xpath rules to obtain i18n keys in xml files and is defined in plugin.protected java.lang.StringincludesDefines files to parse.protected java.lang.StringoutputGetterDefines the file name of the getter where to put detected i18n keys while getter phase.Fields inherited from class org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
BUFFER_SIZE, documentBuilderFactory, factory, namespaces, rules, userRulesFilesFields inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
acceptKeyFormat, acceptPattern, backupGetter, cp, entries, force, oldLanguage, oldParser, showTouchedFiles, src, strictMode, t0, treateDefaultEntryFields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
bundles, encoding, locales, mavenSession, project, silent, verbose -
Constructor Summary
Constructors Constructor Description ParserXmlUserMojo() -
Method Summary
Modifier and Type Method Description protected java.lang.StringgetCoreRuleFile()java.io.FilegetDefaultBasedir()java.lang.String[]getDefaultExcludes()java.lang.String[]getDefaultIncludes()protected java.lang.StringgetOutGetter()org.nuiton.io.FileUpdaternewFileUpdater(SourceEntry entry)protected AbstractParserXmlMojo.XmlFileParsernewXmlFileParser(javax.xml.xpath.XPath xpath, javax.xml.parsers.DocumentBuilder builder)Methods inherited from class org.nuiton.i18n.plugin.parser.impl.AbstractParserXmlMojo
getRulefiles, getUserRuleFiles, init, loadRules, loadRulesFile, newFileParserMethods inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
addDefaultEntry, doAction, getLogEntry, getResult, isForce, isShowTouchedFiles, isStrictMode, onEnterEntry, saveGetterFileMethods inherited from class org.nuiton.i18n.plugin.AbstractI18nGenerateMojo
addGetter, getGetterFile, needGenerationMethods inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
backupFile, checkBundle, checkPackaging, failsIfAnyKeyMissingInBundle, failsIfAnyKeyMissingValue, getBackupFile, getEncoding, getProject, isSilent, isVerbose, setEncoding, setProject, setVerboseMethods 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, writeFileMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.i18n.plugin.parser.I18nParserConfiguration
getLog, isSilent, isVerbose
-
Field Details
-
basedir
@Parameter(property="i18n.xmlBasedir", defaultValue="${basedir}/src/main/resources", required=true) protected java.io.File basedirDefault directory where to look for files.- Since:
- 2.0
-
includes
@Parameter(property="i18n.xmlIncludes", required=true) protected java.lang.String includesDefines files to parse.- Since:
- 2.0
-
coreRuleFile
@Parameter(property="i18n.coreRuleFiles") protected java.lang.String coreRuleFileDefines an optional files which contain xpath rules to obtain i18n keys in xml files and is defined in plugin.- Since:
- 2.0
-
outputGetter
@Parameter(property="i18n.outputGetter", defaultValue="xmlUser.getter", required=true) protected java.lang.String outputGetterDefines the file name of the getter where to put detected i18n keys while getter phase.- Since:
- 2.0
-
-
Constructor Details
-
ParserXmlUserMojo
public ParserXmlUserMojo()
-
-
Method Details
-
getDefaultIncludes
public java.lang.String[] getDefaultIncludes()- Specified by:
getDefaultIncludesin classAbstractI18nParserMojo- Returns:
- the default includes to add to directory scanner
-
getDefaultExcludes
public java.lang.String[] getDefaultExcludes()- Specified by:
getDefaultExcludesin classAbstractI18nParserMojo- Returns:
- the default excludes to add to directory scanner
-
getDefaultBasedir
public java.io.File getDefaultBasedir()- Specified by:
getDefaultBasedirin classAbstractI18nParserMojo- Returns:
- the default src directory to use in directory scanner
-
getCoreRuleFile
protected java.lang.String getCoreRuleFile()- Specified by:
getCoreRuleFilein classAbstractParserXmlMojo
-
newXmlFileParser
protected AbstractParserXmlMojo.XmlFileParser newXmlFileParser(javax.xml.xpath.XPath xpath, javax.xml.parsers.DocumentBuilder builder)- Specified by:
newXmlFileParserin classAbstractParserXmlMojo
-
getOutGetter
protected java.lang.String getOutGetter()- Specified by:
getOutGetterin classAbstractI18nParserMojo- Returns:
- the outGetter to use for the instance (java.getter,...)
-
newFileUpdater
- Specified by:
newFileUpdaterin classAbstractI18nParserMojo- Parameters:
entry- the incoming source entry to attach to the file updater- Returns:
- a new file updater to detects files to treate
-