Java 类javax.validation.spi.ConfigurationState 实例源码
项目:gwt-bean-validators
文件:GwtValidationProvider.java
@Override
public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) {
final AbstractGwtValidatorFactory validatorFactory =
(AbstractGwtValidatorFactory) GWT.create(ValidatorFactory.class);
validatorFactory.init(configurationState);
return validatorFactory;
}
项目:minijax
文件:MinijaxValidationProvider.java
@Override
public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) {
throw new UnsupportedOperationException();
}
项目:gwt-bean-validators
文件:AbstractGwtValidatorFactory.java
/**
* 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();
}
项目:nest-old
文件:ValidatorFactoryImpl513.java
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());
}
项目:tomee
文件:CustomValidatorProvider.java
@Override
public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) {
return provider.buildValidatorFactory(configurationState);
}
项目:tomee
文件:CustomValidatorProvider.java
@Override
public ValidatorFactory buildValidatorFactory(final ConfigurationState configurationState) {
return null;
}
项目:nest-old
文件:HibernateValidator513.java
/**
* (non-Javadoc)
*
* @see org.hibernate.validator.HibernateValidator#buildValidatorFactory(javax.validation.spi.ConfigurationState)
*/
@Override
public ValidatorFactory buildValidatorFactory(ConfigurationState configurationState) {
return new ValidatorFactoryImpl513(configurationState);
}