myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r694513 - in /myfaces/extensions/validator/trunk: alternative/src/main/java/org/apache/myfaces/extensions/validator/core/ alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/ alternative/src/main/java/org/a...
Date Thu, 11 Sep 2008 22:19:28 GMT
Author: gpetracek
Date: Thu Sep 11 15:19:28 2008
New Revision: 694513

URL: http://svn.apache.org/viewvc?rev=694513&view=rev
Log:
separate module for the alternative and fallback approach

Added:
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeInformationProviderBean.java
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeWebXmlParameter.java
Modified:
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/proxy/ProxyMappingPhaseListener.java
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/AdapterFactoryUtils.java
    myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/ProxyUtils.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/InformationProviderBean.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/WebXmlParameter.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/CustomConfiguredAnnotationToValidationStrategyNameMapper.java

Added: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeInformationProviderBean.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeInformationProviderBean.java?rev=694513&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeInformationProviderBean.java
(added)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeInformationProviderBean.java
Thu Sep 11 15:19:28 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.core;
+
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageEnum;
+import org.apache.myfaces.extensions.validator.ExtValInformation;
+
+/**
+ * @author Gerhard Petracek
+ */
+@UsageInformation(UsageEnum.FALLBACK)
+public class AlternativeInformationProviderBean
+{
+    private String basePackage = WebXmlParameter.CUSTOM_EXTENSION_BASE_PACKAGE;
+
+    public AlternativeInformationProviderBean()
+    {
+        if (this.basePackage == null)
+        {
+            this.basePackage = ExtValInformation.EXTENSIONS_VALIDATOR_BASE_PACKAGE_NAME
+                + ".custom.";
+        }
+        if (!this.basePackage.endsWith("."))
+        {
+            this.basePackage = this.basePackage + ".";
+        }
+    }
+
+    //TODO move to alternative module
+    public String getCustomAdapterNameMapper()
+    {
+        return this.basePackage + "AdapterNameMapper";
+    }
+
+    //TODO move to alternative module
+    @UsageInformation(UsageEnum.FALLBACK)
+    public String getCustomConverterAdapterFactory()
+    {
+        return this.basePackage + "ConverterAdapterFactory";
+    }
+
+}

Added: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeWebXmlParameter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeWebXmlParameter.java?rev=694513&view=auto
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeWebXmlParameter.java
(added)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/AlternativeWebXmlParameter.java
Thu Sep 11 15:19:28 2008
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.core;
+
+import org.apache.myfaces.extensions.validator.internal.UsageEnum;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.util.WebXmlUtils;
+
+/**
+ * centralized in order that these information arn't spread over the complete code base
+ *
+ * @author Gerhard Petracek
+ */
+public interface AlternativeWebXmlParameter
+{
+    /*
+     * deactivate
+     */
+    static final String DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER = WebXmlUtils
+        .getInitParameter("DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER");
+    static final String DEACTIVATE_PROXY_MAPPING = WebXmlUtils
+        .getInitParameter("DEACTIVATE_PROXY_MAPPING");
+
+    /*
+     * fallback lib - if the usage of cglib is a problem
+     */
+    @UsageInformation(UsageEnum.FALLBACK)
+    static final String CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER = WebXmlUtils
+        .getInitParameter("CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER");
+    @UsageInformation(UsageEnum.FALLBACK)
+    static final String CUSTOM_CONVERTER_ADAPTER_FACTORY = WebXmlUtils
+        .getInitParameter("CUSTOM_CONVERTER_ADAPTER_FACTORY");
+    @UsageInformation(UsageEnum.FALLBACK)
+    static final String USE_ADAPTERS = WebXmlUtils
+        .getInitParameter("USE_ADAPTERS");
+}

Modified: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java
(original)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java
Thu Sep 11 15:19:28 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.myfaces.extensions.validator.core.adapter.mapper;
 
-import org.apache.myfaces.extensions.validator.core.WebXmlParameter;
+import org.apache.myfaces.extensions.validator.core.AlternativeWebXmlParameter;
 import org.apache.myfaces.extensions.validator.core.mapper.AbstractCustomNameMapper;
 import org.apache.myfaces.extensions.validator.internal.UsageEnum;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
