com.opensymphony.xwork2.validator
Class AnnotationValidationConfigurationBuilder

java.lang.Object
  extended by com.opensymphony.xwork2.validator.AnnotationValidationConfigurationBuilder

public class AnnotationValidationConfigurationBuilder
extends Object

AnnotationValidationConfigurationBuilder

Version:
$Id: AnnotationValidationConfigurationBuilder.java 1833 2008-06-21 09:29:39Z rainerh $
Author:
Rainer Hermanns, jepjep

Field Summary
private static Pattern GETTER_PATTERN
           
private static Pattern SETTER_PATTERN
           
private  ValidatorFactory validatorFactory
           
 
Constructor Summary
AnnotationValidationConfigurationBuilder(ValidatorFactory fac)
           
 
Method Summary
 List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass)
           
private  Date parseDateString(String value)
           
private  List<ValidatorConfig> processAnnotations(Object o)
           
private  ValidatorConfig processConditionalVisitorFieldValidatorAnnotation(ConditionalVisitorFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processCustomValidatorAnnotation(CustomValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processEmailValidatorAnnotation(EmailValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v, String fieldName, String methodName)
           
private  ValidatorConfig processUrlValidatorAnnotation(UrlValidator v, String fieldName, String methodName)
           
private  void processValidationAnnotation(Annotation a, String fieldName, String methodName, List<ValidatorConfig> result)
           
private  ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v, String fieldName, String methodName)
           
 String resolvePropertyName(Method method)
          Returns the property name for a method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETTER_PATTERN

private static final Pattern SETTER_PATTERN

GETTER_PATTERN

private static final Pattern GETTER_PATTERN

validatorFactory

private ValidatorFactory validatorFactory
Constructor Detail

AnnotationValidationConfigurationBuilder

public AnnotationValidationConfigurationBuilder(ValidatorFactory fac)
Method Detail

processAnnotations

private List<ValidatorConfig> processAnnotations(Object o)

processValidationAnnotation

private void processValidationAnnotation(Annotation a,
                                         String fieldName,
                                         String methodName,
                                         List<ValidatorConfig> result)

processExpressionValidatorAnnotation

private ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v,
                                                             String fieldName,
                                                             String methodName)

processCustomValidatorAnnotation

private ValidatorConfig processCustomValidatorAnnotation(CustomValidator v,
                                                         String fieldName,
                                                         String methodName)

processRegexFieldValidatorAnnotation

private ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v,
                                                             String fieldName,
                                                             String methodName)

processConditionalVisitorFieldValidatorAnnotation

private ValidatorConfig processConditionalVisitorFieldValidatorAnnotation(ConditionalVisitorFieldValidator v,
                                                                          String fieldName,
                                                                          String methodName)

processVisitorFieldValidatorAnnotation

private ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v,
                                                               String fieldName,
                                                               String methodName)

processUrlValidatorAnnotation

private ValidatorConfig processUrlValidatorAnnotation(UrlValidator v,
                                                      String fieldName,
                                                      String methodName)

processStringLengthFieldValidatorAnnotation

private ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v,
                                                                    String fieldName,
                                                                    String methodName)

parseDateString

private Date parseDateString(String value)

processRequiredStringValidatorAnnotation

private ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v,
                                                                 String fieldName,
                                                                 String methodName)

processRequiredFieldValidatorAnnotation

private ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v,
                                                                String fieldName,
                                                                String methodName)

processIntRangeFieldValidatorAnnotation

private ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v,
                                                                String fieldName,
                                                                String methodName)

processDoubleRangeFieldValidatorAnnotation

private ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v,
                                                                   String fieldName,
                                                                   String methodName)

processFieldExpressionValidatorAnnotation

private ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v,
                                                                  String fieldName,
                                                                  String methodName)

processEmailValidatorAnnotation

private ValidatorConfig processEmailValidatorAnnotation(EmailValidator v,
                                                        String fieldName,
                                                        String methodName)

processDateRangeFieldValidatorAnnotation

private ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v,
                                                                 String fieldName,
                                                                 String methodName)

processConversionErrorFieldValidatorAnnotation

private ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v,
                                                                       String fieldName,
                                                                       String methodName)

buildAnnotationClassValidatorConfigs

public List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass)

resolvePropertyName

public String resolvePropertyName(Method method)
Returns the property name for a method. This method is independant from property fields.

Parameters:
method - The method to get the property name for.
Returns:
the property name for given method; null if non could be resolved.


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.