myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r699066 - in /myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core: metadata/extractor/ metadata/extractor/mapper/ validation/message/resolver/mapper/ validation/strategy/ validation/...
Date Thu, 25 Sep 2008 19:56:16 GMT
Author: gpetracek
Date: Thu Sep 25 12:56:15 2008
New Revision: 699066

URL: http://svn.apache.org/viewvc?rev=699066&view=rev
Log:
helper classes to solve jdk proxy issue (e.g. spring beans)

Added:
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapter.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapterImpl.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/BeanValidationStrategyToMetaDataExtractorNameMapper.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
Modified:
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultMetaDataExtractorFactory.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/SimpleValidationStrategyToMetaDataExtractorNameMapper.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/SimpleValidationStrategyToMsgResolverNameMapper.java
    myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/SimpleAnnotationToValidationStrategyNameMapper.java

Added: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapter.java?rev=699066&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapter.java
(added)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapter.java
Thu Sep 25 12:56:15 2008
@@ -0,0 +1,40 @@
+/*
+ * 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.metadata.extractor;
+
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+
+/**
+ * it's just a helper for proxies - you just need it, if you define the equivalent validation
strategy as bean and
+ * e.g. spring creates a proxy for it.
+ *
+ * if there is also a proxy for the extractor you can use the className property to manually
repeat the
+ * full qualified class name.
+ *
+ * @see org.apache.myfaces.extensions.validator.core.validation.strategy.BeanValidationStrategyAdapter
+ *
+ * @author Gerhard Petracek
+ * @since 1.x.1
+ */
+@UsageInformation({UsageCategory.REUSE})
+public interface BeanMetaDataExtractorAdapter extends MetaDataExtractor
+{
+    String getMetaDataExtractorClassName();
+}

Added: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapterImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapterImpl.java?rev=699066&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapterImpl.java
(added)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/BeanMetaDataExtractorAdapterImpl.java
Thu Sep 25 12:56:15 2008
@@ -0,0 +1,78 @@
+/*
+ * 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.metadata.extractor;
+
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+
+import java.util.Map;
+import java.lang.annotation.Annotation;
+
+/**
+ * it's just a helper for proxies - you just need it, if you define the equivalent validation
strategy as bean and
+ * e.g. spring creates a proxy for it.
+ *
+ * if there is also a proxy for the extractor you can use the className property to manually
repeat the
+ * full qualified class name.
+ *
+ * @see org.apache.myfaces.extensions.validator.core.validation.strategy.BeanValidationStrategyAdapter
+ *
+ * @author Gerhard Petracek
+ * @since 1.x.1
+ */
+@UsageInformation({UsageCategory.REUSE})
+public class BeanMetaDataExtractorAdapterImpl implements BeanMetaDataExtractorAdapter
+{
+    private MetaDataExtractor metaDataExtractor;
+    private String metaDataExtractorClassName;
+
+    public Map<String, Object> extractMetaData(Annotation annotation)
+    {
+        return this.metaDataExtractor.extractMetaData(annotation);
+    }
+
+    public String getMetaDataExtractorClassName()
+    {
+        if(metaDataExtractorClassName != null)
+        {
+            return metaDataExtractorClassName;
+        }
+        if(metaDataExtractor.getClass().getPackage() != null)
+        {
+            metaDataExtractor.getClass();
+        }
+
+        return null;
+    }
+
+    public void setMetaDataExtractorClassName(String metaDataExtractorClassName)
+    {
+        this.metaDataExtractorClassName = metaDataExtractorClassName;
+    }
+
+    public MetaDataExtractor getMetaDataExtractor()
+    {
+        return metaDataExtractor;
+    }
+
+    public void setMetaDataExtractor(MetaDataExtractor metaDataExtractor)
+    {
+        this.metaDataExtractor = metaDataExtractor;
+    }
+}

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultMetaDataExtractorFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultMetaDataExtractorFactory.java?rev=699066&r1=699065&r2=699066&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultMetaDataExtractorFactory.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/DefaultMetaDataExtractorFactory.java
Thu Sep 25 12:56:15 2008
@@ -20,6 +20,7 @@
 
 import org.apache.myfaces.extensions.validator.core.ClassMappingFactory;
 import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.strategy.BeanValidationStrategyAdapter;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.mapper
     .CustomConfiguredValidationStrategyToMetaDataExtractorNameMapper;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.mapper
@@ -28,6 +29,8 @@
     .DefaultValidationStrategyToMetaDataExtractorNameMapper;
 import org.apache.myfaces.extensions.validator.core.metadata.extractor.mapper
     .SimpleValidationStrategyToMetaDataExtractorNameMapper;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.mapper
