Package org.slf4j.migrator.line
Class SingleConversionRule
- java.lang.Object
-
- org.slf4j.migrator.line.SingleConversionRule
-
- All Implemented Interfaces:
ConversionRule
public class SingleConversionRule extends java.lang.Object implements ConversionRule
This class represents a conversion rule It uses a Pattern and defines for each capturing group of this Pattern a replacement text
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
additionalLine
private java.util.regex.Pattern
pattern
private java.lang.String
replacementText
-
Constructor Summary
Constructors Constructor Description SingleConversionRule(java.util.regex.Pattern pattern, java.lang.String replacementText)
SingleConversionRule(java.util.regex.Pattern pattern, java.lang.String replacementText, java.lang.String additionalLine)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAdditionalLine()
Returns a non-null value if there should be an additional line following a match of this rule.java.util.regex.Pattern
getPattern()
java.lang.String
replace(java.util.regex.Matcher matcher)
Given replacement rules, replace each capturing group in matcher's pattern
-
-
-
Method Detail
-
getPattern
public java.util.regex.Pattern getPattern()
- Specified by:
getPattern
in interfaceConversionRule
-
replace
public java.lang.String replace(java.util.regex.Matcher matcher)
Description copied from interface:ConversionRule
Given replacement rules, replace each capturing group in matcher's pattern- Specified by:
replace
in interfaceConversionRule
- Returns:
- String
-
getAdditionalLine
public java.lang.String getAdditionalLine()
Description copied from interface:ConversionRule
Returns a non-null value if there should be an additional line following a match of this rule. In most cases this method returns null.- Specified by:
getAdditionalLine
in interfaceConversionRule
- Returns:
- String
-
-