本文整理汇总了Java中org.springframework.core.convert.support.ConfigurableConversionService类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableConversionService类的具体用法?Java ConfigurableConversionService怎么用?Java ConfigurableConversionService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurableConversionService类属于org.springframework.core.convert.support包,在下文中一共展示了ConfigurableConversionService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterPropertiesSet
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void afterPropertiesSet() throws Exception {
if (this.propertySources == null) {
this.propertySources = deducePropertySources();
}
if (this.conversionService == null) {
this.conversionService = getOptionalBean(
ConfigurableApplicationContext.CONVERSION_SERVICE_BEAN_NAME,
ConfigurableConversionService.class);
}
// If no explicit conversion service is provided we add one so that (at least)
// comma-separated arrays of convertibles can be bound automatically
if (this.conversionService == null) {
this.conversionService = getDefaultConversionService();
}
this.propertyResolver = new PropertySourcesPropertyResolver(this.propertySources);
this.propertyResolver.setConversionService(this.conversionService);
}
示例2: getDefaultConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
/**
* Initialize default ConversionService
*
* @return
*/
private ConfigurableConversionService getDefaultConversionService() {
if (this.defaultConversionService == null) {
DefaultConversionService conversionService = new DefaultConversionService();
this.applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
for (Converter<?, ?> converter : this.converters) {
conversionService.addConverter(converter);
}
for (GenericConverter genericConverter : this.genericConverters) {
conversionService.addConverter(genericConverter);
}
this.defaultConversionService = conversionService;
}
return this.defaultConversionService;
}
示例3: PlainTarantoolSerializer
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public PlainTarantoolSerializer(Class<T> desiredClass, ConfigurableConversionService conversionService) {
this.desiredClass = desiredClass;
this.conversionService = conversionService;
conversionService.addConverter(Date.class, Number.class, (Converter<Date, Number>) Date::getTime);
conversionService.addConverter(Number.class, Date.class, (Converter<Number, Date>) it -> new Date(it.longValue()));
}
示例4: conversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Bean
@Autowired
public ConfigurableConversionService conversionService(Converter[] converters) {
final ConfigurableConversionService ours = new DefaultConversionService();
for (Converter converter : converters) {
ours.addConverter(converter);
}
return ours;
}
示例5: configureConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
protected void configureConversionService(
ConfigurableConversionService conversionService) {
conversionService.addConverter(stringToThreadIdConverter());
conversionService.addConverter(stringToReplyIdConverter());
super.configureConversionService(conversionService);
}
示例6: NumberConverterGenerator
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public NumberConverterGenerator(Class<M> mutableType, Class<S> scalarType, ConfigurableConversionService conversionService) {
super();
this.scalarType = Preconditions.checkNotNull(scalarType);
this.mutableType = Preconditions.checkNotNull(mutableType);
this.conversionService = Preconditions.checkNotNull(conversionService);
}
示例7: getConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
return this.propertyResolver.getConversionService();
}
示例8: setConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
this.propertyResolver.setConversionService(conversionService);
}
示例9: getConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
return this.conversionService;
}
示例10: setConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
this.conversionService = conversionService;
}
示例11: getConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
return delegate.getConversionService();
}
示例12: setConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
delegate.setConversionService(conversionService);
}
示例13: NotNullStringToCollectionConverter
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public NotNullStringToCollectionConverter(ConversionService conversionService) {
this.conversionService = (ConfigurableConversionService) conversionService;
this.conversionService.addConverter(this);
}
示例14: setConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public void setConversionService(ConfigurableConversionService conversionService) {
this.propertyResolver.setConversionService(conversionService);
}
示例15: getConversionService
import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public ConfigurableConversionService getConversionService() {
return this.propertyResolver.getConversionService();
}