Hi,
I have the following:
Code:
@Target({FIELD, ANNOTATION_TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy = OptionalTextFieldCheck.class)
@Documented
@Length(min = 1)
public @interface OptionalTextField {
public abstract Class<? extends Payload>[] payload() default {};
public abstract Class<?>[] groups() default {};
public abstract String message() default "{error.textField}";
/**
* Maximum length of the field
*/
public abstract int value();
}
I want to set the max value on the @Length constraint to the value passed to @OptionalTextField. I've looked, and there doesn't seem to be any way of setting it programatically. Is there any way to do this?
TIA:
Bryan