Skip to content

Instantly share code, notes, and snippets.

@BumpeiShimada
Last active November 16, 2018 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BumpeiShimada/51063473d053144031f0ed0896a3c472 to your computer and use it in GitHub Desktop.
Save BumpeiShimada/51063473d053144031f0ed0896a3c472 to your computer and use it in GitHub Desktop.
@Service
@AllArgsConstructor(onConstructor = @__(@Autowired))
public class ValidationService {
private ValidatorFactory factory;
public void execute(boolean isExclusive, EventForm form, List<String> errors) {
List<BaseValidator> validators = factory.get(isExclusive);
validators.forEach(validator -> {
validator.validate(form, errors);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment