01: package org.jzonic.jlo.formatter.tokens;
02:
03: import org.jzonic.jlo.LogRecord;
04:
05: /**
06: * This interface defines all methods that every token must implement. They
07: * are used by the TokenParser to replace all occurences of a text like ${xxx}
08: * with the output of the defined token.
09: *
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 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 getName();
33:
34: public void setParameterString(String txt);
35: }
|