1
2
3
4
5
6
7
8
9
10
11
12
13
14 package chapters.onJoran.implicit;
15
16 import org.xml.sax.Attributes;
17
18 import ch.qos.logback.core.joran.action.ImplicitAction;
19 import ch.qos.logback.core.joran.spi.InterpretationContext;
20 import ch.qos.logback.core.joran.spi.Pattern;
21
22
23
24
25
26
27
28
29 public class PrintMeImplicitAction extends ImplicitAction {
30
31 public boolean isApplicable(Pattern pattern, Attributes attributes,
32 InterpretationContext ec) {
33 String printmeStr = attributes.getValue("printme");
34
35 return Boolean.valueOf(printmeStr).booleanValue();
36 }
37
38 public void begin(InterpretationContext ec, String name, Attributes attributes) {
39 System.out.println("Element [" + name + "] asked to be printed.");
40 }
41
42 public void end(InterpretationContext ec, String name) {
43 }
44 }