@Documented @Constraint(validatedBy=CurrencyValidator.class) @Target(value={METHOD,FIELD,PARAMETER}) @Retention(value=RUNTIME) public @interface CurrencyConstraint
It will validate true for null, empty or blank values to bypass validation when the field is optional. If you require a currency code to be mandatory, combine this constraint with @NotBlank.
for implementation details