コード例 #1
0
 protected static synchronized ActionValidator createValidatorSingleton(String className)
     throws ClassNotFoundException, IllegalAccessException, InstantiationException {
   if (ActionValidatorContext.getValue(className) == null) {
     ActionValidator validator = (ActionValidator) ReflectionUtil.createInstance(className);
     ActionValidatorContext.putValue(className, validator);
   }
   return ActionValidatorContext.getValue(className);
 }
コード例 #2
0
 public static ActionValidator getValidator(String className)
     throws ClassNotFoundException, IllegalAccessException, InstantiationException {
   if (ActionValidatorContext.getValue(className) != null) {
     return ActionValidatorContext.getValue(className);
   } else {
     return createValidatorSingleton(className);
   }
 }