myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r906447 - in /myfaces/extensions/validator/branches/branch_for_jsf_2_0: core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ core/src/main/java/org/...
Date Thu, 04 Feb 2010 10:40:42 GMT
Author: gpetracek
Date: Thu Feb  4 10:40:42 2010
New Revision: 906447

URL: http://svn.apache.org/viewvc?rev=906447&view=rev
Log:
EXTVAL-79 and cleanup

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ExtValELResolver.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/transformer/DefaultMetaDataTransformerFactory.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultStorageManagerFactory.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/AbstractAnnotationValidationStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/GroupUtils.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/BeanValidationInterceptor.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ExtValELResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ExtValELResolver.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ExtValELResolver.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/el/ExtValELResolver.java
Thu Feb  4 10:40:42 2010
@@ -20,6 +20,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 
 import javax.el.ELResolver;
 import javax.el.ELContext;
@@ -36,6 +38,7 @@
  * @author Gerhard Petracek
  * @since 1.x.1
  */
+@UsageInformation(UsageCategory.INTERNAL)
 public class ExtValELResolver extends ELResolver
 {
     protected final Log logger = LogFactory.getLog(getClass());

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/AbstractValidationInterceptor.java
Thu Feb  4 10:40:42 2010
@@ -28,6 +28,7 @@
 import org.apache.myfaces.extensions.validator.core.storage.RendererInterceptorPropertyStorage;
 import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipBeforeInterceptorsException;
 import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipRendererDelegationException;
+import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipAfterInterceptorsException;
 import org.apache.myfaces.extensions.validator.core.recorder.ProcessedInformationRecorder;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 
@@ -49,6 +50,32 @@
 @UsageInformation(UsageCategory.REUSE)
 public abstract class AbstractValidationInterceptor extends AbstractRendererInterceptor
 {
+    protected boolean isRequiredInitializationSupported()
+    {
+        return false;
+    }
+
+    @Override
+    public void afterDecode(FacesContext facesContext, UIComponent uiComponent, Renderer
wrapped)
+            throws SkipAfterInterceptorsException
+    {
+        /*
+         * component initialization sets a component to required if there are constraints
which indicate it
+         * the required flag in a component leads to problems with h:messages (additional
message) as well as
+         * incompatibilities with skip validation and severities
+         */
+        if(uiComponent instanceof EditableValueHolder &&
+                isRequiredInitializationSupported() && isRequiredInitializationActive())
+        {
+            ((EditableValueHolder)uiComponent).setRequired(false);
+        }
+    }
+
+    private boolean isRequiredInitializationActive()
+    {
+        return Boolean.TRUE.equals(ExtValContext.getContext().getGlobalProperty("init:required"));
+    }
+
     @Override
     public void beforeEncodeBegin(FacesContext facesContext, UIComponent uiComponent, Renderer
wrapped)
             throws IOException, SkipBeforeInterceptorsException, SkipRendererDelegationException

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/interceptor/ValidationInterceptor.java
Thu Feb  4 10:40:42 2010
@@ -28,13 +28,10 @@
 import org.apache.myfaces.extensions.validator.core.metadata.MetaDataEntry;
 import org.apache.myfaces.extensions.validator.core.property.PropertyInformation;
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
-import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipAfterInterceptorsException;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 
 import javax.faces.context.FacesContext;
 import javax.faces.component.UIComponent;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.render.Renderer;
 import java.util.Map;
 import java.lang.annotation.Annotation;
 
@@ -46,23 +43,9 @@
 public class ValidationInterceptor extends AbstractValidationInterceptor
 {
     @Override
-    public void afterDecode(FacesContext facesContext, UIComponent uiComponent, Renderer
wrapped)
-            throws SkipAfterInterceptorsException
+    protected boolean isRequiredInitializationSupported()
     {
-        /*
-         * component initialization sets a component to required if there are constraints
which indicate it
-         * the required flag in a component leads to problems with h:messages (additional
message) as well as
-         * incompatibilities with skip validation and severities
-         */
-        if(uiComponent instanceof EditableValueHolder && isRequiredInitializationActive())
-        {
-            ((EditableValueHolder)uiComponent).setRequired(false);
-        }
-    }
-
-    private boolean isRequiredInitializationActive()
-    {
-        return Boolean.TRUE.equals(ExtValContext.getContext().getGlobalProperty("init:required"));
+        return true;
     }
 
     protected void initComponent(FacesContext facesContext, UIComponent uiComponent)

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/transformer/DefaultMetaDataTransformerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/transformer/DefaultMetaDataTransformerFactory.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/transformer/DefaultMetaDataTransformerFactory.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/transformer/DefaultMetaDataTransformerFactory.java
Thu Feb  4 10:40:42 2010
@@ -202,11 +202,11 @@
             ExtValContext.getContext().getStaticConfiguration(
                 StaticConfigurationNames.VALIDATION_STRATEGY_TO_META_DATA_TRANSFORMER_CONFIG))
         {
-            setupStrategyMappings(staticConfig.getMapping());
+            setupMappings(staticConfig.getMapping());
         }
     }
 
-    private void setupStrategyMappings(List<StaticConfigurationEntry<String, String>>
mappings)
+    private void setupMappings(List<StaticConfigurationEntry<String, String>>
mappings)
     {
         for(StaticConfigurationEntry<String, String> mapping : mappings)
         {

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultStorageManagerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultStorageManagerFactory.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultStorageManagerFactory.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/storage/DefaultStorageManagerFactory.java
Thu Feb  4 10:40:42 2010
@@ -74,8 +74,8 @@
         setStorageManager(ViolationSeverityInterpreterStorage.class,
                 new DefaultViolationSeverityInterpreterStorageManager(), false);
 
-        setStorageManager(
-                FacesInformationStorage.class, new DefaultFacesInformationStorageManager(),
false);
+        setStorageManager(FacesInformationStorage.class,
+                new DefaultFacesInformationStorageManager(), false);
     }
 
     public StorageManager create(Class storageType)

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java
Thu Feb  4 10:40:42 2010
@@ -119,11 +119,11 @@
             ExtValContext.getContext().getStaticConfiguration(
                 StaticConfigurationNames.VALIDATION_STRATEGY_TO_MESSAGE_RESOLVER_CONFIG))
         {
-            setupStrategyMappings(staticConfig.getMapping());
+            setupMappings(staticConfig.getMapping());
         }
     }
 
