KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > formatter > tokens > FormatterToken


1 package org.jzonic.jlo.formatter.tokens;
2
3 import org.jzonic.jlo.LogRecord;
4
5 /**
6  * This interface defines all methods that every token must implement. They
7  * are used by the TokenParser to replace all occurences of a text like ${xxx}
8  * with the output of the defined token.
9  *
10  * @author Andreas Mecky
11  * @author Terry Dye
12  */

13 public interface FormatterToken {
14
15     /**
16      * This method should take the LogRecord and return the desired output
17      * as String. The token itself will then be replaced in the format String
18      * with this output
19      *
20      * @param lr the LogRecord
21      * @return the formatted String
22      */

23     public String JavaDoc format(LogRecord lr);
24
25     /**
26      * This method returns the name of the token. This name will
27      * be used during by the parser to detect a FormatterToken
28      * within the text
29      *
30      * @return the name of the FormatterToken
31      */

32     public String JavaDoc getName();
33
34     public void setParameterString(String JavaDoc txt);
35 }
36
Popular Tags