@Test public void not_empty_collection_value() throws Exception { MessageFormatter formatter = mockMessageFormatter(); Field field = mockField(); Html5Support html5Support = mockHtml5Support(); replay(); new Required(null, html5Support).validate(field, null, formatter, Arrays.asList("A", "B")); verify(); }
public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value) throws ValidationException { if (value == null || InternalUtils.isEmptyCollection(value) || InternalUtils.isBlank(value.toString())) throw new ValidationException(buildMessage(formatter, field)); }
Required extends AbstractValidator<Void, Object> { public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value) throws ValidationException { if (value == null || InternalUtils.isEmptyCollection(value) || InternalUtils.isBlank(value.toString())) throw new ValidationException(buildMessage(formatter, field)); } }
Required extends AbstractValidator<Void, Object> { public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value) throws ValidationException { if (value == null || InternalUtils.isEmptyCollection(value) || InternalUtils.isBlank(value.toString())) throw new ValidationException(buildMessage(formatter, field)); } Required(JavaScriptSupport javaScriptSupport, Html5Support html5Support); }
Required extends AbstractValidator<Void, Object> { public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value) throws ValidationException { if (value == null || InternalUtils.isEmptyCollection(value) || InternalUtils.isBlank(value.toString())) throw new ValidationException(buildMessage(formatter, field)); } Required(JavaScriptSupport javaScriptSupport, Html5Support html5Support); void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value); boolean isRequired(); void render(Field field, Void constraintValue, MessageFormatter formatter, MarkupWriter writer,
                       FormSupport formSupport); }
Required extends AbstractValidator<Void, Object> { public void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value) throws ValidationException { if (value == null || InternalUtils.isEmptyCollection(value) || InternalUtils.isBlank(value.toString())) throw new ValidationException(buildMessage(formatter, field)); } Required(JavaScriptSupport javaScriptSupport, Html5Support html5Support); void validate(Field field, Void constraintValue, MessageFormatter formatter, Object value); boolean isRequired(); void render(Field field, Void constraintValue, MessageFormatter formatter, MarkupWriter writer,
                       FormSupport formSupport);  }