Class RegexReplacePipeline
- java.lang.Object
-
- ch.supertomcat.supertomcatutils.regex.RegexReplacePipeline
-
public class RegexReplacePipeline extends Object
RulePipeline
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerloggerLogger for this classprotected List<RegexReplace>regexReplacesRuleRegExpsprotected Stringtitletitle
-
Constructor Summary
Constructors Constructor Description RegexReplacePipeline(String title)ConstructorRegexReplacePipeline(String title, List<RegexReplace> regexReplaces)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRegExp(RegexReplace rre)Adds a RuleRegExp to the pipelineprotected StringdoReplacement(String input, boolean undoWhenEmpty, String replacementType)Returns the replaced StringRegexReplacegetRegexp(int index)Returns the RuleRegExpList<RegexReplace>getRegexps()Returns all RuleRegExpsStringgetReplacedFilename(String input)Returns the filename after replacementStringgetReplacedPageTitle(String input)Returns the page-title after replacementvoidremoveRegExp(int index)Removes a RuleRegExp from the pipelinevoidswapRegExp(int index1, int index2)Removes a RuleRegExp from the pipeline
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
Logger for this class
-
title
protected final String title
title
-
regexReplaces
protected final List<RegexReplace> regexReplaces
RuleRegExps
-
-
Constructor Detail
-
RegexReplacePipeline
public RegexReplacePipeline(String title)
Constructor- Parameters:
title- Title
-
RegexReplacePipeline
public RegexReplacePipeline(String title, List<RegexReplace> regexReplaces)
Constructor- Parameters:
title- TitleregexReplaces- Regex Replaces
-
-
Method Detail
-
doReplacement
protected String doReplacement(String input, boolean undoWhenEmpty, String replacementType)
Returns the replaced String- Parameters:
input- InputundoWhenEmpty- Undo replacement, when replaced String is emptyreplacementType- 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 Indexindex2- Second Index
-
removeRegExp
public void removeRegExp(int index)
Removes a RuleRegExp from the pipeline- Parameters:
index- Index in the array
-
-