You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/07/31 19:29:02 UTC
svn commit: r681422 [2/4] - in
/myfaces/extensions/validator/branches/trunk_layout_myfaces/core: ./
src/main/java/org/apache/myfaces/extensions/validator/core/
src/main/java/org/apache/myfaces/extensions/validator/core/adapter/
src/main/java/org/apache...
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/ExtValFallbackConverter.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/ExtValFallbackConverter.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/ExtValFallbackConverter.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/ExtValFallbackConverter.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.adapter;
@@ -31,37 +31,55 @@
* @author Gerhard Petracek
*/
@Deprecated
-public class ExtValFallbackConverter extends ExtValConverter {
+public class ExtValFallbackConverter extends ExtValConverter
+{
private Converter wrapped;
- public ExtValFallbackConverter(Converter converter) {
+ public ExtValFallbackConverter(Converter converter)
+ {
this.wrapped = converter;
}
@Override
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o) {
- if (this.wrapped == null) {
+ public String getAsString(FacesContext facesContext,
+ UIComponent uiComponent, Object o)
+ {
+ if (this.wrapped == null)
+ {
//indirect approach for complex components
- Converter converter = ExtValUtils.tryToCreateOriginalConverter(facesContext, uiComponent);
- if (converter == null) {
+ Converter converter = ExtValUtils.tryToCreateOriginalConverter(
+ facesContext, uiComponent);
+ if (converter == null)
+ {
return (o == null) ? null : o.toString();
- } else {
+ }
+ else
+ {
return converter.getAsString(facesContext, uiComponent, o);
}
- } else {
+ }
+ else
+ {
return this.wrapped.getAsString(facesContext, uiComponent, o);
}
}
@Override
- protected Object getConvertedObject(FacesContext facesContext, UIComponent uiComponent, String s) {
- if (this.wrapped == null) {
+ protected Object getConvertedObject(FacesContext facesContext,
+ UIComponent uiComponent, String s)
+ {
+ if (this.wrapped == null)
+ {
//indirect approach for complex components
//TODO
- Converter converter = ExtValUtils.tryToCreateOriginalConverter(facesContext, uiComponent);
+ Converter converter = ExtValUtils.tryToCreateOriginalConverter(
+ facesContext, uiComponent);
- return (converter != null) ? converter.getAsObject(facesContext, uiComponent, s) : s;
- } else {
+ return (converter != null) ? converter.getAsObject(facesContext,
+ uiComponent, s) : s;
+ }
+ else
+ {
return this.wrapped.getAsObject(facesContext, uiComponent, s);
}
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConfiguredConverterToAdapterNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.adapter.mapper;
@@ -27,9 +27,12 @@
* @author Gerhard Petracek
*/
@Deprecated
-public class CustomConfiguredConverterToAdapterNameMapper extends AbstractCustomNameMapper<Converter> {
+public class CustomConfiguredConverterToAdapterNameMapper extends
+ AbstractCustomNameMapper<Converter>
+{
- protected String getCustomNameMapperClassName() {
+ protected String getCustomNameMapperClassName()
+ {
return WebXmlParameter.CUSTOM_CONVERTER_TO_ADAPTER_NAME_MAPPER;
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/CustomConventionConverterToAdapterNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.adapter.mapper;
@@ -27,9 +27,13 @@
* @author Gerhard Petracek
*/
@Deprecated
-public class CustomConventionConverterToAdapterNameMapper extends AbstractCustomNameMapper<Converter> {
+public class CustomConventionConverterToAdapterNameMapper extends
+ AbstractCustomNameMapper<Converter>
+{
- protected String getCustomNameMapperClassName() {
- return ExtValUtils.getInformationProviderBean().getCustomAdapterNameMapper();
+ protected String getCustomNameMapperClassName()
+ {
+ return ExtValUtils.getInformationProviderBean()
+ .getCustomAdapterNameMapper();
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/DefaultConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/DefaultConverterToAdapterNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/DefaultConverterToAdapterNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/DefaultConverterToAdapterNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.adapter.mapper;
@@ -26,8 +26,11 @@
* @author Gerhard Petracek
*/
@Deprecated
-public class DefaultConverterToAdapterNameMapper implements NameMapper<Converter> {
- public String createName(Converter converter) {
+public class DefaultConverterToAdapterNameMapper implements
+ NameMapper<Converter>
+{
+ public String createName(Converter converter)
+ {
return converter.getClass().getName() + "Adapter";
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/SimpleConverterToAdapterNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/SimpleConverterToAdapterNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/SimpleConverterToAdapterNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/adapter/mapper/SimpleConverterToAdapterNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.adapter.mapper;
@@ -27,8 +27,13 @@
* @author Gerhard Petracek
*/
@Deprecated
-public class SimpleConverterToAdapterNameMapper implements NameMapper<Converter> {
- public String createName(Converter converter) {
- return ExtValInformation.EXTENSIONS_VALIDATOR_BASE_PACKAGE_NAME + ".adapter." + converter.getClass().getSimpleName() + "Adapter";
+public class SimpleConverterToAdapterNameMapper implements
+ NameMapper<Converter>
+{
+ public String createName(Converter converter)
+ {
+ return ExtValInformation.EXTENSIONS_VALIDATOR_BASE_PACKAGE_NAME
+ + ".adapter." + converter.getClass().getSimpleName()
+ + "Adapter";
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/AnnotationEntry.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/AnnotationEntry.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/AnnotationEntry.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/AnnotationEntry.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.annotation;
@@ -23,7 +23,8 @@
/**
* @author Gerhard Petracek
*/
-public class AnnotationEntry {
+public class AnnotationEntry
+{
private Annotation annotation;
private String valueBindingExpression;
//e.g. valueBindingName, DefaultValueBindingScanningAnnotationExtractor uses it for the variable-/method-name
@@ -31,42 +32,51 @@
private Class entityClass;
//requested by bernhard huemer
- public <T> T getAnnotation(Class<T> targetClass) {
+ public <T> T getAnnotation(Class<T> targetClass)
+ {
return (T) annotation;
}
/*
* generated
*/
- public Annotation getAnnotation() {
+ public Annotation getAnnotation()
+ {
return annotation;
}
- public void setAnnotation(Annotation annotation) {
+ public void setAnnotation(Annotation annotation)
+ {
this.annotation = annotation;
}
- public String getValueBindingExpression() {
+ public String getValueBindingExpression()
+ {
return valueBindingExpression;
}
- public void setValueBindingExpression(String valueBindingExpression) {
+ public void setValueBindingExpression(String valueBindingExpression)
+ {
this.valueBindingExpression = valueBindingExpression;
}
- public String getBoundTo() {
+ public String getBoundTo()
+ {
return boundTo;
}
- public void setBoundTo(String boundTo) {
+ public void setBoundTo(String boundTo)
+ {
this.boundTo = boundTo;
}
- public Class getEntityClass() {
+ public Class getEntityClass()
+ {
return entityClass;
}
- public void setEntityClass(Class entityClass) {
+ public void setEntityClass(Class entityClass)
+ {
this.entityClass = entityClass;
}
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractor.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractor.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractor.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.annotation.extractor;
@@ -26,6 +26,8 @@
/**
* @author Gerhard Petracek
*/
-public interface AnnotationExtractor {
- List<AnnotationEntry> extractAnnotations(FacesContext facesContext, Object object);
+public interface AnnotationExtractor
+{
+ List<AnnotationEntry> extractAnnotations(FacesContext facesContext,
+ Object object);
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractorFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractorFactory.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractorFactory.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/AnnotationExtractorFactory.java Thu Jul 31 10:28:59 2008
@@ -1,26 +1,27 @@
/*
- * 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.
+ * 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.annotation.extractor;
/**
* @author Gerhard Petracek
*/
-public interface AnnotationExtractorFactory {
+public interface AnnotationExtractorFactory
+{
AnnotationExtractor create();
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultAnnotationExtractorFactory.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultAnnotationExtractorFactory.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultAnnotationExtractorFactory.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultAnnotationExtractorFactory.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.annotation.extractor;
@@ -28,22 +28,33 @@
/**
* @author Gerhard Petracek
*/
-public class DefaultAnnotationExtractorFactory implements AnnotationExtractorFactory {
+public class DefaultAnnotationExtractorFactory implements
+ AnnotationExtractorFactory
+{
private static AnnotationExtractor annotationExtractor = null;
- public AnnotationExtractor create() {
- if (annotationExtractor == null) {
+ public AnnotationExtractor create()
+ {
+ if (annotationExtractor == null)
+ {
List<String> annotationExtractorClassNames = new ArrayList<String>();
- annotationExtractorClassNames.add(WebXmlParameter.CUSTOM_ANNOTATION_EXTRACTOR);
- annotationExtractorClassNames.add(ExtValUtils.getInformationProviderBean().getCustomAnnotationExtractor());
- annotationExtractorClassNames.add(DefaultComponentAnnotationExtractor.class.getName());
+ annotationExtractorClassNames
+ .add(WebXmlParameter.CUSTOM_ANNOTATION_EXTRACTOR);
+ annotationExtractorClassNames.add(ExtValUtils
+ .getInformationProviderBean()
+ .getCustomAnnotationExtractor());
+ annotationExtractorClassNames
+ .add(DefaultComponentAnnotationExtractor.class.getName());
+
+ for (String className : annotationExtractorClassNames)
+ {
+ annotationExtractor = (AnnotationExtractor) ClassUtils
+ .tryToInstantiateClassForName(className);
- for (String className : annotationExtractorClassNames) {
- annotationExtractor = (AnnotationExtractor) ClassUtils.tryToInstantiateClassForName(className);
-
- if (annotationExtractor != null) {
+ if (annotationExtractor != null)
+ {
//TODO logging
break;
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultComponentAnnotationExtractor.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultComponentAnnotationExtractor.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultComponentAnnotationExtractor.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/annotation/extractor/DefaultComponentAnnotationExtractor.java Thu Jul 31 10:28:59 2008
@@ -1,31 +1,23 @@
/*
- * 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.
+ * 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.annotation.extractor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.extensions.validator.core.annotation.AnnotationEntry;
-import org.apache.myfaces.extensions.validator.util.ELUtils;
-import org.apache.myfaces.extensions.validator.util.FaceletsTaglibExpressionUtils;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -33,15 +25,27 @@
import java.util.Arrays;
import java.util.List;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.extensions.validator.core.annotation.AnnotationEntry;
+import org.apache.myfaces.extensions.validator.util.ELUtils;
+
/**
* @author Gerhard Petracek
*/
-public class DefaultComponentAnnotationExtractor implements AnnotationExtractor {
+public class DefaultComponentAnnotationExtractor implements AnnotationExtractor
+{
protected final Log logger = LogFactory.getLog(getClass());
- public List<AnnotationEntry> extractAnnotations(FacesContext facesContext, Object object) {
+ public List<AnnotationEntry> extractAnnotations(FacesContext facesContext,
+ Object object)
+ {
//should never occur
- if (!(object instanceof UIComponent)) {
+ if (!(object instanceof UIComponent))
+ {
//TODO
return new ArrayList<AnnotationEntry>();
}
@@ -50,9 +54,11 @@
List<AnnotationEntry> annotationEntries = new ArrayList<AnnotationEntry>();
- String valueBindingExpression = ELUtils.getReliableValueBindingExpression(uiComponent);
+ String valueBindingExpression = ELUtils
+ .getReliableValueBindingExpression(uiComponent);
- if (valueBindingExpression == null) {
+ if (valueBindingExpression == null)
+ {
return new ArrayList<AnnotationEntry>();
}
@@ -61,15 +67,19 @@
*/
int beanPropertyBorder = valueBindingExpression.lastIndexOf('.');
- if (beanPropertyBorder < 0) {
+ if (beanPropertyBorder < 0)
+ {
return new ArrayList<AnnotationEntry>();
}
- String beans = valueBindingExpression.substring(valueBindingExpression.indexOf('{') + 1, beanPropertyBorder);
+ String beans = valueBindingExpression.substring(valueBindingExpression
+ .indexOf('{') + 1, beanPropertyBorder);
- String property = valueBindingExpression.substring(beanPropertyBorder + 1, valueBindingExpression.indexOf('}'));
+ String property = valueBindingExpression.substring(
+ beanPropertyBorder + 1, valueBindingExpression.indexOf('}'));
- Class entityClass = ELUtils.getTypeOfValueBindingForExpression(facesContext, "#{" + beans + "}");
+ Class entityClass = ELUtils.getTypeOfValueBindingForExpression(
+ facesContext, "#{" + beans + "}");
//create template entry
AnnotationEntry templateEntry = new AnnotationEntry();
@@ -84,18 +94,24 @@
*/
Class currentClass = entityClass;
- while (!Object.class.getName().equals(currentClass.getName())) {
- addPropertyAccessAnnotations(currentClass, property, annotationEntries, templateEntry);
- addFieldAccessAnnotations(currentClass, property, annotationEntries, templateEntry);
+ while (!Object.class.getName().equals(currentClass.getName()))
+ {
+ addPropertyAccessAnnotations(currentClass, property,
+ annotationEntries, templateEntry);
+ addFieldAccessAnnotations(currentClass, property,
+ annotationEntries, templateEntry);
currentClass = currentClass.getSuperclass();
}
- for (Class currentInterface : entityClass.getInterfaces()) {
+ for (Class currentInterface : entityClass.getInterfaces())
+ {
currentClass = currentInterface;
- while (currentClass != null) {
- addPropertyAccessAnnotations(currentClass, property, annotationEntries, templateEntry);
+ while (currentClass != null)
+ {
+ addPropertyAccessAnnotations(currentClass, property,
+ annotationEntries, templateEntry);
currentClass = currentClass.getSuperclass();
}
@@ -104,55 +120,87 @@
return annotationEntries;
}
- protected void addPropertyAccessAnnotations(Class entity, String property, List<AnnotationEntry> annotationEntries, AnnotationEntry templateEntry) {
- property = property.substring(0, 1).toUpperCase() + property.substring(1);
+ protected void addPropertyAccessAnnotations(Class entity, String property,
+ List<AnnotationEntry> annotationEntries,
+ AnnotationEntry templateEntry)
+ {
+ property = property.substring(0, 1).toUpperCase()
+ + property.substring(1);
Method method;
- try {
+ try
+ {
method = entity.getDeclaredMethod("get" + property);
- } catch (NoSuchMethodException e) {
- try {
+ }
+ catch (NoSuchMethodException e)
+ {
+ try
+ {
method = entity.getDeclaredMethod("is" + property);
- } catch (NoSuchMethodException e1) {
- logger.debug("method not found - class: " + entity.getName() + " - methods: " + "get" + property + " " + "is" + property);
+ }
+ catch (NoSuchMethodException e1)
+ {
+ logger.debug("method not found - class: " + entity.getName()
+ + " - methods: " + "get" + property + " " + "is"
+ + property);
return;
}
}
- addAnnotationToAnnotationEntries(annotationEntries, Arrays.asList(method.getAnnotations()), templateEntry);
+ addAnnotationToAnnotationEntries(annotationEntries, Arrays
+ .asList(method.getAnnotations()), templateEntry);
}
- protected void addFieldAccessAnnotations(Class entity, String property, List<AnnotationEntry> annotationEntries, AnnotationEntry templateEntry) {
+ protected void addFieldAccessAnnotations(Class entity, String property,
+ List<AnnotationEntry> annotationEntries,
+ AnnotationEntry templateEntry)
+ {
Field field;
- try {
+ try
+ {
field = entity.getDeclaredField(property);
- } catch (Exception e) {
- try {
+ }
+ catch (Exception e)
+ {
+ try
+ {
field = entity.getDeclaredField("_" + property);
- } catch (NoSuchFieldException e1) {
- logger.debug("field " + property + " or _" + property + " not found");
+ }
+ catch (NoSuchFieldException e1)
+ {
+ logger.debug("field " + property + " or _" + property
+ + " not found");
return;
}
}
- addAnnotationToAnnotationEntries(annotationEntries, Arrays.asList(field.getAnnotations()), templateEntry);
+ addAnnotationToAnnotationEntries(annotationEntries, Arrays.asList(field
+ .getAnnotations()), templateEntry);
}
- protected void addAnnotationToAnnotationEntries(List<AnnotationEntry> annotationEntries, List<Annotation> annotations, AnnotationEntry templateEntry) {
- for (Annotation annotation : annotations) {
- annotationEntries.add(createAnnotationEntry(annotation, templateEntry));
+ protected void addAnnotationToAnnotationEntries(
+ List<AnnotationEntry> annotationEntries,
+ List<Annotation> annotations, AnnotationEntry templateEntry)
+ {
+ for (Annotation annotation : annotations)
+ {
+ annotationEntries.add(createAnnotationEntry(annotation,
+ templateEntry));
}
}
- protected AnnotationEntry createAnnotationEntry(Annotation foundAnnotation, AnnotationEntry templateEntry) {
+ protected AnnotationEntry createAnnotationEntry(Annotation foundAnnotation,
+ AnnotationEntry templateEntry)
+ {
AnnotationEntry entry = new AnnotationEntry();
entry.setAnnotation(foundAnnotation);
entry.setEntityClass(templateEntry.getEntityClass());
- entry.setValueBindingExpression(templateEntry.getValueBindingExpression());
+ entry.setValueBindingExpression(templateEntry
+ .getValueBindingExpression());
entry.setBoundTo(templateEntry.getBoundTo());
return entry;
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/AbstractCustomNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/AbstractCustomNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/AbstractCustomNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/AbstractCustomNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.mapper;
@@ -25,19 +25,25 @@
*
* @author Gerhard Petracek
*/
-public abstract class AbstractCustomNameMapper<T> implements NameMapper<T> {
+public abstract class AbstractCustomNameMapper<T> implements NameMapper<T>
+{
private NameMapper<T> customNameMapper;
- public String createName(T source) {
- if (customNameMapper == null) {
+ public String createName(T source)
+ {
+ if (customNameMapper == null)
+ {
String className = getCustomNameMapperClassName();
- if (className != null) {
- customNameMapper = (NameMapper<T>) ClassUtils.tryToInstantiateClassForName(className);
+ if (className != null)
+ {
+ customNameMapper = (NameMapper<T>) ClassUtils
+ .tryToInstantiateClassForName(className);
}
}
- return (customNameMapper != null) ? customNameMapper.createName(source) : null;
+ return (customNameMapper != null) ? customNameMapper.createName(source)
+ : null;
}
protected abstract String getCustomNameMapperClassName();
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/NameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/NameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/NameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/mapper/NameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,26 +1,27 @@
/*
- * 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.
+ * 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.mapper;
/**
* @author Gerhard Petracek
*/
-public interface NameMapper<T> {
+public interface NameMapper<T>
+{
String createName(T source);
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/AbstractValidationErrorMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/AbstractValidationErrorMessageResolver.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/AbstractValidationErrorMessageResolver.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/AbstractValidationErrorMessageResolver.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver;
@@ -30,20 +30,25 @@
/**
* @author Gerhard Petracek
*/
-public abstract class AbstractValidationErrorMessageResolver implements MessageResolver {
+public abstract class AbstractValidationErrorMessageResolver implements
+ MessageResolver
+{
private static String deactivateDefaultConvention = WebXmlParameter.DEACTIVATE_DEFAULT_CONVENTION;
private static ResourceBundle defaultBundle = null;
protected final Log logger = LogFactory.getLog(getClass());
- public String getMessage(String key, Locale locale) {
- if (key == null || key.equals("")) {
+ public String getMessage(String key, Locale locale)
+ {
+ if (key == null || key.equals(""))
+ {
return null;
}
String customMessage = tryToUseMessageBundleConvention(key, locale);
- if (customMessage != null) {
+ if (customMessage != null)
+ {
return customMessage;
}
@@ -53,45 +58,66 @@
ResourceBundle resourceBundle = null;
//try to load custom messages
- try {
- resourceBundle = ResourceBundle.getBundle(getCustomBaseName(), locale);
+ try
+ {
+ resourceBundle = ResourceBundle.getBundle(getCustomBaseName(),
+ locale);
}
- catch (Throwable t) {
+ catch (Throwable t)
+ {
//do nothing - it was just a try
}
- if (resourceBundle != null) {
- try {
+ if (resourceBundle != null)
+ {
+ try
+ {
customMessage = resourceBundle.getString(key);
}
- catch (MissingResourceException e) {
- logger.trace("no custom message for " + key + " within " + getCustomBaseName());
+ catch (MissingResourceException e)
+ {
+ logger.trace("no custom message for " + key + " within "
+ + getCustomBaseName());
}
}
//use custom name (if possible) otherwise: fallback to default message (if possible)
- return (customMessage != null) ? customMessage : (getBaseName() != null) ? ResourceBundle.getBundle(getBaseName(), locale).getString(key) : null;
+ return (customMessage != null) ? customMessage
+ : (getBaseName() != null) ? ResourceBundle.getBundle(
+ getBaseName(), locale).getString(key) : null;
}
- private String tryToUseMessageBundleConvention(String key, Locale locale) {
+ private String tryToUseMessageBundleConvention(String key, Locale locale)
+ {
String customMessage = null;
- if ((deactivateDefaultConvention == null || !deactivateDefaultConvention.equalsIgnoreCase("true")) &&
- isDefaultMessageBundleConventionActive()) {
- if (defaultBundle == null) {
- try {
- defaultBundle = ResourceBundle.getBundle(ExtValUtils.getInformationProviderBean().getConventionForMessageBundle(), locale);
- } catch (Throwable t) {
+ if ((deactivateDefaultConvention == null || !deactivateDefaultConvention
+ .equalsIgnoreCase("true"))
+ && isDefaultMessageBundleConventionActive())
+ {
+ if (defaultBundle == null)
+ {
+ try
+ {
+ defaultBundle = ResourceBundle.getBundle(ExtValUtils
+ .getInformationProviderBean()
+ .getConventionForMessageBundle(), locale);
+ }
+ catch (Throwable t)
+ {
//do nothing
deactivateDefaultConvention = "true";
}
}
- if (defaultBundle != null) {
- try {
+ if (defaultBundle != null)
+ {
+ try
+ {
customMessage = defaultBundle.getString(key);
}
- catch (MissingResourceException e) {
+ catch (MissingResourceException e)
+ {
//do nothing
}
}
@@ -100,13 +126,15 @@
return customMessage;
}
- protected boolean isDefaultMessageBundleConventionActive() {
+ protected boolean isDefaultMessageBundleConventionActive()
+ {
return true;
}
protected abstract String getBaseName();
- protected String getCustomBaseName() {
+ protected String getCustomBaseName()
+ {
return null;
}
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/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/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultMessageResolverFactory.java Thu Jul 31 10:28:59 2008
@@ -1,77 +1,107 @@
/*
- * 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.
+ * 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.message.resolver;
-import org.apache.myfaces.extensions.validator.core.ClassMappingFactory;
-import org.apache.myfaces.extensions.validator.core.mapper.NameMapper;
-import org.apache.myfaces.extensions.validator.core.validation.message.resolver.mapper.*;
-import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
-import org.apache.myfaces.extensions.validator.util.ClassUtils;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.myfaces.extensions.validator.core.ClassMappingFactory;
+import org.apache.myfaces.extensions.validator.core.mapper.NameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.message.
+ resolver.mapper.CustomConfiguredValidationStrategyToMsgResolverNameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.message.
+ resolver.mapper.CustomConventionValidationStrategyToMsgResolverNameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.message.
+ resolver.mapper.DefaultModuleValidationStrategyToMsgResolverNameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.message.
+ resolver.mapper.DefaultValidationStrategyToMsgResolverNameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.message.
+ resolver.mapper.SimpleValidationStrategyToMsgResolverNameMapper;
+import org.apache.myfaces.extensions.validator.core.validation.strategy.ValidationStrategy;
+import org.apache.myfaces.extensions.validator.util.ClassUtils;
+
/**
* @author Gerhard Petracek
*/
//TODO add generic java api (de-/register mapping)
-public class DefaultMessageResolverFactory implements ClassMappingFactory<ValidationStrategy, MessageResolver> {
- private static Map<String, String> strategyMessageResolverMapping = new HashMap<String, String>();
- private static List<NameMapper<ValidationStrategy>> nameMapperList = new ArrayList<NameMapper<ValidationStrategy>>();
-
- static {
- nameMapperList.add(new CustomConfiguredValidationStrategyToMsgResolverNameMapper());
- nameMapperList.add(new CustomConventionValidationStrategyToMsgResolverNameMapper());
- nameMapperList.add(new DefaultValidationStrategyToMsgResolverNameMapper());
- nameMapperList.add(new DefaultModuleValidationStrategyToMsgResolverNameMapper());
- nameMapperList.add(new SimpleValidationStrategyToMsgResolverNameMapper());
+public class DefaultMessageResolverFactory implements
+ ClassMappingFactory<ValidationStrategy, MessageResolver>
+{
+ private static Map<String, String> strategyMessageResolverMapping =
+ new HashMap<String, String>();
+ private static List<NameMapper<ValidationStrategy>> nameMapperList =
+ new ArrayList<NameMapper<ValidationStrategy>>();
+
+ static
+ {
+ nameMapperList
+ .add(new CustomConfiguredValidationStrategyToMsgResolverNameMapper());
+ nameMapperList
+ .add(new CustomConventionValidationStrategyToMsgResolverNameMapper());
+ nameMapperList
+ .add(new DefaultValidationStrategyToMsgResolverNameMapper());
+ nameMapperList
+ .add(new DefaultModuleValidationStrategyToMsgResolverNameMapper());
+ nameMapperList
+ .add(new SimpleValidationStrategyToMsgResolverNameMapper());
}
- public MessageResolver create(ValidationStrategy validationStrategy) {
+ public MessageResolver create(ValidationStrategy validationStrategy)
+ {
String strategyName = validationStrategy.getClass().getName();
- if (strategyMessageResolverMapping.containsKey(strategyName)) {
- return (MessageResolver) ClassUtils.tryToInstantiateClassForName(strategyMessageResolverMapping.get(strategyName));
+ if (strategyMessageResolverMapping.containsKey(strategyName))
+ {
+ return (MessageResolver) ClassUtils
+ .tryToInstantiateClassForName(strategyMessageResolverMapping
+ .get(strategyName));
}
MessageResolver messageResolver;
String resolverName;
- for (NameMapper<ValidationStrategy> nameMapper : nameMapperList) {
+ for (NameMapper<ValidationStrategy> nameMapper : nameMapperList)
+ {
//build convention (ValidationErrorMessageResolver)
resolverName = nameMapper.createName(validationStrategy);
- messageResolver = (MessageResolver) ClassUtils.tryToInstantiateClassForName(resolverName);
+ messageResolver = (MessageResolver) ClassUtils
+ .tryToInstantiateClassForName(resolverName);
- if (messageResolver != null) {
+ if (messageResolver != null)
+ {
addMapping(strategyName, resolverName);
return messageResolver;
}
}
- addMapping(strategyName, DefaultValidationErrorMessageResolver.class.getName());
+ addMapping(strategyName, DefaultValidationErrorMessageResolver.class
+ .getName());
return new DefaultValidationErrorMessageResolver();
}
- private void addMapping(String strategyName, String messageResolverName) {
- synchronized (DefaultMessageResolverFactory.class) {
- strategyMessageResolverMapping.put(strategyName, messageResolverName);
+ private void addMapping(String strategyName, String messageResolverName)
+ {
+ synchronized (DefaultMessageResolverFactory.class)
+ {
+ strategyMessageResolverMapping.put(strategyName,
+ messageResolverName);
}
//TODO logging
}
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/DefaultValidationErrorMessageResolver.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver;
@@ -24,15 +24,21 @@
/**
* @author Gerhard Petracek
*/
-public class DefaultValidationErrorMessageResolver extends AbstractValidationErrorMessageResolver {
+public class DefaultValidationErrorMessageResolver extends
+ AbstractValidationErrorMessageResolver
+{
private static final String CUSTOM_BUNDLE = WebXmlParameter.CUSTOM_MESSAGE_BUNDLE;
//not used at the moment - just for a convention
- protected String getBaseName() {
- return ExtValUtils.getInformationProviderBean().getConventionForModuleMessageBundle(getClass().getPackage().getName());
+ protected String getBaseName()
+ {
+ return ExtValUtils.getInformationProviderBean()
+ .getConventionForModuleMessageBundle(
+ getClass().getPackage().getName());
}
- protected String getCustomBaseName() {
+ protected String getCustomBaseName()
+ {
return CUSTOM_BUNDLE;
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/MessageResolver.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver;
@@ -23,6 +23,7 @@
/**
* @author Gerhard Petracek
*/
-public interface MessageResolver {
+public interface MessageResolver
+{
String getMessage(String key, Locale locale);
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConfiguredValidationStrategyToMsgResolverNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConfiguredValidationStrategyToMsgResolverNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConfiguredValidationStrategyToMsgResolverNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConfiguredValidationStrategyToMsgResolverNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver.mapper;
@@ -25,9 +25,12 @@
/**
* @author Gerhard Petracek
*/
-public class CustomConfiguredValidationStrategyToMsgResolverNameMapper extends AbstractCustomNameMapper<ValidationStrategy> {
+public class CustomConfiguredValidationStrategyToMsgResolverNameMapper extends
+ AbstractCustomNameMapper<ValidationStrategy>
+{
- protected String getCustomNameMapperClassName() {
+ protected String getCustomNameMapperClassName()
+ {
return WebXmlParameter.CUSTOM_STRATEGY_TO_MESSAGE_RESOLVER_NAME_MAPPER;
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConventionValidationStrategyToMsgResolverNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConventionValidationStrategyToMsgResolverNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConventionValidationStrategyToMsgResolverNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/CustomConventionValidationStrategyToMsgResolverNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver.mapper;
@@ -25,9 +25,13 @@
/**
* @author Gerhard Petracek
*/
-public class CustomConventionValidationStrategyToMsgResolverNameMapper extends AbstractCustomNameMapper<ValidationStrategy> {
+public class CustomConventionValidationStrategyToMsgResolverNameMapper extends
+ AbstractCustomNameMapper<ValidationStrategy>
+{
- protected String getCustomNameMapperClassName() {
- return ExtValUtils.getInformationProviderBean().getCustomValidationStrategyToMsgResolverNameMapper();
+ protected String getCustomNameMapperClassName()
+ {
+ return ExtValUtils.getInformationProviderBean()
+ .getCustomValidationStrategyToMsgResolverNameMapper();
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultModuleValidationStrategyToMsgResolverNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultModuleValidationStrategyToMsgResolverNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultModuleValidationStrategyToMsgResolverNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultModuleValidationStrategyToMsgResolverNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver.mapper;
@@ -23,10 +23,13 @@
/**
* @author Gerhard Petracek
*/
-public class DefaultModuleValidationStrategyToMsgResolverNameMapper extends DefaultValidationStrategyToMsgResolverNameMapper {
+public class DefaultModuleValidationStrategyToMsgResolverNameMapper extends
+ DefaultValidationStrategyToMsgResolverNameMapper
+{
@Override
- protected String getClassName(String strategyClassName) {
+ protected String getClassName(String strategyClassName)
+ {
return DefaultValidationErrorMessageResolver.class.getSimpleName();
}
}
\ No newline at end of file
Modified: myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultValidationStrategyToMsgResolverNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultValidationStrategyToMsgResolverNameMapper.java?rev=681422&r1=681421&r2=681422&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultValidationStrategyToMsgResolverNameMapper.java (original)
+++ myfaces/extensions/validator/branches/trunk_layout_myfaces/core/src/main/java/org/apache/myfaces/extensions/validator/core/validation/message/resolver/mapper/DefaultValidationStrategyToMsgResolverNameMapper.java Thu Jul 31 10:28:59 2008
@@ -1,20 +1,20 @@
/*
- * 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.
+ * 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.message.resolver.mapper;
@@ -25,12 +25,21 @@
/**
* @author Gerhard Petracek
*/
-public class DefaultValidationStrategyToMsgResolverNameMapper implements NameMapper<ValidationStrategy> {
- public String createName(ValidationStrategy validationStrategy) {
- return ExtValUtils.getInformationProviderBean().getConventionNameForMessageResolverPackage(validationStrategy.getClass(), getClassName(validationStrategy.getClass().getSimpleName()));
+public class DefaultValidationStrategyToMsgResolverNameMapper implements
+ NameMapper<ValidationStrategy>
+{
+ public String createName(ValidationStrategy validationStrategy)
+ {
+ return ExtValUtils.getInformationProviderBean()
+ .getConventionNameForMessageResolverPackage(
+ validationStrategy.getClass(),
+ getClassName(validationStrategy.getClass()
+ .getSimpleName()));
}
- protected String getClassName(String strategyClassName) {
- return ExtValUtils.getInformationProviderBean().getConventionNameForMessageResolverClass(strategyClassName);
+ protected String getClassName(String strategyClassName)
+ {
+ return ExtValUtils.getInformationProviderBean()
+ .getConventionNameForMessageResolverClass(strategyClassName);
}
}
\ No newline at end of file