1
2
3
4
5
6
7
8
9
10
11 package ch.qos.logback.core.joran.action.ext;
12
13 import org.xml.sax.Attributes;
14
15 import ch.qos.logback.core.joran.action.Action;
16 import ch.qos.logback.core.joran.spi.ActionException;
17 import ch.qos.logback.core.joran.spi.InterpretationContext;
18
19
20
21 public class IncAction extends Action {
22
23 static public int beginCount;
24 static public int endCount;
25 static public int errorCount;
26
27 static public void reset() {
28 beginCount = 0;
29 endCount = 0;
30 errorCount = 0;
31 }
32
33
34
35
36 public void begin(InterpretationContext ec, String name, Attributes attributes) throws ActionException {
37
38 beginCount++;
39 String val = attributes.getValue("increment");
40 if(!"1".equals(val)) {
41 errorCount++;
42 throw new ActionException();
43 }
44 }
45
46
47
48
49
50 public void end(InterpretationContext ec, String name) {
51 endCount++;
52 }
53 }