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
public abstract class AbstractParserXmlMojo extends AbstractI18nParserMojo
Abstract xml parser mojo.
- Since:
- 2.0
- Author:
- Tony Chemit - chemit@codelutin.com, Julien Ruchaud - ruchaud@codelutin.com
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractParserXmlMojo.XmlFileParser -
Field Summary
Fields Modifier and Type Field Description protected static intBUFFER_SIZETaille du buffer pour les lectures/écrituresprotected javax.xml.parsers.DocumentBuilderFactorydocumentBuilderFactoryDocument builder factory to load xml files.protected javax.xml.xpath.XPathFactoryfactoryXPath factory used to detect i18n keys in xml files.protected java.util.Map<java.lang.String,java.lang.String>namespacesDefines namespaces mapping if needed.protected java.lang.Stringrulesavailable rules to detect i18n keys in xml files.protected java.lang.String[]userRulesFilesExtra 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.AbstractI18nMojo
bundles, encoding, locales, mavenSession, project, silent, verbose -
Constructor Summary
Constructors Constructor Description AbstractParserXmlMojo() -
Method Summary
Modifier and Type Method Description protected abstract java.lang.StringgetCoreRuleFile()protected java.util.List<java.lang.String>getRulefiles()Obtain the list of files which define rules to apply.java.lang.String[]getUserRuleFiles()voidinit()protected java.lang.StringloadRules(java.util.List<java.lang.String> files)protected java.lang.StringloadRulesFile(java.lang.String fileRules)FileParsernewFileParser(java.util.regex.Pattern acceptPattern)protected abstract AbstractParserXmlMojo.XmlFileParsernewXmlFileParser(javax.xml.xpath.XPath xpath, javax.xml.parsers.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, isVerbose
-
Field Details
-
BUFFER_SIZE
protected static final int BUFFER_SIZETaille du buffer pour les lectures/écritures- See Also:
- Constant Field Values
-
rules
protected java.lang.String rulesavailable rules to detect i18n keys in xml files. -
factory
protected javax.xml.xpath.XPathFactory factoryXPath factory used to detect i18n keys in xml files. -
documentBuilderFactory
protected javax.xml.parsers.DocumentBuilderFactory documentBuilderFactoryDocument builder factory to load xml files. -
userRulesFiles
@Parameter protected java.lang.String[] userRulesFilesExtra 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
@Parameter protected java.util.Map<java.lang.String,java.lang.String> namespacesDefines 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
protected abstract java.lang.String getCoreRuleFile() -
newXmlFileParser
protected abstract AbstractParserXmlMojo.XmlFileParser newXmlFileParser(javax.xml.xpath.XPath xpath, javax.xml.parsers.DocumentBuilder builder) -
getRulefiles
protected java.util.List<java.lang.String> getRulefiles()Obtain the list of files which define rules to apply.- Returns:
- the list of path to rule files to used.
-
init
public void init() throws java.lang.Exception- Overrides:
initin classAbstractI18nParserMojo- Throws:
java.lang.Exception
-
getUserRuleFiles
public final java.lang.String[] 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
protected java.lang.String loadRules(java.util.List<java.lang.String> files) -
loadRulesFile
protected java.lang.String loadRulesFile(java.lang.String fileRules) throws java.io.IOException- Throws:
java.io.IOException
-