@Test public void shouldValidateUriString() throws Exception { TestDatum datum = new TestDatum(uri); underTest.initialize(getUriStringAnnotation(datum)); assertThat( String.format("'%s' should be %s", uri, valid ? "valid" : "invalid"), underTest.isValid(datum.getUri(), null), is(valid)); }
@Override public boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext) { if (isBlank(uri)) { return true; } try { new URI(uri); return true; } catch (URISyntaxException ignore) { return false; } }
UriStringValidator extends ConstraintValidatorSupport<UriString, String> { @Override public boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext) { if (isBlank(uri)) { return true; } try { new URI(uri); return true; } catch (URISyntaxException ignore) { return false; } } }
UriStringValidator extends ConstraintValidatorSupport<UriString, String> { @Override public boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext) { if (isBlank(uri)) { return true; } try { new URI(uri); return true; } catch (URISyntaxException ignore) { return false; } }  }
UriStringValidator extends ConstraintValidatorSupport<UriString, String> { @Override public boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext) { if (isBlank(uri)) { return true; } try { new URI(uri); return true; } catch (URISyntaxException ignore) { return false; } }  @Override boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext); }
UriStringValidator extends ConstraintValidatorSupport<UriString, String> { @Override public boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext) { if (isBlank(uri)) { return true; } try { new URI(uri); return true; } catch (URISyntaxException ignore) { return false; } }  @Override boolean isValid(final String uri, final ConstraintValidatorContext constraintValidatorContext);  }