-    private void setupStrategyMappings(List<StaticConfigurationEntry<String,String>>
mappings)
+    private void setupMappings(List<StaticConfigurationEntry<String,String>>
mappings)
     {
         for(StaticConfigurationEntry<String, String> mapping : mappings)
         {

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/AbstractAnnotationValidationStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/AbstractAnnotationValidationStrategy.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/AbstractAnnotationValidationStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/AbstractAnnotationValidationStrategy.java
Thu Feb  4 10:40:42 2010
@@ -102,7 +102,7 @@
                 facesContext, uiComponent, metaDataEntry, convertedObject, validatorException);
     }
 
-    //for custom annotations - override if needed
+    //e.g. for custom annotations - override if needed
     protected String getLabel(FacesContext facesContext, UIComponent uiComponent, MetaDataEntry
metaDataEntry)
     {
         return null;

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
Thu Feb  4 10:40:42 2010
@@ -22,6 +22,8 @@
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 
 /**
+ * it isn't linked to jsr 303
+ *
  * it's just a helper for proxies - you just need it, if you define the validation strategy
as bean and
  * e.g. spring creates a proxy for it.
 
@@ -38,4 +40,4 @@
     String getValidationStrategyClassName();
 
     String getMetaDataTransformerClassName();
-}
\ No newline at end of file
+}

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
Thu Feb  4 10:40:42 2010
@@ -30,6 +30,8 @@
 import javax.faces.context.FacesContext;
 
 /**
+ * it isn't linked to jsr 303
+ *
  * it's just a helper for proxies - you just need it, if you define the validation strategy
as bean and
  * e.g. spring creates a proxy for it.
 

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/GroupUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/GroupUtils.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/GroupUtils.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/core/src/main/java/org/apache/myfaces/extensions/validator/util/GroupUtils.java
Thu Feb  4 10:40:42 2010
@@ -23,7 +23,7 @@
 
 /**
  * @author Gerhard Petracek
- * @since 1.x.1
+ * @since x.x.3
  */
 @UsageInformation(UsageCategory.INTERNAL)
 public class GroupUtils
@@ -32,4 +32,4 @@
     {
         return clientId == null ? viewId : viewId + "@" + clientId;
     }
-}
\ No newline at end of file
+}

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/BeanValidationInterceptor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/BeanValidationInterceptor.java?rev=906447&r1=906446&r2=906447&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/BeanValidationInterceptor.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/bean-validation/src/main/java/org/apache/myfaces/extensions/validator/beanval/BeanValidationInterceptor.java
Thu Feb  4 10:40:42 2010
@@ -41,6 +41,12 @@
 {
     private BeanValidationInterceptorInternals bviUtils = new BeanValidationInterceptorInternals(this.logger);
 
+    @Override
+    protected boolean isRequiredInitializationSupported()
+    {
+        return true;
+    }
+
     protected void initComponent(FacesContext facesContext, UIComponent uiComponent)
     {
         if (logger.isTraceEnabled())



Mime
View raw message