@InitBinder public void dataBinding(WebDataBinder binder) { binder.addValidators(feriasValidation); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, "dataInicio", new CustomDateEditor(dateFormat, true)); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.addValidators( new Validator() { @Override public boolean supports(Class<?> clazz) { return SearchElementEntity.class.isAssignableFrom(clazz); } @Override public void validate(Object target, Errors errors) { SearchElementEntity<?> element = (SearchElementEntity<?>) target; for (AttributeEntity attr : element.getAttributes()) { if (!attr.getType().getName().equals(attr.getValue().getClass().getName())) { if (conversionService.canConvert(attr.getValue().getClass(), attr.getType())) { attr.setValue(conversionService.convert(attr.getValue(), attr.getType())); } } } } }); }
@InitBinder("preferences") protected void initBinder(WebDataBinder binder) { binder.addValidators(new BaselineRequestPreferencesValidator()); }
@InitBinder public void initBinderAll(WebDataBinder binder) { binder.addValidators(new ComputerValidator()); }
@InitBinder("form") public void initBinder(WebDataBinder binder) { binder.addValidators(mediaCreateFormValidator); }
@InitBinder("form") public void initBinder(WebDataBinder binder) { binder.addValidators(messageSendFormValidator); }
@InitBinder("form") public void initBinder(WebDataBinder binder) { binder.addValidators(reminderValidator); }
@InitBinder("form") public void initBinder(WebDataBinder binder) { binder.addValidators(userUpdateFormValidator); }
/** Configure validator */ @InitBinder("researchOutput") protected void initBinder(WebDataBinder binder) { binder.addValidators(new ResearchOutputValidator()); }
@InitBinder protected void initBinder(WebDataBinder binder) { binder.addValidators(lunchMenuDtoValidator); }