Skip to content

Instantly share code, notes, and snippets.

@sizovs
Created January 5, 2015 12:38
Show Gist options
  • Save sizovs/8c1bb777286a8cc888d4 to your computer and use it in GitHub Desktop.
Save sizovs/8c1bb777286a8cc888d4 to your computer and use it in GitHub Desktop.
interface Validator
validate(Q)
@Qualifier
@Inherited
@interface V1Annotation {
}
@Component
@V1Annotation
class V1 impl Val
@Component
class V2 impl Val
@Component
class V3 impl Val
@Component
class CompositeValidator implements Validator {
@Autowired
Collection<Validator> validators
validate() {
forEach(validators:validate)
}
}
class Client {
@Autowired
@V1Annotation
Validator validator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment