KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jzonic.jlo.formatter.tokens;
2
3 import org.jzonic.jlo.LogRecord;
4
5 /**
6   * User: Mecky
7  * Date: 19.07.2005
8  * Time: 12:17:49
9   */

10 public class ShortClassToken implements FormatterToken {
11
12     public String JavaDoc format(LogRecord lr) {
13         String JavaDoc cl = lr.getSourceClassName();
14         if ( cl == null ) {
15             return null;
16         }
17         if ( cl.indexOf(".") != -1 ) {
18             return cl.substring(cl.lastIndexOf(".")+1);
19         }
20         return cl;
21     }
22
23     public String JavaDoc getName() {
24         return "shortclass";
25     }
26
27     public void setParameterString(String JavaDoc txt) {
28     }
29 }
30
Popular Tags