Package org.apache.log4j.helpers
Class PatternParser
- java.lang.Object
-
- org.apache.log4j.helpers.PatternParser
-
public class PatternParser extends java.lang.ObjectMost of the work of thePatternLayoutclass 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPatternParser.BasicPatternConverterprivate classPatternParser.CategoryPatternConverterprivate classPatternParser.ClassNamePatternConverterprivate static classPatternParser.DatePatternConverterprivate static classPatternParser.LiteralPatternConverterprivate classPatternParser.LocationPatternConverterprivate static classPatternParser.MDCPatternConverterprivate static classPatternParser.NamedPatternConverter
-
Field Summary
Fields Modifier and Type Field Description (package private) static intCLASS_LOCATION_CONVERTERprivate static intCONVERTER_STATEprotected java.lang.StringBuffercurrentLiteralprivate static intDOT_STATEprivate static charESCAPE_CHAR(package private) static intFILE_LOCATION_CONVERTERprotected FormattingInfoformattingInfo(package private) static intFULL_LOCATION_CONVERTER(package private) PatternConverterheadprotected inti(package private) static intLEVEL_CONVERTER(package private) static intLINE_LOCATION_CONVERTERprivate static intLITERAL_STATEprivate static intMAX_STATE(package private) static intMESSAGE_CONVERTER(package private) static intMETHOD_LOCATION_CONVERTERprivate static intMIN_STATE(package private) static intNDC_CONVERTERprotected java.lang.Stringpatternprotected intpatternLength(package private) static intRELATIVE_TIME_CONVERTER(package private) intstate(package private) PatternConvertertail(package private) static intTHREAD_CONVERTER
-
Constructor Summary
Constructors Constructor Description PatternParser(java.lang.String pattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddConverter(PatternConverter pc)private voidaddToList(PatternConverter pc)protected java.lang.StringextractOption()protected intextractPrecisionOption()The option is expected to be in decimal and positive.protected voidfinalizeConverter(char c)PatternConverterparse()
-
-
-
Field Detail
-
ESCAPE_CHAR
private static final char ESCAPE_CHAR
- See Also:
- Constant Field Values
-
LITERAL_STATE
private static final int LITERAL_STATE
- See Also:
- Constant Field Values
-
CONVERTER_STATE
private static final int CONVERTER_STATE
- See Also:
- Constant Field Values
-
DOT_STATE
private static final int DOT_STATE
- See Also:
- Constant Field Values
-
MIN_STATE
private static final int MIN_STATE
- See Also:
- Constant Field Values
-
MAX_STATE
private static final int MAX_STATE
- See Also:
- Constant Field Values
-
FULL_LOCATION_CONVERTER
static final int FULL_LOCATION_CONVERTER
- See Also:
- Constant Field Values
-
METHOD_LOCATION_CONVERTER
static final int METHOD_LOCATION_CONVERTER
- See Also:
- Constant Field Values
-
CLASS_LOCATION_CONVERTER
static final int CLASS_LOCATION_CONVERTER
- See Also:
- Constant Field Values
-
LINE_LOCATION_CONVERTER
static final int LINE_LOCATION_CONVERTER
- See Also:
- Constant Field Values
-
FILE_LOCATION_CONVERTER
static final int FILE_LOCATION_CONVERTER
- See Also:
- Constant Field Values
-
RELATIVE_TIME_CONVERTER
static final int RELATIVE_TIME_CONVERTER
- See Also:
- Constant Field Values
-
THREAD_CONVERTER
static final int THREAD_CONVERTER
- See Also:
- Constant Field Values
-
LEVEL_CONVERTER
static final int LEVEL_CONVERTER
- See Also:
- Constant Field Values
-
NDC_CONVERTER
static final int NDC_CONVERTER
- See Also:
- Constant Field Values
-
MESSAGE_CONVERTER
static final int MESSAGE_CONVERTER
- See Also:
- Constant Field Values
-
state
int state
-
currentLiteral
protected java.lang.StringBuffer currentLiteral
-
patternLength
protected int patternLength
-
i
protected int i
-
head
PatternConverter head
-
tail
PatternConverter tail
-
formattingInfo
protected FormattingInfo formattingInfo
-
pattern
protected java.lang.String pattern
-
-
Method Detail
-
addToList
private void addToList(PatternConverter pc)
-
extractOption
protected java.lang.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)
-
-