Class AbstractParserXmlMojo
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
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,I18nParserConfiguration,org.nuiton.plugin.Plugin,org.nuiton.plugin.PluginWithEncoding
- Direct Known Subclasses:
ParserValidationMojo,ParserXmlUserMojo
Abstract xml parser mojo.
- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com, Julien Ruchaud - ruchaud@codelutin.com
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intTaille du buffer pour les lectures/écrituresprotected DocumentBuilderFactoryDocument builder factory to load xml files.protected XPathFactoryXPath factory used to detect i18n keys in xml files.Defines namespaces mapping if needed.protected Stringavailable rules to detect i18n keys in xml files.protected String[]Extra rules files to use for detecting i18n keys in xml validation files.Fields 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.AbstractI18nGenerateMojo
artifactId, outFields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
bundles, encoding, locales, mavenSession, project, silent, verboseFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringObtain the list of files which define rules to apply.final String[]voidinit()protected Stringprotected StringloadRulesFile(String fileRules) final FileParsernewFileParser(Pattern acceptPattern) protected abstract AbstractParserXmlMojo.XmlFileParsernewXmlFileParser(XPath xpath, DocumentBuilder builder) Methods inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
addDefaultEntry, doAction, getDefaultBasedir, getDefaultExcludes, getDefaultIncludes, getLogEntry, getOutGetter, getResult, isForce, isShowTouchedFiles, isStrictMode, newFileUpdater, 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, isVerboseMethods inherited from interface org.apache.maven.plugin.Mojo
execute, getLog, setLog
-
Field Details
-
BUFFER_SIZE
protected static final int BUFFER_SIZETaille du buffer pour les lectures/écritures- See Also:
-
rules
available rules to detect i18n keys in xml files. -
factory
XPath factory used to detect i18n keys in xml files. -
documentBuilderFactory
Document builder factory to load xml files. -
userRulesFiles
Extra rules files to use for detecting i18n keys in xml validation files. Note : If thecoreRulesFileis not defined, then you must fill this parameter.- Since:
- 2.0
-
namespaces
Defines namespaces mapping if needed. Example :<namespaces> <s>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</s> </namespaces>
- Since:
- 2.0
-
-
Constructor Details
-
AbstractParserXmlMojo
public AbstractParserXmlMojo()
-
-
Method Details
-
getCoreRuleFile
-
newXmlFileParser
protected abstract AbstractParserXmlMojo.XmlFileParser newXmlFileParser(XPath xpath, DocumentBuilder builder) -
getRulefiles
Obtain the list of files which define rules to apply.- Returns:
- the list of path to rule files to used.
-
init
- Overrides:
initin classAbstractI18nParserMojo- Throws:
Exception
-
getUserRuleFiles
-
newFileParser
- Specified by:
newFileParserin classAbstractI18nParserMojo- Parameters:
acceptPattern- optional pattern to accept incoming keys- Returns:
- a new file parser to be used in the parser consumer parserExecutor
-
loadRules
-
loadRulesFile
- Throws:
IOException
-