+    .BeanValidationStrategyToMetaDataExtractorNameMapper;
 import org.apache.myfaces.extensions.validator.core.mapper.NameMapper;
 import org.apache.myfaces.extensions.validator.util.ClassUtils;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
@@ -67,11 +70,25 @@
             .add(new DefaultValidationStrategyToMetaDataExtractorNameMapper());
         nameMapperList
             .add(new SimpleValidationStrategyToMetaDataExtractorNameMapper());
+        nameMapperList
+            .add(new BeanValidationStrategyToMetaDataExtractorNameMapper());
     }
 
     public MetaDataExtractor create(ValidationStrategy validationStrategy)
     {
-        String validationStrategyName = validationStrategy.getClass().getName();
+        String validationStrategyName = null;
+
+        //proxy check
+        if(validationStrategy.getClass().getPackage() != null)
+        {
+            validationStrategyName = validationStrategy.getClass().getName();
+        }
+        //in case of a proxy and the usage of a BeanValidationStrategyAdapter
+        else if (validationStrategy instanceof BeanValidationStrategyAdapter)
+        {
+            validationStrategyName = ((BeanValidationStrategyAdapter)validationStrategy)
+                                        .getValidationStrategyClassName();
+        }
 
         if (validationStrategyToMetaDataExtractorMapping.containsKey(validationStrategyName))
         {
@@ -95,7 +112,10 @@
 
             if (metaDataExtractor != null)
             {
-                validationStrategyToMetaDataExtractorMapping.put(validationStrategyName,
extractorName);
+                if(validationStrategyName != null)
+                {
+                    validationStrategyToMetaDataExtractorMapping.put(validationStrategyName,
extractorName);
+                }
                 return metaDataExtractor;
             }
         }

Added: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/BeanValidationStrategyToMetaDataExtractorNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/BeanValidationStrategyToMetaDataExtractorNameMapper.java?rev=699066&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/BeanValidationStrategyToMetaDataExtractorNameMapper.java
(added)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/BeanValidationStrategyToMetaDataExtractorNameMapper.java
Thu Sep 25 12:56:15 2008
@@ -0,0 +1,44 @@
+/*
+ * 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.metadata.extractor.mapper;
+
+import org.apache.myfaces.extensions.validator.core.mapper.NameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
+import org.apache.myfaces.extensions.validator.core.validation.strategy.BeanValidationStrategyAdapter;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+
+/**
+ * It's an alternative Mapper - if there is a proxy around the validation strategy.
+ *
+ * @author Gerhard Petracek
+ * @since 1.x.1
+ */
+@UsageInformation({UsageCategory.INTERNAL, UsageCategory.ALTERNATIVE})
+public class BeanValidationStrategyToMetaDataExtractorNameMapper implements NameMapper<ValidationStrategy>
+{
+    public String createName(ValidationStrategy validationStrategy)
+    {
+        if(validationStrategy instanceof BeanValidationStrategyAdapter)
+        {
+            return ((BeanValidationStrategyAdapter)validationStrategy).getMetaDataExtractorClassName();
+        }
+        return null;
+    }
+}

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/SimpleValidationStrategyToMetaDataExtractorNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/SimpleValidationStrategyToMetaDataExtractorNameMapper.java?rev=699066&r1=699065&r2=699066&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/SimpleValidationStrategyToMetaDataExtractorNameMapper.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/metadata/extractor/mapper/SimpleValidationStrategyToMetaDataExtractorNameMapper.java
Thu Sep 25 12:56:15 2008
@@ -25,17 +25,20 @@
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 
 /**
- * It's a alternative Mapper to place ValidationStrategies and MetaDataExtractors in the
same package.
+ * It's an alternative Mapper to place ValidationStrategies and MetaDataExtractors in the
same package.
  *
  * @author Gerhard Petracek
  * @since 1.x.1
  */
 @UsageInformation({UsageCategory.INTERNAL, UsageCategory.ALTERNATIVE})
-public class SimpleValidationStrategyToMetaDataExtractorNameMapper implements
-    NameMapper<ValidationStrategy>
+public class SimpleValidationStrategyToMetaDataExtractorNameMapper implements NameMapper<ValidationStrategy>
 {
     public String createName(ValidationStrategy validationStrategy)
     {
+        if(validationStrategy.getClass().getPackage() == null)
+        {
+            return null;
+        }
         return getSimpleMetaDataExtractorName(validationStrategy.getClass().getPackage().getName()
+ ".",
                                                 validationStrategy.getClass().getSimpleName());
     }

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/SimpleValidationStrategyToMsgResolverNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/SimpleValidationStrategyToMsgResolverNameMapper.java?rev=699066&r1=699065&r2=699066&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/SimpleValidationStrategyToMsgResolverNameMapper.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/SimpleValidationStrategyToMsgResolverNameMapper.java
Thu Sep 25 12:56:15 2008
@@ -24,7 +24,7 @@
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 
 /**
- * It's a alternative Mapper to place ValidationStrategies and MessageResolvers in the same
package.
+ * It's an alternative Mapper to place ValidationStrategies and MessageResolvers in the same
package.
  *
  * @author Gerhard Petracek
  * @since 1.x.1

Added: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java?rev=699066&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
(added)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapter.java
Thu Sep 25 12:56:15 2008
@@ -0,0 +1,41 @@
+/*
+ * 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.validation.strategy;
+
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+
+/**
+ * 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.
+
+ * adapter to connect validation strategies with meta-data extractors,
+ * if the validation strategy is defined as bean and e.g. spring creates a proxy
+ *
+ * @author Gerhard Petracek
+ * @since 1.x.1
+ */
+@UsageInformation({UsageCategory.REUSE})
+public interface BeanValidationStrategyAdapter extends ValidationStrategy
+{
+    //to get back the internal cashing
+    String getValidationStrategyClassName();
+
+    String getMetaDataExtractorClassName();
+}

Added: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java?rev=699066&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
(added)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/BeanValidationStrategyAdapterImpl.java
Thu Sep 25 12:56:15 2008
@@ -0,0 +1,108 @@
+/*
+ * 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.validation.strategy;
+
+import org.apache.myfaces.extensions.validator.core.annotation.AnnotationEntry;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor;
+import org.apache.myfaces.extensions.validator.core.metadata.extractor.BeanMetaDataExtractorAdapter;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * 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.
+
+ * adapter to connect validation strategies with meta-data extractors,
+ * if the validation strategy is defined as bean and e.g. spring creates a proxy
+ *
+ * @author Gerhard Petracek
+ * @since 1.x.1
+ */
+@UsageInformation({UsageCategory.REUSE})
+public class BeanValidationStrategyAdapterImpl implements BeanValidationStrategyAdapter
+{
+    private MetaDataExtractor metaDataExtractor;
+    private ValidationStrategy validationStrategy;
+    //optional fallback for internal cashing
+    private String validationStrategyClassName;
+
+    public void validate(FacesContext facesContext,
+                         UIComponent uiComponent,
+                         AnnotationEntry annotationEntry,
+                         Object convertedObject)
+    {
+        this.validationStrategy.validate(facesContext, uiComponent, annotationEntry, convertedObject);
+    }
+
+    public String getValidationStrategyClassName()
+    {
+        if(validationStrategy.getClass().getPackage() != null)
+        {
+            return validationStrategy.getClass().getName();
+        }
+        return validationStrategyClassName;
+    }
+
+    public String getMetaDataExtractorClassName()
+    {
+        if(metaDataExtractor != null)
+        {
+            if(metaDataExtractor.getClass().getPackage() != null)
+            {
+                return metaDataExtractor.getClass().getName();
+            }
+            else
+            {
+                if(metaDataExtractor instanceof BeanMetaDataExtractorAdapter)
+                {
+                    return ((BeanMetaDataExtractorAdapter)metaDataExtractor).getMetaDataExtractorClassName();
+                }
+            }
+        }
+        return null;
+    }
+
+    public MetaDataExtractor getMetaDataExtractor()
+    {
+        return metaDataExtractor;
+    }
+
+    public void setMetaDataExtractor(MetaDataExtractor metaDataExtractor)
+    {
+        this.metaDataExtractor = metaDataExtractor;
+    }
+
+    public ValidationStrategy getValidationStrategy()
+    {
+        return validationStrategy;
+    }
+
+    public void setValidationStrategy(ValidationStrategy validationStrategy)
+    {
+        this.validationStrategy = validationStrategy;
+    }
+
+    public void setValidationStrategyClassName(String validationStrategyClassName)
+    {
+        this.validationStrategyClassName = validationStrategyClassName;
+    }
+}

Modified: myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/SimpleAnnotationToValidationStrategyNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/SimpleAnnotationToValidationStrategyNameMapper.java?rev=699066&r1=699065&r2=699066&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/SimpleAnnotationToValidationStrategyNameMapper.java
(original)
+++ myfaces/extensions/validator/branches/jsf_1.1/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/strategy/mapper/SimpleAnnotationToValidationStrategyNameMapper.java
Thu Sep 25 12:56:15 2008
@@ -26,7 +26,7 @@
 import java.lang.annotation.Annotation;
 
 /**
- * It's a alternative Mapper to place Annotations and ValidationStrategies in the same package.
+ * It's an alternative Mapper to place Annotations and ValidationStrategies in the same package.
  *
  * @author Gerhard Petracek
  * @since 1.x.1



Mime
View raw message