View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.rolling.helper;
15  
16  
17  /**
18   * <code>TokenConverter</code> offers some basic functionality used by more 
19   * specific token  converters. 
20   * <p>
21   * It basically sets up the chained architecture for tokens. It also forces 
22   * derived classes to fix their type.
23   * 
24   * @author Ceki
25   * @since 1.3
26   */
27  public class TokenConverter {
28    
29    
30    static final int IDENTITY = 0;
31    static final int INTEGER = 1;
32    static final int DATE = 1;
33    int type;
34    TokenConverter next;
35  
36    protected TokenConverter(int t) {
37      type = t;
38    }
39  
40    public TokenConverter getNext() {
41      return next;
42    }
43  
44    public void setNext(TokenConverter next) {
45      this.next = next;
46    }
47   
48    public int getType() {
49      return type;
50    }
51  
52    public void setType(int i) {
53      type = i;
54    }
55  
56  }