@Override public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) { final AbstractGwtValidatorFactory validatorFactory = (AbstractGwtValidatorFactory) GWT.create(ValidatorFactory.class); validatorFactory.init(configurationState); return validatorFactory; }
@Override public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) { throw new UnsupportedOperationException(); }
/** * 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 ValidatorFactoryImpl513(ConfigurationState configurationState) { this.messageInterpolator = configurationState.getMessageInterpolator(); this.traversableResolver = configurationState.getTraversableResolver(); this.parameterNameProvider = configurationState.getParameterNameProvider(); this.beanMetaDataManagerMap = Collections .synchronizedMap(new IdentityHashMap<ParameterNameProvider, BeanMetaDataManager513>()); this.constraintHelper = new ConstraintHelper(); this.typeResolutionHelper = new TypeResolutionHelper(); this.executableHelper = new ExecutableHelper(typeResolutionHelper); // HV-302; don't load XmlMappingParser if not necessary if (configurationState.getMappingStreams().isEmpty()) { this.xmlMetaDataProvider = null; } else { this.xmlMetaDataProvider = new XmlMetaDataProvider(constraintHelper, parameterNameProvider, configurationState.getMappingStreams()); } Map<String, String> properties = configurationState.getProperties(); boolean tmpFailFast = false; List<ValidatedValueUnwrapper<?>> tmpValidatedValueHandlers = newArrayList(5); Set<DefaultConstraintMapping> tmpConstraintMappings = newHashSet(); if (configurationState instanceof ConfigurationImpl) { ConfigurationImpl hibernateSpecificConfig = (ConfigurationImpl) configurationState; if (hibernateSpecificConfig.getProgrammaticMappings().size() > 0) { tmpConstraintMappings.addAll(hibernateSpecificConfig.getProgrammaticMappings()); } // check whether fail fast is programmatically enabled tmpFailFast = hibernateSpecificConfig.getFailFast(); tmpValidatedValueHandlers.addAll(hibernateSpecificConfig.getValidatedValueHandlers()); } this.constraintMappings = Collections.unmodifiableSet(tmpConstraintMappings); tmpFailFast = checkPropertiesForFailFast(properties, tmpFailFast); this.failFast = tmpFailFast; tmpValidatedValueHandlers.addAll(getPropertyConfiguredValidatedValueHandlers(properties)); this.validatedValueHandlers = Collections.unmodifiableList(tmpValidatedValueHandlers); this.constraintValidatorManager = new ConstraintValidatorManager( configurationState.getConstraintValidatorFactory()); }
@Override public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) { return provider.buildValidatorFactory(configurationState); }
@Override public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) { return null; }
/** * (non-Javadoc) * * @see org.hibernate.validator.HibernateValidator#buildValidatorFactory(javax.validation.spi.ConfigurationState) */ @Override public ValidatorFactory buildValidatorFactory(ConfigurationState configurationState) { return new ValidatorFactoryImpl513(configurationState); }