Class EqualsBaseReplacementConverter
- java.lang.Object
-
- org.apache.logging.log4j.core.pattern.AbstractPatternConverter
-
- org.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
- org.apache.logging.log4j.core.pattern.EqualsBaseReplacementConverter
-
- All Implemented Interfaces:
PatternConverter
- Direct Known Subclasses:
EqualsIgnoreCaseReplacementConverter
,EqualsReplacementConverter
public abstract class EqualsBaseReplacementConverter extends LogEventPatternConverter
Equals pattern converter.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<PatternFormatter>
formatters
private java.lang.String
substitution
private java.util.List<PatternFormatter>
substitutionFormatters
private java.lang.String
testString
-
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EqualsBaseReplacementConverter(java.lang.String name, java.lang.String style, java.util.List<PatternFormatter> formatters, java.lang.String testString, java.lang.String substitution, PatternParser parser)
Construct the converter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
equals(java.lang.String str, java.lang.StringBuilder buff, int from, int len)
Returns true if the specified String equals the specified section of the specified StringBuilder.void
format(LogEvent event, java.lang.StringBuilder toAppendTo)
Formats an event into a string buffer.(package private) void
parseSubstitution(LogEvent event, java.lang.StringBuilder substitutionBuffer)
Adds the parsed substitution text to the specified buffer.-
Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
format, handlesThrowable, isVariable
-
Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
-
-
-
Field Detail
-
formatters
private final java.util.List<PatternFormatter> formatters
-
substitutionFormatters
private final java.util.List<PatternFormatter> substitutionFormatters
-
substitution
private final java.lang.String substitution
-
testString
private final java.lang.String testString
-
-
Constructor Detail
-
EqualsBaseReplacementConverter
protected EqualsBaseReplacementConverter(java.lang.String name, java.lang.String style, java.util.List<PatternFormatter> formatters, java.lang.String testString, java.lang.String substitution, PatternParser parser)
Construct the converter.- Parameters:
name
- converter namestyle
- converter styleformatters
- The PatternFormatters to generate the text to manipulate.testString
- The test string.substitution
- The substitution string.parser
- The PatternParser.
-
-
Method Detail
-
format
public void format(LogEvent event, java.lang.StringBuilder toAppendTo)
Formats an event into a string buffer.- Specified by:
format
in classLogEventPatternConverter
- Parameters:
event
- event to format, may not be null.toAppendTo
- string buffer to which the formatted event will be appended. May not be null.
-
equals
protected abstract boolean equals(java.lang.String str, java.lang.StringBuilder buff, int from, int len)
Returns true if the specified String equals the specified section of the specified StringBuilder.- Parameters:
str
- the String to comparebuff
- the StringBuilder to compare a section offrom
- start index in the StringBuilderlen
- length of the section in the StringBuilder- Returns:
- true if equal, false otherwise
-
parseSubstitution
void parseSubstitution(LogEvent event, java.lang.StringBuilder substitutionBuffer)
Adds the parsed substitution text to the specified buffer.- Parameters:
event
- the current log eventsubstitutionBuffer
- the StringBuilder to append the parsed substitution text to
-
-