Package ma.glasnost.orika.converter.builtin

Examples of ma.glasnost.orika.converter.builtin.ConstructorConverter


 
  @Test
  public void testStringBasedConstructor() {
    MapperFactory factory = MappingUtil.getMapperFactory();
    factory.getConverterFactory().registerConverter(new ConstructorConverter());
    MapperFacade mapper = factory.getMapperFacade();
   
    String urlString = "http://localhost:80/index.html";
    URL url = mapper.map(urlString, URL.class);
    Assert.assertNotNull(url);
View Full Code Here


  }
 
  @Test
  public void testPrimitiveConstructor() {
    MapperFactory factory = MappingUtil.getMapperFactory();
    factory.getConverterFactory().registerConverter(new ConstructorConverter());
    MapperFacade mapper = factory.getMapperFacade();
   
    Double doubleValue = Double.valueOf("4.99");
    BigDecimal bd = mapper.map(doubleValue, BigDecimal.class);
    Assert.assertNotNull(bd);
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.converter.builtin.ConstructorConverter

Copyright © 2018 www.massapicom. 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.