Imagine following situation...
My project is based on following modules:
-api
-infrastructure
-accessor-query
-accessor-command
-xx-query
-xx-command
-zz-query
-zz-command
-web
each command module is dependend on its query module and also on infrastructure and api modules. I would like to have constraint annotation in api for all of my modules, but separate implementation in each of modules.
so basically my annotation looks like
Code:
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {})
public @interface CanNotExists {
String message() default "com.foo.api.domain.validation.annotation.CanNotExists.message";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
is it somehow possible to do this? I mean have separate implementations in separate modules (mainy in command modules) for the same interface? If so what is the configuration for this? I'm using spring in my project so if somebody can tell it by spring way it will be welcome.
Thanks