1
2
3
4
5
6
7
8
9
10
11
12
13
14 package ch.qos.logback.core.joran.conditional;
15
16 import ch.qos.logback.core.spi.PropertyContainer;
17 import ch.qos.logback.core.util.OptionHelper;
18
19 public class PropertyWrapperForScripts {
20
21 PropertyContainer local;
22 PropertyContainer context;
23
24
25 public void setPropertyContainers(PropertyContainer local, PropertyContainer context) {
26 this.local = local;
27 this.context = context;
28 }
29
30 public boolean isNull(String k) {
31 String val = OptionHelper.propertyLookup(k, local, context);
32 return (val == null);
33 }
34
35 public boolean isDefined(String k) {
36 String val = OptionHelper.propertyLookup(k, local, context);
37 return (val != null);
38 }
39
40 public String p(String k) {
41 return property(k);
42 }
43
44 public String property(String k) {
45 String val = OptionHelper.propertyLookup(k, local, context);
46 if (val != null)
47 return val;
48 else
49 return "";
50 }
51 }