1
2
3
4
5
6
7
8
9
10
11 package ch.qos.logback.core.joran.action.ext;
12
13
14 import org.xml.sax.Attributes;
15
16 import ch.qos.logback.core.joran.action.Action;
17 import ch.qos.logback.core.joran.spi.InterpretationContext;
18
19
20
21 public class TouchAction extends Action {
22
23 public static final String KEY = "touched";
24
25 public TouchAction() {
26 }
27
28
29
30
31 public void begin(InterpretationContext ec, String name, Attributes attributes) {
32 Integer i = (Integer) ec.getContext().getObject(KEY);
33 if(i == null) {
34 ec.getContext().putObject(KEY, new Integer(1));
35 } else {
36 ec.getContext().putObject(KEY, new Integer(i.intValue()+1));
37 }
38 }
39
40
41
42
43
44 public void end(InterpretationContext ec, String name) {
45 }
46 }