myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r814106 - in /myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core: CustomInformation.java ExtValContext.java InformationProviderBean.java
Date Sat, 12 Sep 2009 03:56:20 GMT
Author: gpetracek
Date: Sat Sep 12 03:56:18 2009
New Revision: 814106

URL: http://svn.apache.org/viewvc?rev=814106&view=rev
Log:
EXTVAL-58 custom extval-context

Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/CustomInformation.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValContext.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/CustomInformation.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/CustomInformation.java?rev=814106&r1=814105&r2=814106&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/CustomInformation.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/CustomInformation.java
Sat Sep 12 03:56:18 2009
@@ -29,6 +29,8 @@
 public enum CustomInformation
 {
     BASE_PACKAGE,
+    EXTVAL_CONTEXT,
+
     COMPONENT_META_DATA_EXTRACTOR,
     VALIDATION_PARAMETER_EXTRACTOR,
 

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValContext.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValContext.java?rev=814106&r1=814105&r2=814106&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValContext.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ExtValContext.java
Sat Sep 12 03:56:18 2009
@@ -54,7 +54,7 @@
 {
     private final Log logger = LogFactory.getLog(getClass());
 
-    private static ExtValContext extValContext = new ExtValContext();
+    private static ExtValContext extValContext;
 
     private FactoryFinder factoryFinder = DefaultFactoryFinder.getInstance();
     private Map<String, RendererInterceptor> rendererInterceptors = new HashMap<String,
RendererInterceptor>();
@@ -269,6 +269,17 @@
 
     public static ExtValContext getContext()
     {
+        if(extValContext == null)
+        {
+            extValContext = new ExtValContext();
+            Object customExtValContext = ExtValUtils.getELHelper().getBean(
+                    extValContext.getInformationProviderBean().get(CustomInformation.EXTVAL_CONTEXT));
+
+            if(customExtValContext instanceof ExtValContext)
+            {
+                extValContext = (ExtValContext)customExtValContext;
+            }
+        }
         return extValContext;
     }
 

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java?rev=814106&r1=814105&r2=814106&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java
Sat Sep 12 03:56:18 2009
@@ -75,7 +75,8 @@
         }
 
         customizableInfos.put(CustomInformation.BASE_PACKAGE, basePackage);
-
+        customizableInfos.put(CustomInformation.EXTVAL_CONTEXT, "customExtValContext");
+        
         customizableInfos.put(CustomInformation.COMPONENT_META_DATA_EXTRACTOR,
                 "ComponentMetaDataExtractor");
         customizableInfos.put(CustomInformation.VALIDATION_PARAMETER_EXTRACTOR,
@@ -143,6 +144,9 @@
             case BASE_PACKAGE:
                 return value;
 
+            case EXTVAL_CONTEXT:
+                return value;
+
             /*
              * postfix used by the SimpleAnnotationToValidationStrategyNameMapper
              * the SimpleAnnotationToValidationStrategyNameMapper is for custom strategies
only



Mime
View raw message