Thursday, March 28, 2013

How to use Gin DI in custom ConstraintValidator (Bean Validation)?

For example i have some CodeValidator with dependencies.

public class ExistingCustomsCodeValidator implements ConstraintValidator<ExistingCustomsCode, String> {
    @Inject private CustomsCodeService customsCodeService;
    @Inject private ProcessingCtx processingCtx;

    @Override public void initialize(ExistingCustomsCode constraintAnnotation) {}

    @Override public boolean isValid(String value, ConstraintValidatorContext context) {
        return customsCodeService.isValid(value, processingCtx.getDeclarationDateTime());

I can simply inject dependencies on server-side, but i can't imagine how to do this on client-side.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment