Java 类org.springframework.core.convert.support.ConfigurableConversionService 实例源码

项目:configx    文件:ConfigPropertyResolver.java   
@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);
}
项目:configx    文件:ConfigPropertyResolver.java   
/**
 * 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;
}
项目:spring-data-tarantool    文件:PlainTarantoolSerializer.java   
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()));
}
项目:mccy-engine    文件:GeneralConfig.java   
@Bean
@Autowired
public ConfigurableConversionService conversionService(Converter[] converters) {
    final ConfigurableConversionService ours = new DefaultConversionService();

    for (Converter converter : converters) {
        ours.addConverter(converter);
    }

    return ours;
}
项目:spring-data-dynamodb-demo    文件:DemoRestMvcConfiguration.java   
@Override
protected void configureConversionService(
        ConfigurableConversionService conversionService) {
    conversionService.addConverter(stringToThreadIdConverter());
    conversionService.addConverter(stringToReplyIdConverter());
    super.configureConversionService(conversionService);
}
项目:wmboost-data    文件:NumberConverterGenerator.java   
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);
}
项目:spring4-understanding    文件:AbstractEnvironment.java   
@Override
public ConfigurableConversionService getConversionService() {
    return this.propertyResolver.getConversionService();
}
项目:spring4-understanding    文件:AbstractEnvironment.java   
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    this.propertyResolver.setConversionService(conversionService);
}
项目:spring4-understanding    文件:AbstractPropertyResolver.java   
@Override
public ConfigurableConversionService getConversionService() {
    return this.conversionService;
}
项目:spring4-understanding    文件:AbstractPropertyResolver.java   
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    this.conversionService = conversionService;
}
项目:spring    文件:AbstractEnvironment.java   
@Override
public ConfigurableConversionService getConversionService() {
    return this.propertyResolver.getConversionService();
}
项目:spring    文件:AbstractEnvironment.java   
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    this.propertyResolver.setConversionService(conversionService);
}
项目:spring    文件:AbstractPropertyResolver.java   
@Override
public ConfigurableConversionService getConversionService() {
    return this.conversionService;
}
项目:spring    文件:AbstractPropertyResolver.java   
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    this.conversionService = conversionService;
}
项目:jasypt-spring-boot    文件:EncryptableEnvironment.java   
@Override
public ConfigurableConversionService getConversionService() {
    return delegate.getConversionService();
}
项目:jasypt-spring-boot    文件:EncryptableEnvironment.java   
@Override
public void setConversionService(ConfigurableConversionService conversionService) {
    delegate.setConversionService(conversionService);
}
项目:iVIS    文件:NotNullStringToCollectionConverter.java   
public NotNullStringToCollectionConverter(ConversionService conversionService) {
    this.conversionService = (ConfigurableConversionService) conversionService;
    this.conversionService.addConverter(this);
}
项目:class-guard    文件:AbstractEnvironment.java   
public void setConversionService(ConfigurableConversionService conversionService) {
    this.propertyResolver.setConversionService(conversionService);
}
项目:class-guard    文件:AbstractEnvironment.java   
public ConfigurableConversionService getConversionService() {
    return this.propertyResolver.getConversionService();
}
项目:class-guard    文件:AbstractPropertyResolver.java   
public ConfigurableConversionService getConversionService() {
    return this.conversionService;
}
项目:class-guard    文件:AbstractPropertyResolver.java   
public void setConversionService(ConfigurableConversionService conversionService) {
    this.conversionService = conversionService;
}
项目:github-cla-integration    文件:WebConfiguration.java   
@Bean
public DomainClassConverter<?> domainClassConverter(ConfigurableConversionService conversionService) {
    return new DomainClassConverter<>(conversionService);
}
项目:wmboost-data    文件:ConversionServiceUtils.java   
public static ConfigurableConversionService createDefaultConversionService() {
    GenericConversionService conversionService = new GenericConversionService();

    addDateConverters(conversionService);

    addWmConverters(conversionService);

    DefaultConversionService.addDefaultConverters(conversionService);

    return conversionService;
}
项目:configx    文件:ConfigPropertyResolver.java   
/**
 * Set the conversion service used to convert property values.
 *
 * @param conversionService the conversion service
 */