@@ -35,6 +35,6 @@
 
     protected String getCustomNameMapperClassName()
     {
-        return WebXmlParameter.CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER;
+        return AlternativeWebXmlParameter.CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER;
     }
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java
(original)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java
Thu Sep 11 15:19:28 2008
@@ -19,9 +19,9 @@
 package org.apache.myfaces.extensions.validator.core.adapter.mapper;
 
 import org.apache.myfaces.extensions.validator.core.mapper.AbstractCustomNameMapper;
+import org.apache.myfaces.extensions.validator.core.AlternativeInformationProviderBean;
 import org.apache.myfaces.extensions.validator.internal.UsageEnum;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
-import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 
 import javax.faces.convert.Converter;
 
@@ -35,7 +35,10 @@
 
     protected String getCustomNameMapperClassName()
     {
-        return ExtValUtils.getInformationProviderBean()
+        //TODO make it overrideable see InformationProviderBean
+        //return ExtValUtils.getInformationProviderBean()
+        //    .getCustomAdapterNameMapper();
+        return new AlternativeInformationProviderBean()
             .getCustomAdapterNameMapper();
     }
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/proxy/ProxyMappingPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/proxy/ProxyMappingPhaseListener.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/proxy/ProxyMappingPhaseListener.java
(original)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/core/proxy/ProxyMappingPhaseListener.java
Thu Sep 11 15:19:28 2008
@@ -20,7 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.extensions.validator.core.WebXmlParameter;
+import org.apache.myfaces.extensions.validator.core.AlternativeWebXmlParameter;
 import org.apache.myfaces.extensions.validator.internal.UsageEnum;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
