/** * create validator * * @param constraintValidatorFactory * @param messageInterpolator * @param traversableResolver * @param parameterNameProvider * @param failFast * @param validatedValueHandlers * @return */ protected Validator createValidator(ConstraintValidatorFactory constraintValidatorFactory, MessageInterpolator messageInterpolator, TraversableResolver traversableResolver, ParameterNameProvider parameterNameProvider, boolean failFast, List<ValidatedValueUnwrapper<?>> validatedValueHandlers) { BeanMetaDataManager513 beanMetaDataManager; if (!beanMetaDataManagerMap.containsKey(parameterNameProvider)) { beanMetaDataManager = new BeanMetaDataManager513(constraintHelper, executableHelper, parameterNameProvider, buildDataProviders(parameterNameProvider)); beanMetaDataManagerMap.put(parameterNameProvider, beanMetaDataManager); } else { beanMetaDataManager = beanMetaDataManagerMap.get(parameterNameProvider); } return new ValidatorImpl(constraintValidatorFactory, messageInterpolator, traversableResolver, beanMetaDataManager, parameterNameProvider, typeResolutionHelper, validatedValueHandlers, constraintValidatorManager, failFast); }
public static ValidatorFactory buildValidatorFactory(boolean osgi, ValidationProviderResolver validationProviderResolver, MessageInterpolator messageInterpolator, TraversableResolver traversableResolver, ConstraintValidatorFactory constraintValidatorFactory) { ValidationProviderResolver resolvedValidationProviderResolver = resolveValidationProviderResolver(osgi, validationProviderResolver); GenericBootstrap bootstrap = Validation.byDefaultProvider(); if (resolvedValidationProviderResolver != null) { bootstrap.providerResolver(resolvedValidationProviderResolver); } Configuration<?> configuration = bootstrap.configure(); if (messageInterpolator != null) { configuration.messageInterpolator(messageInterpolator); } if (traversableResolver != null) { configuration.traversableResolver(traversableResolver); } if (constraintValidatorFactory != null) { configuration.constraintValidatorFactory(constraintValidatorFactory); } return configuration.buildValidatorFactory(); }
private GwtValidationContext(final Class<T> rootBeanClass, final T rootBean, final BeanDescriptor beanDescriptor, final MessageInterpolator messageInterpolator, final TraversableResolver traversableResolver, final AbstractGwtValidator validator, final Set<Object> validatedObjects) { this.rootBeanClass = rootBeanClass; this.rootBean = rootBean; this.beanDescriptor = beanDescriptor; this.messageInterpolator = messageInterpolator; this.traversableResolver = traversableResolver; this.validator = validator; this.validatedObjects = new HashSet<>(validatedObjects); }
/** * Specify a custom TraversableResolver to use for this Validator. */ public void setTraversableResolver(TraversableResolver traversableResolver) { this.traversableResolver = traversableResolver; }
@Override public TraversableResolver getTraversableResolver() { Assert.notNull(this.validatorFactory, "No target ValidatorFactory set"); return this.validatorFactory.getTraversableResolver(); }
@Override public TraversableResolver getTraversableResolver() { throw new UnsupportedOperationException(); }
@Override public MinijaxValidationProvider traversableResolver(final TraversableResolver resolver) { throw new UnsupportedOperationException(); }
@Override public TraversableResolver getDefaultTraversableResolver() { throw new UnsupportedOperationException(); }
public TraversableResolver getTraversableResolver() { return traversableResolver; }
/** * To use a custom {@link TraversableResolver} */ public void setTraversableResolver(TraversableResolver traversableResolver) { this.traversableResolver = traversableResolver; }
/** * constructor. */ public AbstractBaseConfigurationState(final ConstraintValidatorFactory constraintValidatorFactory, final MessageInterpolator messageInterpolator, final Map<String, String> properties, final TraversableResolver traversableResolver) { this.constraintValidatorFactory = constraintValidatorFactory; this.messageInterpolator = messageInterpolator; this.properties = Collections.unmodifiableMap(properties); this.traversableResolver = traversableResolver; }
@Override public TraversableResolver getTraversableResolver() { return this.traversableResolver; }
public GwtConfigurationState(final ConstraintValidatorFactory constraintValidatorFactory, final MessageInterpolator messageInterpolator, final Map<String, String> properties, final TraversableResolver traversableResolver) { super(constraintValidatorFactory, messageInterpolator, properties, traversableResolver); }
/** * initialize values. * * @param factory constraint validator factory to set * @param messageInterpolator message interpolator to set * @param traversableResolver traversable resolver to set * @param pparameterNameProvider parameter resolver to set */ public void init(final ConstraintValidatorFactory factory, final MessageInterpolator messageInterpolator, final TraversableResolver traversableResolver, final ParameterNameProvider pparameterNameProvider) { this.contraintValidatorFactory = factory; this.messageInterpolator = messageInterpolator; this.traversableResolver = traversableResolver; this.parameterNameProvider = pparameterNameProvider; }
protected TraversableResolver getTraversableResolver() { return this.traversableResolver; }
@Override public final TraversableResolver getDefaultTraversableResolver() { return new DefaultTraversableResolver(); }
@Override public final AbstractBaseGwtConfiguration traversableResolver( final TraversableResolver resolver) { this.traversableResolverProperty = resolver; return this; }
public GwtValidationContext(final Class<T> rootBeanClass, final T rootBean, final BeanDescriptor beanDescriptor, final MessageInterpolator messageInterpolator, final TraversableResolver traversableResolver, final AbstractGwtValidator validator) { this(rootBeanClass, rootBean, beanDescriptor, messageInterpolator, traversableResolver, validator, new HashSet<>()); }
public TraversableResolver getTraversableResolver() { return this.traversableResolver; }
@Override public final TraversableResolver getTraversableResolver() { return this.traversableResolver; }
/** * initialize factory. * * @param configState ConfigurationState */ public final void init(final ConfigurationState configState) { final ConstraintValidatorFactory configConstraintValidatorFactory = configState.getConstraintValidatorFactory(); this.constraintValidatorFactory = configConstraintValidatorFactory == null ? GWT.<ConstraintValidatorFactory>create(ConstraintValidatorFactory.class) : configConstraintValidatorFactory; final TraversableResolver configTraversableResolver = configState.getTraversableResolver(); this.traversableResolver = configTraversableResolver == null ? new DefaultTraversableResolver() : configTraversableResolver; final MessageInterpolator configMessageInterpolator = configState.getMessageInterpolator(); this.messageInterpolator = configMessageInterpolator == null ? new GwtMessageInterpolator() : configMessageInterpolator; this.parameterNameProvider = configState.getParameterNameProvider(); }
public GwtConfigurationState(final ConstraintValidatorFactory pconstraintValidatorFactory, final MessageInterpolator pmessageInterpolator, final Map<String, String> pproperties, final TraversableResolver ptraversableResolver) { super(pconstraintValidatorFactory, pmessageInterpolator, pproperties, ptraversableResolver); }
public GwtValidationContext(final Class<T> prootBeanClass, final T prootBean, final BeanDescriptor pbeanDescriptor, final MessageInterpolator pmessageInterpolator, final TraversableResolver ptraversableResolver, final AbstractGwtValidator pvalidator) { super(prootBeanClass, prootBean, pbeanDescriptor, pmessageInterpolator, ptraversableResolver, pvalidator); }
@Override public TraversableResolver getTraversableResolver() { return traversableResolver; }
public TraversableResolver getTraversableResolver() { return this.validatorFactory.getTraversableResolver(); }
/** * {@inheritDoc} */ public TraversableResolver getTraversableResolver() { return validatorFactory.getTraversableResolver(); }
@Override public TraversableResolver getTraversableResolver() { return factory().getTraversableResolver(); }
@Override public T traversableResolver(final TraversableResolver resolver) { return delegate.traversableResolver(resolver); }
@Override public TraversableResolver getDefaultTraversableResolver() { return delegate.getDefaultTraversableResolver(); }
@Override public TraversableResolver getTraversableResolver() { return delegate().getTraversableResolver(); }