1 17 18 19 20 package org.apache.lenya.workflow.impl; 21 22 import org.apache.lenya.workflow.Condition; 23 import org.apache.lenya.workflow.WorkflowException; 24 25 26 29 public final class ConditionFactory { 30 31 34 private ConditionFactory() { 35 } 36 37 44 protected static Condition createCondition(String className, String expression) 45 throws WorkflowException { 46 47 Condition condition; 48 49 try { 50 Class clazz = Class.forName(className); 51 condition = (Condition) clazz.newInstance(); 52 condition.setExpression(expression); 53 } catch (ClassNotFoundException e) { 54 throw new WorkflowException(e); 55 } catch (InstantiationException e) { 56 throw new WorkflowException(e); 57 } catch (IllegalAccessException e) { 58 throw new WorkflowException(e); 59 } 60 61 return condition; 62 } 63 } 64 | Popular Tags |