@@ -56,8 +56,8 @@
         if (!isInitialized)
         {
             //don't use DEACTIVATE_PROXY_MAPPING here to allow a different concept
-            String initParam = WebXmlParameter.DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER;
-            String initAdapterParam = WebXmlParameter.USE_ADAPTERS;
+            String initParam = AlternativeWebXmlParameter.DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER;
+            String initAdapterParam = AlternativeWebXmlParameter.USE_ADAPTERS;
 
             if ((initParam != null && initParam.equalsIgnoreCase("true"))
                 || (initAdapterParam != null && initAdapterParam

Modified: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/AdapterFactoryUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/AdapterFactoryUtils.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/AdapterFactoryUtils.java
(original)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/AdapterFactoryUtils.java
Thu Sep 11 15:19:28 2008
@@ -18,9 +18,12 @@
  */
 package org.apache.myfaces.extensions.validator.util;
 
+import org.apache.myfaces.extensions.validator.core.AlternativeWebXmlParameter;
 import org.apache.myfaces.extensions.validator.core.ClassMappingFactory;
-import org.apache.myfaces.extensions.validator.core.WebXmlParameter;
+import org.apache.myfaces.extensions.validator.core.AlternativeInformationProviderBean;
 import org.apache.myfaces.extensions.validator.core.adapter.DefaultConverterAdapterFactory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageEnum;
 
 import javax.faces.convert.Converter;
 import java.util.ArrayList;
@@ -33,7 +36,7 @@
 {
     private static ClassMappingFactory<Converter, Converter> converterAdapterFactory;
 
-    @Deprecated
+    @UsageInformation(UsageEnum.FALLBACK)
     public static ClassMappingFactory<Converter, Converter> getConverterAdapterFactory()
     {
         if (converterAdapterFactory == null)
@@ -41,10 +44,15 @@
             List<String> converterAdapterFactoryClassNames = new ArrayList<String>();
 
             converterAdapterFactoryClassNames
-                .add(WebXmlParameter.CUSTOM_CONVERTER_ADAPTER_FACTORY);
-            converterAdapterFactoryClassNames.add(ExtValUtils
-                .getInformationProviderBean()
+                .add(AlternativeWebXmlParameter.CUSTOM_CONVERTER_ADAPTER_FACTORY);
+
+            //TODO make it overrideable see InformationProviderBean
+            //converterAdapterFactoryClassNames.add(ExtValUtils
+            //    .getInformationProviderBean()
+            //    .getCustomConverterAdapterFactory());
+            converterAdapterFactoryClassNames.add(new AlternativeInformationProviderBean()
                 .getCustomConverterAdapterFactory());
+
             converterAdapterFactoryClassNames
                 .add(DefaultConverterAdapterFactory.class.getName());
 

Modified: myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/ProxyUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/ProxyUtils.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/ProxyUtils.java
(original)
+++ myfaces/extensions/validator/trunk/alternative/src/main/java/org/apache/myfaces/extensions/validator/util/ProxyUtils.java
Thu Sep 11 15:19:28 2008
@@ -20,7 +20,9 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.extensions.validator.core.WebXmlParameter;
+import org.apache.myfaces.extensions.validator.core.AlternativeWebXmlParameter;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageEnum;
 
 import javax.faces.application.Application;
 import javax.faces.component.UIComponent;
@@ -140,7 +142,7 @@
     public static boolean useProxyMapping()
     {
 
-        String initParam = WebXmlParameter.DEACTIVATE_PROXY_MAPPING;
+        String initParam = AlternativeWebXmlParameter.DEACTIVATE_PROXY_MAPPING;
         boolean disableProxyMapping = (initParam != null && initParam.trim()
             .equalsIgnoreCase("true"));
 
@@ -318,10 +320,10 @@
         return getOriginalApplication().createConverter(valueBindingType);
     }
 
-    @Deprecated
+    @UsageInformation(UsageEnum.FALLBACK)
     public static boolean useFallbackAdapters()
     {
-        String initParam = WebXmlParameter.USE_ADAPTERS;
+        String initParam = AlternativeWebXmlParameter.USE_ADAPTERS;
         return (initParam != null && initParam.trim().equalsIgnoreCase("true"));
     }
 }

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=694513&r1=694512&r2=694513&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
Thu Sep 11 15:19:28 2008
@@ -96,12 +96,6 @@
         return this.basePackage + "AnnotationToValidationStrategyNameMapper";
     }
 
-    @Deprecated
-    public String getCustomAdapterNameMapper()
-    {
-        return this.basePackage + "AdapterNameMapper";
-    }
-
     /*
      * factories
      */
@@ -115,12 +109,6 @@
         return this.basePackage + "ValidationStrategyFactory";
     }
 
-    @Deprecated
-    public String getCustomConverterAdapterFactory()
-    {
-        return this.basePackage + "ConverterAdapterFactory";
-    }
-
     //TODO
     /*
      * conventions (the rest of the conventions are built with the help of name mappers,...

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/WebXmlParameter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/WebXmlParameter.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/WebXmlParameter.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/WebXmlParameter.java
Thu Sep 11 15:19:28 2008
@@ -62,23 +62,6 @@
     /*
      * deactivate
      */
-    static final String DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER = WebXmlUtils
-        .getInitParameter("DEACTIVATE_RESTORE_PROXY_PHASE_LISTENER");
     static final String DEACTIVATE_DEFAULT_CONVENTION = WebXmlUtils
         .getInitParameter("DEACTIVATE_DEFAULT_CONVENTION");
-    static final String DEACTIVATE_PROXY_MAPPING = WebXmlUtils
-        .getInitParameter("DEACTIVATE_PROXY_MAPPING");
-
-    /*
-     * fallback lib - if the usage of cglib is a problem
-     */
-    @Deprecated
-    static final String CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER = WebXmlUtils
-        .getInitParameter("CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER");
-    @Deprecated
-    static final String CUSTOM_CONVERTER_ADAPTER_FACTORY = WebXmlUtils
-        .getInitParameter("CUSTOM_CONVERTER_ADAPTER_FACTORY");
-    @Deprecated
-    static final String USE_ADAPTERS = WebXmlUtils
-        .getInitParameter("USE_ADAPTERS");
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/CustomConfiguredAnnotationToValidationStrategyNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/CustomConfiguredAnnotationToValidationStrategyNameMapper.java?rev=694513&r1=694512&r2=694513&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/CustomConfiguredAnnotationToValidationStrategyNameMapper.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/CustomConfiguredAnnotationToValidationStrategyNameMapper.java
Thu Sep 11 15:19:28 2008
@@ -26,7 +26,6 @@
 /**
  * @author Gerhard Petracek
  */
-@Deprecated
 public class CustomConfiguredAnnotationToValidationStrategyNameMapper extends
     AbstractCustomNameMapper<Annotation>
 {



Mime
View raw message