@Override public <T> T unwrap(Class<T> aClass) { return validator.unwrap(aClass); }
@Override public <T> T unwrap(final Class<T> type) { return delegate.unwrap(type); }
@Override @SuppressWarnings("unchecked") public <T> T unwrap(@Nullable Class<T> type) { Assert.state(this.targetValidator != null, "No target Validator set"); try { return (type != null ? this.targetValidator.unwrap(type) : (T) this.targetValidator); } catch (ValidationException ex) { // ignore if just being asked for plain Validator if (javax.validation.Validator.class == type) { return (T) this.targetValidator; } throw ex; } }
@Override @SuppressWarnings("unchecked") public <T> T unwrap(@Nullable Class<T> type) { Assert.state(this.targetValidator != null, "No target Validator set"); try { return (type != null ? this.targetValidator.unwrap(type) : (T) this.targetValidator); } catch (ValidationException ex) { // ignore if just being asked for plain Validator if (javax.validation.Validator.class == type) { return (T) this.targetValidator; } throw ex; } }
/** * Set the JSR-303 Validator to delegate to for validating methods. * <p>Default is the default ValidatorFactory's default Validator. */ public void setValidator(Validator validator) { // Unwrap to the native Validator with forExecutables support if (validator instanceof LocalValidatorFactoryBean) { this.validator = ((LocalValidatorFactoryBean) validator).getValidator(); } else if (validator instanceof SpringValidatorAdapter) { this.validator = validator.unwrap(Validator.class); } else { this.validator = validator; } }
/** * Set the JSR-303 Validator to delegate to for validating methods. * <p>Default is the default ValidatorFactory's default Validator. */ public void setValidator(Validator validator) { // Unwrap to the native Validator with forExecutables support if (validator instanceof LocalValidatorFactoryBean) { this.validator = ((LocalValidatorFactoryBean) validator).getValidator(); } else if (validator instanceof SpringValidatorAdapter) { this.validator = validator.unwrap(Validator.class); } else { this.validator = validator; } }
@Override public <T> T unwrap(final Class<T> aClass) { return validator.unwrap(aClass); } }
/** * {@inheritDoc} */ public <T> T unwrap(Class<T> type) { return validator.unwrap(type); }
@Override public <T> T unwrap(Class<T> tClass) { return delegate.unwrap(tClass); }
@Override public <T> T unwrap(final Class<T> type) { return delegate.unwrap(type); }
@Override public <T> T unwrap(Class<T> aClass) { return validator.unwrap(aClass); }
@Override public <T> T unwrap(Class<T> entityClass) { return validator.unwrap(entityClass); }
@Override @SuppressWarnings("unchecked") public <T> T unwrap(Class<T> type) { Assert.state(this.targetValidator != null, "No target Validator set"); try { return (type != null ? this.targetValidator.unwrap(type) : (T) this.targetValidator); } catch (ValidationException ex) { // ignore if just being asked for plain Validator if (javax.validation.Validator.class == type) { return (T) this.targetValidator; } throw ex; } }
@Override public MethodValidator create(CreationalContext<MethodValidator> ctx) { return getReference(bm, ValidatorFactory.class).getValidator().unwrap(MethodValidator.class); }
@Override @SuppressWarnings("unchecked") public <T> T unwrap(@Nullable Class<T> type) { Assert.state(this.targetValidator != null, "No target Validator set"); try { return (type != null ? this.targetValidator.unwrap(type) : (T) this.targetValidator); } catch (ValidationException ex) { // ignore if just being asked for plain Validator if (javax.validation.Validator.class == type) { return (T) this.targetValidator; } throw ex; } }
/** * {@inheritDoc} */ public <T> T unwrap(Class<T> tClass) { return getValidator().unwrap(tClass); } }
/** * {@inheritDoc} */ public <T> T unwrap(Class<T> tClass) { return getValidator().unwrap(tClass); } }
/** * {@inheritDoc} */ public <T> T unwrap(Class<T> tClass) { return getValidator().unwrap(tClass); } }
public static final <T> T unwrap(Class<T> type) { return getRequiredValidator().unwrap(type); }
private Object getValidatorObject() { try { final ProviderSpecificBootstrap<?> provider = (ProviderSpecificBootstrap<?>) byProviderMethod.invoke(null, providerClass); return provider.configure().buildValidatorFactory().getValidator().unwrap(unwrapClass); } catch (final IllegalAccessException e) { throw new IllegalStateException(e); } catch (final InvocationTargetException e) { throw new IllegalStateException(e); } } }