View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, 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   * <code>TokenConverter</code> offers some basic functionality used by more
18   * specific token converters.
19   * <p>
20   * It basically sets up the chained architecture for tokens. It also forces
21   * derived classes to fix their type.
22   * 
23   * @author Ceki
24   * @since 1.3
25   */
26  public class TokenConverter {
27  
28      static final int IDENTITY = 0;
29      static final int INTEGER = 1;
30      static final int DATE = 1;
31      int type;
32      TokenConverter next;
33  
34      protected TokenConverter(int t) {
35          type = t;
36      }
37  
38      public TokenConverter getNext() {
39          return next;
40      }
41  
42      public void setNext(TokenConverter next) {
43          this.next = next;
44      }
45  
46      public int getType() {
47          return type;
48      }
49  
50      public void setType(int i) {
51          type = i;
52      }
53  
54  }