Log4j 1.3alpha-5

org.apache.log4j.pattern
Class PatternParser

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.pattern.PatternParser
All Implemented Interfaces:
Component

public class PatternParser
extends ComponentBase

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.

Since:
0.8.2
Author:
James P. Cakalic, Ceki Gülcü, Anders Kristensen, Paul Smith

Field Summary
protected  java.lang.StringBuffer currentLiteral
           
protected  FormattingInfo formattingInfo
           
protected  int i
           
protected  java.lang.String pattern
           
protected  int patternLength
           
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
PatternParser(java.lang.String pattern, LoggerRepository repository)
           
 
Method Summary
protected  void addConverter(PatternConverter pc)
           
protected  java.lang.String extractConverter(char lastChar)
          Extract the converter identifier found at position i.
protected  java.util.List extractOptions()
          Returns the option, null if not in the expected format.
protected  void finalizeConverter(char c)
          When finalizeConverter is called 'c' is the current conversion caracter and i points to the character following 'c'.
 java.util.Map getConverterRegistry()
          Returns the converter registry for this PatternParser instance.
 PatternConverter parse()
           
 void setConverterRegistry(java.util.Map converterRegistry)
          Set the converter registry for this PatternParser instance.
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, setLoggerRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentLiteral

protected java.lang.StringBuffer currentLiteral

patternLength

protected int patternLength

i

protected int i

formattingInfo

protected FormattingInfo formattingInfo

pattern

protected java.lang.String pattern
Constructor Detail

PatternParser

public PatternParser(java.lang.String pattern,
                     LoggerRepository repository)
Method Detail

extractConverter

protected java.lang.String extractConverter(char lastChar)
Extract the converter identifier found at position i. After this function returns, the variable i will point to the first char after the end of the converter identifier. If i points to a char which is not a character acceptable at the start of a unicode identifier, the value null is returned.


extractOptions

protected java.util.List extractOptions()
Returns the option, null if not in the expected format.


parse

public PatternConverter parse()

finalizeConverter

protected void finalizeConverter(char c)
When finalizeConverter is called 'c' is the current conversion caracter and i points to the character following 'c'.


addConverter

protected void addConverter(PatternConverter pc)

getConverterRegistry

public java.util.Map getConverterRegistry()
Returns the converter registry for this PatternParser instance.


setConverterRegistry

public void setConverterRegistry(java.util.Map converterRegistry)
Set the converter registry for this PatternParser instance.


Log4j 1.3alpha-5

Copyright 2000-2005 Apache Software Foundation.