1 package ch.qos.logback.core.pattern;
2
3 import java.util.List;
4
5 import ch.qos.logback.core.spi.LifeCycle;
6
7 abstract public class DynamicConverter<E> extends FormattingConverter<E> implements LifeCycle {
8
9
10 private List optionList;
11
12
13
14
15 boolean started = false;
16
17
18
19
20
21
22 public void start() {
23 started = true;
24 }
25
26 public void stop() {
27 started = false;
28 }
29
30 public boolean isStarted() {
31 return started;
32 }
33
34 public void setOptionList(List optionList) {
35 this.optionList = optionList;
36 }
37
38
39
40
41
42
43
44 protected String getFirstOption() {
45 if(optionList == null || optionList.size() == 0) {
46 return null;
47 } else {
48 return (String) optionList.get(0);
49 }
50 }
51
52 protected List getOptionList() {
53 return optionList;
54 }
55 }