net.sourceforge.annovalidator.validation.annotations
Annotation Type ValidatorDescriptor


@Retention(value=RUNTIME)
@Target(value=ANNOTATION_TYPE)
public @interface ValidatorDescriptor

Annotation to identify a validator annotation. The value of this annotation should contain the class used to perform the validation.


Required Element Summary
 java.lang.Class<?> validatorClass
          The class of the validator used to validate Fields with the annotated Annotation.
 
Optional Element Summary
 ValidatorDescriptor.ArgumentMapping[] argumentMappings
          Specifies which fields in the marked annotation should be mapped to which arguments in the validator method.
 java.lang.String errorCode
          Custom error code used to display a message if this validation fails.
 java.lang.String errorCodeSuffix
          Suffix to append to a generated error code to identify the particular validation that has taken place.
 java.lang.Class<?> targetObjectClass
          The class this validation is designed to validate.
 java.lang.String validatorMethodName
          The name of the method in validatorClass that performs the validation.
 

Element Detail

validatorClass

public abstract java.lang.Class<?> validatorClass
The class of the validator used to validate Fields with the annotated Annotation.

validatorMethodName

public abstract java.lang.String validatorMethodName
The name of the method in validatorClass that performs the validation.

Default:
"validate"

errorCodeSuffix

public abstract java.lang.String errorCodeSuffix
Suffix to append to a generated error code to identify the particular validation that has taken place. Not used if customErrorCode is used.

Default:
""

errorCode

public abstract java.lang.String errorCode
Custom error code used to display a message if this validation fails.

Default:
""

argumentMappings

public abstract ValidatorDescriptor.ArgumentMapping[] argumentMappings
Specifies which fields in the marked annotation should be mapped to which arguments in the validator method. By default, the first argument (at index 0) is mapped to the Field being validated.

Default:
@net.sourceforge.annovalidator.validation.annotations.ValidatorDescriptor.ArgumentMapping

targetObjectClass

public abstract java.lang.Class<?> targetObjectClass
The class this validation is designed to validate. Optional- defaults to Object.class.

Default:
java.lang.Object.class


Copyright © 2008. All Rights Reserved.