Commits

Anonymous committed ec80550

Add constructor that accepts a class. Part of fix for WW-571. Patch submitted by Sami Koivupalo.

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@312e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 83cdde2

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork/validator/DelegatingValidatorContext.java

         this.textProvider = makeTextProvider(object, localeProvider);
     }
 
+    public DelegatingValidatorContext(Class clazz) {
+        localeProvider = new ActionContextLocaleProvider();
+        textProvider = new TextProviderSupport(clazz, localeProvider);
+        validationAware = new LoggingValidationAware(clazz);
+    }
+
     //~ Methods ////////////////////////////////////////////////////////////////
 
     public void setActionErrors(Collection errorMessages) {
     private static class LoggingValidationAware implements ValidationAware {
         private Log log;
 
+        public LoggingValidationAware(Class clazz) {
+            log = LogFactory.getLog(clazz);
+        }
+
         public LoggingValidationAware(Object obj) {
             log = LogFactory.getLog(obj.getClass());
         }