Class RegexReplacePipeline


  • public class RegexReplacePipeline
    extends Object
    RulePipeline
    • Field Detail

      • logger

        protected org.slf4j.Logger logger
        Logger for this class
      • title

        protected final String title
        title
    • Constructor Detail

      • RegexReplacePipeline

        public RegexReplacePipeline​(String title)
        Constructor
        Parameters:
        title - Title
      • RegexReplacePipeline

        public RegexReplacePipeline​(String title,
                                    List<RegexReplace> regexReplaces)
        Constructor
        Parameters:
        title - Title
        regexReplaces - Regex Replaces
    • Method Detail

      • doReplacement

        protected String doReplacement​(String input,
                                       boolean undoWhenEmpty,
                                       String replacementType)
        Returns the replaced String
        Parameters:
        input - Input
        undoWhenEmpty - Undo replacement, when replaced String is empty
        replacementType - Replacement Type for logging
        Returns:
        Replaced String
      • getReplacedPageTitle

        public String getReplacedPageTitle​(String input)
        Returns the page-title after replacement
        Parameters:
        input - Input
        Returns:
        Replaced Page-Title
      • getReplacedFilename

        public String getReplacedFilename​(String input)
        Returns the filename after replacement
        Parameters:
        input - Input
        Returns:
        Replaced Filename
      • getRegexps

        public List<RegexReplace> getRegexps()
        Returns all RuleRegExps
        Returns:
        RuleRegExps
      • getRegexp

        public RegexReplace getRegexp​(int index)
        Returns the RuleRegExp
        Parameters:
        index - Index in the array
        Returns:
        RuleRegExp
      • addRegExp

        public void addRegExp​(RegexReplace rre)
        Adds a RuleRegExp to the pipeline
        Parameters:
        rre - RuleRegExp
      • swapRegExp

        public void swapRegExp​(int index1,
                               int index2)
        Removes a RuleRegExp from the pipeline
        Parameters:
        index1 - First Index
        index2 - Second Index
      • removeRegExp

        public void removeRegExp​(int index)
        Removes a RuleRegExp from the pipeline
        Parameters:
        index - Index in the array