org.apache.log4j.helpers

Class PatternConverter


public abstract class PatternConverter
extends java.lang.Object

PatternConverter is an abtract class that provides the formatting functionality that derived classes need.

Conversion specifiers in a conversion patterns are parsed to individual PatternConverters. Each of which is responsible for converting a logging event in a converter specific manner.

Authors:
James P. Cakalic
Ceki Gülcü

Since:
0.8.2

Field Summary

PatternConverter
next

Constructor Summary

PatternConverter()
PatternConverter(FormattingInfo fi)

Method Summary

protected String
convert(LoggingEvent event)
Derived pattern converters must override this method in order to convert conversion specifiers in the correct way.
void
format(StringBuffer sbuf, LoggingEvent e)
A template method for formatting in a converter specific way.
void
spacePad(StringBuffer sbuf, int length)
Fast space padding method.

Field Details

next

public PatternConverter next

Constructor Details

PatternConverter

protected PatternConverter()


PatternConverter

protected PatternConverter(FormattingInfo fi)

Method Details

convert

protected String convert(LoggingEvent event)
Derived pattern converters must override this method in order to convert conversion specifiers in the correct way.


format

public void format(StringBuffer sbuf,
                   LoggingEvent e)
A template method for formatting in a converter specific way.


spacePad

public void spacePad(StringBuffer sbuf,
                     int length)
Fast space padding method.


Copyright 2000-2002 Apache Software Foundation.