1
2
3
4
5
6
7
8
9
10
11 package ch.qos.logback.core.joran.event;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import org.xml.sax.Attributes;
17
18 import ch.qos.logback.core.joran.action.Action;
19 import ch.qos.logback.core.joran.spi.ActionException;
20 import ch.qos.logback.core.joran.spi.InterpretationContext;
21
22 public class ListenAction extends Action implements InPlayListener {
23
24 List<SaxEvent> seList = new ArrayList<SaxEvent>();
25
26 @Override
27 public void begin(InterpretationContext ec, String name, Attributes attributes)
28 throws ActionException {
29 ec.addInPlayListener(this);
30 }
31
32 @Override
33 public void end(InterpretationContext ec, String name) throws ActionException {
34 ec.removeInPlayListener(this);
35
36 }
37
38 public void inPlay(SaxEvent event) {
39 seList.add(event);
40 }
41
42 public List<SaxEvent> getSeList() {
43 return seList;
44 }
45
46 }