1 package com.opencsv.bean.validators;
2
3 import java.lang.annotation.*;
4
5 /**
6 * Specifies the binding of a validator to a field in a bean. This validator will run
7 * against the string that will be converted and assigned to the field and will be run
8 * prior to the conversion.
9 *
10 * @author Scott Conway
11 * @since 5.0
12 */
13 @Documented
14 @Retention(RetentionPolicy.RUNTIME)
15 @Target(ElementType.FIELD)
16 public @interface PreAssignmentValidator {
17
18 /**
19 * Returns the validator that will validate the string.
20 *
21 * @return The class of the validator that will validate the bean field
22 * string value
23 */
24 Class<? extends StringValidator> validator();
25
26 /**
27 * This is used to store additional information needed by the
28 * {@link StringValidator}.
29 * This could, for example, contain a regular expression that will be
30 * applied to the data.
31 *
32 * @return Parameter string required by the {@link StringValidator}
33 */
34 String paramString() default "";
35 }