Package org.springframework.core.convert.support

Examples of org.springframework.core.convert.support.GenericConversionService.addConverter()


  @Test
  public void customConversion() throws Exception {
    DefaultMessageHandlerMethodFactory instance = createInstance();
    GenericConversionService conversionService = new GenericConversionService();
    conversionService.addConverter(SampleBean.class, String.class, new Converter<SampleBean, String>() {
      @Override
      public String convert(SampleBean source) {
        return "foo bar";
      }
    });
View Full Code Here


    GenericConversionService service = new GenericConversionService();

    GenericEntityConverter genericEntityConverter = new GenericEntityConverter(importDataDao, workbook,
        new HashMap<Class<?>, Class<?>>(0), idsMapping);
    genericEntityConverter.setConversionService(service);
    service.addConverter(genericEntityConverter);

    service.addConverter(new ProjectConverter());
    service.addConverter(new ArtifactConverter());
    service.addConverter(new ExternalLinkWrapperConverter());
View Full Code Here

    GenericEntityConverter genericEntityConverter = new GenericEntityConverter(importDataDao, workbook,
        new HashMap<Class<?>, Class<?>>(0), idsMapping);
    genericEntityConverter.setConversionService(service);
    service.addConverter(genericEntityConverter);

    service.addConverter(new ProjectConverter());
    service.addConverter(new ArtifactConverter());
    service.addConverter(new ExternalLinkWrapperConverter());

    DefaultConversionService.addDefaultConverters(service);
View Full Code Here

        new HashMap<Class<?>, Class<?>>(0), idsMapping);
    genericEntityConverter.setConversionService(service);
    service.addConverter(genericEntityConverter);

    service.addConverter(new ProjectConverter());
    service.addConverter(new ArtifactConverter());
    service.addConverter(new ExternalLinkWrapperConverter());

    DefaultConversionService.addDefaultConverters(service);

    return service;
View Full Code Here

    genericEntityConverter.setConversionService(service);
    service.addConverter(genericEntityConverter);

    service.addConverter(new ProjectConverter());
    service.addConverter(new ArtifactConverter());
    service.addConverter(new ExternalLinkWrapperConverter());

    DefaultConversionService.addDefaultConverters(service);

    return service;
  }
View Full Code Here

  }

  private void initBeanWrapper(BeanWrapperImpl beanWrapper) {

    GenericConversionService conversionService = new GenericConversionService();
    conversionService.addConverter(new MultipartFileConverter(beanWrapper));

    beanWrapper.setConversionService(conversionService);
    if (beanFactory != null) {
      beanFactory.copyRegisteredEditorsTo(beanWrapper);
    }
View Full Code Here

  @InitBinder
    void registerConverters(WebDataBinder binder) {
        if (binder.getConversionService() instanceof GenericConversionService) {
            GenericConversionService conversionService = (GenericConversionService) binder.getConversionService();
            conversionService.addConverter(getRestaurantConverter());
            conversionService.addConverter(getUserAccountConverter());
            conversionService.addConverter(getRestaurantConverterFromString());
        }
    }
View Full Code Here

  @InitBinder
    void registerConverters(WebDataBinder binder) {
        if (binder.getConversionService() instanceof GenericConversionService) {
            GenericConversionService conversionService = (GenericConversionService) binder.getConversionService();
            conversionService.addConverter(getRestaurantConverter());
            conversionService.addConverter(getUserAccountConverter());
            conversionService.addConverter(getRestaurantConverterFromString());
        }
    }

}
View Full Code Here

    void registerConverters(WebDataBinder binder) {
        if (binder.getConversionService() instanceof GenericConversionService) {
            GenericConversionService conversionService = (GenericConversionService) binder.getConversionService();
            conversionService.addConverter(getRestaurantConverter());
            conversionService.addConverter(getUserAccountConverter());
            conversionService.addConverter(getRestaurantConverterFromString());
        }
    }

}
View Full Code Here

        public GenericNodePropertyFieldAccessor(Neo4jPersistentProperty property,
                                                Neo4jTemplate template) {
            super(template, property);
            GenericConversionService genericConversionService = new GenericConversionService();
            genericConversionService.addConverter(new GenericObjectToObjectConverter());
            this.propertyConverter = new PropertyConverter(genericConversionService,property);
        }

        @Override
        public Object setValue(final Object entity, final Object newVal, MappingPolicy mappingPolicy) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.