myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r791348 - /myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java
Date Mon, 06 Jul 2009 00:27:45 GMT
Author: gpetracek
Date: Mon Jul  6 00:27:44 2009
New Revision: 791348

URL: http://svn.apache.org/viewvc?rev=791348&view=rev
Log:
EXTVAL-38 workaround for mojarra

Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java?rev=791348&r1=791347&r2=791348&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/renderkit/DefaultRenderKitWrapperFactory.java
Mon Jul  6 00:27:44 2009
@@ -20,6 +20,7 @@
 
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.util.ClassUtils;
 
 import javax.faces.render.RenderKit;
 
@@ -31,6 +32,9 @@
 public class DefaultRenderKitWrapperFactory extends AbstractRenderKitWrapperFactory
 {
     private RenderKit renderKit;
+    private static final String GENERIC_RENDER_KIT_WRAPPER_FACTORY =
+            "org.apache.myfaces.extensions.validator.generic.renderkit.GenericRenderKitWrapperFactory";
+    private static Boolean useGenericRenderKitWrapperFactory = null;
 
     protected RenderKit createWrapper(RenderKit renderKit)
     {
@@ -39,6 +43,20 @@
             logger.trace("extval renderkit wrapper created for " + renderKit.getClass().getName());
         }
 
+        //workaround for mojarra (EXTVAL-38)
+        if(useGenericRenderKitWrapperFactory == null)
+        {
+            Class genericFactory = ClassUtils.tryToLoadClassForName(GENERIC_RENDER_KIT_WRAPPER_FACTORY);
+            useGenericRenderKitWrapperFactory = genericFactory != null;
+        }
+
+        if(useGenericRenderKitWrapperFactory)
+        {
+            AbstractRenderKitWrapperFactory renderKitWrapperFactory = (AbstractRenderKitWrapperFactory)ClassUtils
+                    .tryToInstantiateClassForName(GENERIC_RENDER_KIT_WRAPPER_FACTORY);
+            return renderKitWrapperFactory.createWrapper(renderKit);
+        }
+
         if(this.renderKit == null)
         {
             this.renderKit = new ExtValRenderKit(renderKit);



Mime
View raw message