org.apache.log4j.helpers

Class PatternParser

public class PatternParser extends Object

Most of the work of the {@link org.apache.log4j.PatternLayout} class is delegated to the PatternParser class.

It is this class that parses conversion patterns and creates a chained list of {@link OptionConverter OptionConverters}.

Since: 0.8.2

Author: James P. Cakalic Ceki Gülcü Anders Kristensen

Field Summary
protected StringBuffercurrentLiteral
protected FormattingInfoformattingInfo
protected inti
protected Stringpattern
protected intpatternLength
Constructor Summary
PatternParser(String pattern)
Method Summary
protected voidaddConverter(PatternConverter pc)
protected StringextractOption()
protected intextractPrecisionOption()
The option is expected to be in decimal and positive.
protected voidfinalizeConverter(char c)
PatternConverterparse()

Field Detail

currentLiteral

protected StringBuffer currentLiteral

formattingInfo

protected FormattingInfo formattingInfo

i

protected int i

pattern

protected String pattern

patternLength

protected int patternLength

Constructor Detail

PatternParser

public PatternParser(String pattern)

Method Detail

addConverter

protected void addConverter(PatternConverter pc)

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.

finalizeConverter

protected void finalizeConverter(char c)

parse

public PatternConverter parse()
Copyright 2000-2005 Apache Software Foundation.