1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.hivemind.conditional; |
16 |
| |
17 |
| import org.apache.hivemind.ApplicationRuntimeException; |
18 |
| import org.apache.hivemind.ClassResolver; |
19 |
| import org.apache.hivemind.util.Defense; |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| public class EvaluationContextImpl implements EvaluationContext |
25 |
| { |
26 |
| private ClassResolver _resolver; |
27 |
| |
28 |
4
| public EvaluationContextImpl(ClassResolver resolver)
|
29 |
| { |
30 |
4
| Defense.notNull(resolver, "resolver");
|
31 |
| |
32 |
4
| _resolver = resolver;
|
33 |
| } |
34 |
| |
35 |
2
| public boolean isPropertySet(String propertyName)
|
36 |
| { |
37 |
2
| return Boolean.getBoolean(propertyName);
|
38 |
| } |
39 |
| |
40 |
5
| public boolean doesClassExist(String className)
|
41 |
| { |
42 |
5
| try
|
43 |
| { |
44 |
5
| _resolver.findClass(className);
|
45 |
| |
46 |
3
| return true;
|
47 |
| } |
48 |
| catch (ApplicationRuntimeException ex) |
49 |
| { |
50 |
2
| return false;
|
51 |
| } |
52 |
| } |
53 |
| |
54 |
| } |