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 1408 2007-03-31 16:14:52Z rainerh $
Author:
Rainer Hermanns, jepjep

Field Summary
private static Pattern GETTER_PATTERN
           
private static Pattern SETTER_PATTERN
           
 
Constructor Summary
AnnotationValidationConfigurationBuilder()
           
 
Method Summary
static List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass)
           
private static Date parseDateString(String value)
           
private static List<ValidatorConfig> processAnnotations(Object o)
           
private static ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v, String fieldName)
           
private static ValidatorConfig processCustomValidatorAnnotation(CustomValidator v, String fieldName)
           
private static ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v, String fieldName)
           
private static ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v, String fieldName)
           
private static ValidatorConfig processEmailValidatorAnnotation(EmailValidator v, String fieldName)
           
private static ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v, String fieldName)
           
private static ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v, String fieldName)
           
private static ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v, String fieldName)
           
private static ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v, String fieldName)
           
private static ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v, String fieldName)
           
private static ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v, String fieldName)
           
private static ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v, String fieldName)
           
private static ValidatorConfig processUrlValidatorAnnotation(UrlValidator v, String fieldName)
           
private static void processValidationAnnotation(Annotation a, String fieldName, List<ValidatorConfig> result)
           
private static ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v, String fieldName)
           
static 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
Constructor Detail

AnnotationValidationConfigurationBuilder

public AnnotationValidationConfigurationBuilder()
Method Detail

processAnnotations

private static List<ValidatorConfig> processAnnotations(Object o)

processValidationAnnotation

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

processExpressionValidatorAnnotation

private static ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v,
                                                                    String fieldName)

processCustomValidatorAnnotation

private static ValidatorConfig processCustomValidatorAnnotation(CustomValidator v,
                                                                String fieldName)

processRegexFieldValidatorAnnotation

private static ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v,
                                                                    String fieldName)

processVisitorFieldValidatorAnnotation

private static ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v,
                                                                      String fieldName)

processUrlValidatorAnnotation

private static ValidatorConfig processUrlValidatorAnnotation(UrlValidator v,
                                                             String fieldName)

processStringLengthFieldValidatorAnnotation

private static ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v,
                                                                           String fieldName)

parseDateString

private static Date parseDateString(String value)

processRequiredStringValidatorAnnotation

private static ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v,
                                                                        String fieldName)

processRequiredFieldValidatorAnnotation

private static ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v,
                                                                       String fieldName)

processIntRangeFieldValidatorAnnotation

private static ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v,
                                                                       String fieldName)

processDoubleRangeFieldValidatorAnnotation

private static ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v,
                                                                          String fieldName)

processFieldExpressionValidatorAnnotation

private static ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v,
                                                                         String fieldName)

processEmailValidatorAnnotation

private static ValidatorConfig processEmailValidatorAnnotation(EmailValidator v,
                                                               String fieldName)

processDateRangeFieldValidatorAnnotation

private static ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v,
                                                                        String fieldName)

processConversionErrorFieldValidatorAnnotation

private static ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v,
                                                                              String fieldName)

buildAnnotationClassValidatorConfigs

public static List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass)

resolvePropertyName

public static 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-2008 Apache Software Foundation. All Rights Reserved.