001/** 002 * Logback: the reliable, generic, fast and flexible logging framework. 003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved. 004 * 005 * This program and the accompanying materials are dual-licensed under 006 * either the terms of the Eclipse Public License v1.0 as published by 007 * the Eclipse Foundation 008 * 009 * or (per the licensee's choosing) 010 * 011 * under the terms of the GNU Lesser General Public License version 2.1 012 * as published by the Free Software Foundation. 013 */ 014package ch.qos.logback.core.rolling.helper; 015 016/** 017 * <code>TokenConverter</code> offers some basic functionality used by more 018 * specific token converters. 019 * <p> 020 * It basically sets up the chained architecture for tokens. It also forces 021 * derived classes to fix their type. 022 * 023 * @author Ceki 024 * @since 1.3 025 */ 026public class TokenConverter { 027 028 static final int IDENTITY = 0; 029 static final int INTEGER = 1; 030 static final int DATE = 1; 031 int type; 032 TokenConverter next; 033 034 protected TokenConverter(int t) { 035 type = t; 036 } 037 038 public TokenConverter getNext() { 039 return next; 040 } 041 042 public void setNext(TokenConverter next) { 043 this.next = next; 044 } 045 046 public int getType() { 047 return type; 048 } 049 050 public void setType(int i) { 051 type = i; 052 } 053 054}