Package org.apache.log4j.helpers
Class PatternParser
- java.lang.Object
-
- org.apache.log4j.helpers.PatternParser
-
public class PatternParser extends Object
Most of the work of thePatternLayout
class is delegated to the PatternParser class.It is this class that parses conversion patterns and creates a chained list of
OptionConverters
.- Since:
- 0.8.2
- Author:
- James P. Cakalic, Ceki Gülcü, Anders Kristensen
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBuffer
currentLiteral
protected FormattingInfo
formattingInfo
protected int
i
protected String
pattern
protected int
patternLength
-
Constructor Summary
Constructors Constructor Description PatternParser(String pattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addConverter(PatternConverter pc)
protected String
extractOption()
protected int
extractPrecisionOption()
The option is expected to be in decimal and positive.protected void
finalizeConverter(char c)
PatternConverter
parse()
-
-
-
Field Detail
-
currentLiteral
protected StringBuffer currentLiteral
-
patternLength
protected int patternLength
-
i
protected int i
-
formattingInfo
protected FormattingInfo formattingInfo
-
pattern
protected String pattern
-
-
Constructor Detail
-
PatternParser
public PatternParser(String pattern)
-
-
Method Detail
-
extractOption
protected String extractOption()
-
extractPrecisionOption
protected int extractPrecisionOption()
The option is expected to be in decimal and positive. In case of error, zero is returned.
-
parse
public PatternConverter parse()
-
finalizeConverter
protected void finalizeConverter(char c)
-
addConverter
protected void addConverter(PatternConverter pc)
-
-