当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurableConversionService类代码示例

本文整理汇总了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);
}
 
开发者ID:zouzhirong,项目名称:configx,代码行数:22,代码来源:ConfigPropertyResolver.java

示例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;
}
 
开发者ID:zouzhirong,项目名称:configx,代码行数:20,代码来源:ConfigPropertyResolver.java

示例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()));
}
 
开发者ID:saladinkzn,项目名称:spring-data-tarantool,代码行数:8,代码来源:PlainTarantoolSerializer.java

示例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;
}
 
开发者ID:moorkop,项目名称:mccy-engine,代码行数:12,代码来源:GeneralConfig.java

示例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);
}
 
开发者ID:michaellavelle,项目名称:spring-data-dynamodb-demo,代码行数:8,代码来源:DemoRestMvcConfiguration.java

示例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);
}
 
开发者ID:innodev-au,项目名称:wmboost-data,代码行数:7,代码来源:NumberConverterGenerator.java

示例7: getConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
	return this.propertyResolver.getConversionService();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AbstractEnvironment.java

示例8: setConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
	this.propertyResolver.setConversionService(conversionService);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AbstractEnvironment.java

示例9: getConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
	return this.conversionService;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AbstractPropertyResolver.java

示例10: setConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
	this.conversionService = conversionService;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:AbstractPropertyResolver.java

示例11: getConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public ConfigurableConversionService getConversionService() {
    return delegate.getConversionService();
}
 
开发者ID:ulisesbocchio,项目名称:jasypt-spring-boot,代码行数:5,代码来源:EncryptableEnvironment.java

示例12: setConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    delegate.setConversionService(conversionService);
}
 
开发者ID:ulisesbocchio,项目名称:jasypt-spring-boot,代码行数:5,代码来源:EncryptableEnvironment.java

示例13: NotNullStringToCollectionConverter

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public NotNullStringToCollectionConverter(ConversionService conversionService) {
    this.conversionService = (ConfigurableConversionService) conversionService;
    this.conversionService.addConverter(this);
}
 
开发者ID:imCodePartnerAB,项目名称:iVIS,代码行数:5,代码来源:NotNullStringToCollectionConverter.java

示例14: setConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public void setConversionService(ConfigurableConversionService conversionService) {
	this.propertyResolver.setConversionService(conversionService);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:4,代码来源:AbstractEnvironment.java

示例15: getConversionService

import org.springframework.core.convert.support.ConfigurableConversionService; //导入依赖的package包/类
public ConfigurableConversionService getConversionService() {
	return this.propertyResolver.getConversionService();
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:4,代码来源:AbstractEnvironment.java


注:本文中的org.springframework.core.convert.support.ConfigurableConversionService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。