Class AbstractParserXmlMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
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
  • Field Details

    • BUFFER_SIZE

      protected static final int BUFFER_SIZE
      Taille du buffer pour les lectures/écritures
      See Also:
      Constant Field Values
    • rules

      protected java.lang.String rules
      available rules to detect i18n keys in xml files.
    • factory

      protected javax.xml.xpath.XPathFactory factory
      XPath factory used to detect i18n keys in xml files.
    • documentBuilderFactory

      protected javax.xml.parsers.DocumentBuilderFactory documentBuilderFactory
      Document builder factory to load xml files.
    • userRulesFiles

      @Parameter protected java.lang.String[] userRulesFiles
      Extra rules files to use for detecting i18n keys in xml validation files. Note : If the coreRulesFile is not defined, then you must fill this parameter.
      Since:
      2.0
    • namespaces

      @Parameter protected java.util.Map<java.lang.String,​java.lang.String> 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

  • 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:
      init in class AbstractI18nParserMojo
      Throws:
      java.lang.Exception
    • getUserRuleFiles

      public final java.lang.String[] getUserRuleFiles()
    • newFileParser

      public final FileParser newFileParser​(java.util.regex.Pattern acceptPattern)
      Specified by:
      newFileParser in class AbstractI18nParserMojo
      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