1 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 24 public class EvaluationContextImpl implements EvaluationContext 25 { 26 private ClassResolver _resolver; 27 28 public EvaluationContextImpl(ClassResolver resolver) 29 { 30 Defense.notNull(resolver, "resolver"); 31 32 _resolver = resolver; 33 } 34 35 public boolean isPropertySet(String propertyName) 36 { 37 return Boolean.getBoolean(propertyName); 38 } 39 40 public boolean doesClassExist(String className) 41 { 42 try 43 { 44 _resolver.findClass(className); 45 46 return true; 47 } 48 catch (ApplicationRuntimeException ex) 49 { 50 return false; 51 } 52 } 53 54 } | Popular Tags |