public void setConversionService(ConfigurableConversionService conversionService) {
    this.conversionService = conversionService;
}
项目:wmboost-data    文件:ConversionServiceUtils.java   
private static void addWmConverters(ConfigurableConversionService conversionService) {
    addMScalars(conversionService);

}
项目:spring4-understanding    文件:ConfigurablePropertyResolver.java   
/**
 * @return the {@link ConfigurableConversionService} used when performing type
 * conversions on properties.
 * <p>The configurable nature of the returned conversion service allows for
 * the convenient addition and removal of individual {@code Converter} instances:
 * <pre class="code">
 * ConfigurableConversionService cs = env.getConversionService();
 * cs.addConverter(new FooConverter());
 * </pre>
 * @see PropertyResolver#getProperty(String, Class)
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
ConfigurableConversionService getConversionService();
项目:spring4-understanding    文件:ConfigurablePropertyResolver.java   
/**
 * Set the {@link ConfigurableConversionService} to be used when performing type
 * conversions on properties.
 * <p><strong>Note:</strong> as an alternative to fully replacing the {@code
 * ConversionService}, consider adding or removing individual {@code Converter}
 * instances by drilling into {@link #getConversionService()} and calling methods
 * such as {@code #addConverter}.
 * @see PropertyResolver#getProperty(String, Class)
 * @see #getConversionService()
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
void setConversionService(ConfigurableConversionService conversionService);
项目:spring    文件:ConfigurablePropertyResolver.java   
/**
 * @return the {@link ConfigurableConversionService} used when performing type
 * conversions on properties.
 * <p>The configurable nature of the returned conversion service allows for
 * the convenient addition and removal of individual {@code Converter} instances:
 * <pre class="code">
 * ConfigurableConversionService cs = env.getConversionService();
 * cs.addConverter(new FooConverter());
 * </pre>
 * @see PropertyResolver#getProperty(String, Class)
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
ConfigurableConversionService getConversionService();
项目:spring    文件:ConfigurablePropertyResolver.java   
/**
 * Set the {@link ConfigurableConversionService} to be used when performing type
 * conversions on properties.
 * <p><strong>Note:</strong> as an alternative to fully replacing the {@code
 * ConversionService}, consider adding or removing individual {@code Converter}
 * instances by drilling into {@link #getConversionService()} and calling methods
 * such as {@code #addConverter}.
 * @see PropertyResolver#getProperty(String, Class)
 * @see #getConversionService()
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
void setConversionService(ConfigurableConversionService conversionService);
项目:class-guard    文件:ConfigurablePropertyResolver.java   
/**
 * @return the {@link ConfigurableConversionService} used when performing type
 * conversions on properties.
 * <p>The configurable nature of the returned conversion service allows for
 * the convenient addition and removal of individual {@code Converter} instances:
 * <pre class="code">
 * ConfigurableConversionService cs = env.getConversionService();
 * cs.addConverter(new FooConverter());
 * </pre>
 * @see PropertyResolver#getProperty(String, Class)
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
ConfigurableConversionService getConversionService();
项目:class-guard    文件:ConfigurablePropertyResolver.java   
/**
 * Set the {@link ConfigurableConversionService} to be used when performing type
 * conversions on properties.
 * <p><strong>Note:</strong> as an alternative to fully replacing the {@code
 * ConversionService}, consider adding or removing individual {@code Converter}
 * instances by drilling into {@link #getConversionService()} and calling methods
 * such as {@code #addConverter}.
 * @see PropertyResolver#getProperty(String, Class)
 * @see #getConversionService()
 * @see org.springframework.core.convert.converter.ConverterRegistry#addConverter
 */
void setConversionService(ConfigurableConversionService conversionService);