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


@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public static @interface ValidatorDescriptor.ArgumentMapping

Annotation for mapping a value in the validator to an argument in the validator method.

The mappings that can be specified (in the type parameter) are:

ANNOTATION_VALUE
The value parameter of the annotation.
ANNOTATION_PARAMETER
The value of a named parameter of the annotation. If this is used, then the parameterName parameter must be populated.
TARGET_FIELD_VALUE
The value of the Field being validated.
TARGET_FIELD
The Field being validated.
TARGET_OBJECT
The Object being validated.
TARGET_OBJECT_FIELD
A named Field of the Object being validated.
TARGET_OBJECT_FIELD_VALUE
The value of a named Field of the Object being validated.

By default, a mapping of type TARGET_FIELD is mapped to the first argument of the validation method.


Optional Element Summary
 java.lang.Class<?> fieldType
          The type of the data held by the Field named by parameterName() when type is TARGET_OBJECT_FIELD_VALUE.
 int index
          The index of the Method argument that is mapped by this ArgumentMapping.
 java.lang.String parameterName
          The name of a parameter in an Annotation, used if type is ANNOTATION_PARAMETER.
 ValidatorDescriptor.ArgumentMapping.ArgumentType type
          The ArgumentType of this ArgumentMapping.
 

type

public abstract ValidatorDescriptor.ArgumentMapping.ArgumentType type
The ArgumentType of this ArgumentMapping.

Default:
TARGET_FIELD_VALUE

parameterName

public abstract java.lang.String parameterName
The name of a parameter in an Annotation, used if type is ANNOTATION_PARAMETER.

Default:
""

fieldType

public abstract java.lang.Class<?> fieldType
The type of the data held by the Field named by parameterName() when type is TARGET_OBJECT_FIELD_VALUE. Default type is Object.

Default:
java.lang.Object.class

index

public abstract int index
The index of the Method argument that is mapped by this ArgumentMapping. The default value is 0.

Default:
0


Copyright © 2008. All Rights Reserved.