org.apache.log4j.helpers

Class PatternParser


public class PatternParser
extends Object

Most of the work of the PatternLayout class is delegated to the PatternParser class.

It is this class that parses conversion patterns and creates a chained list of OptionConverters.

Authors:
James P. Cakalic
Ceki Gülcü
Anders Kristensen
Since:
0.8.2

Field Summary

protected StringBuffer
currentLiteral
protected FormattingInfo
formattingInfo
protected int
i
protected String
pattern
protected int
patternLength

Constructor Summary

PatternParser(String pattern)

Method Summary

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 Details

currentLiteral

protected StringBuffer currentLiteral

formattingInfo

protected FormattingInfo formattingInfo

i

protected int i

pattern

protected String pattern

patternLength

protected int patternLength

Constructor Details

PatternParser

public PatternParser(String pattern)

Method Details

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.