Examples of classMap()


Examples of ma.glasnost.orika.MapperFactory.classMap()

   
    @Test
    public void testCustomMapping() {
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.classMap(PersonDTO.class, Person.class)
                .customize(
                        new CustomMapper<PersonDTO, Person>() {
                            @Override
                            public void mapBtoA(Person b, PersonDTO a, MappingContext context) {
                                a.setName(b.getFirstName() + " " + b.getLastName());
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

    @Test
    public void testFindConstructor2() throws Throwable {
      final SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN);
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.classMap(PersonVO3.class, Person.class)
                .field("firstName", "firstName")
                .field("lastName", "lastName")
            .field("dateOfBirth", "date")
            .register();
        factory.getConverterFactory().registerConverter(DATE_CONVERTER, new DateToStringConverter(DATE_PATTERN));
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

    @Test
    public void testIntArrayToListOfInteger() {
        MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();

        mapperFactory.classMap(A.class, B.class).field("ints", "integers").byDefault().register();

        MapperFacade mapperFacade = mapperFactory.getMapperFacade();

        A a = new A();
        a.setInts(new int[] { 4 });
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

    private MapperFacade facade;
   
    @Before
    public void setUp() {
        MapperFactory mapperFactory = createMapperFactory();
        mapperFactory.registerClassMap(mapperFactory.classMap(Order.class, OrderData.class).byDefault().toClassMap());
        mapperFactory.registerClassMap(mapperFactory.classMap(Position.class, PositionData.class).byDefault().toClassMap());
        facade = mapperFactory.getMapperFacade();
    }
   
    @Test
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

   
    @Before
    public void setUp() {
        MapperFactory mapperFactory = createMapperFactory();
        mapperFactory.registerClassMap(mapperFactory.classMap(Order.class, OrderData.class).byDefault().toClassMap());
        mapperFactory.registerClassMap(mapperFactory.classMap(Position.class, PositionData.class).byDefault().toClassMap());
        facade = mapperFactory.getMapperFacade();
    }
   
    @Test
    public void test() {
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

    @Test
    public void testListOfIntegerToIntArray() {
        MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();

        mapperFactory.classMap(A.class, B.class).field("ints", "integers").byDefault().register();

        MapperFacade mapperFacade = mapperFactory.getMapperFacade();

        B b = new B();
        b.setIntegers(asList(Integer.valueOf(6)));
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

     
      LibraryNested library = new LibraryNested("Library #1", books);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      factory.registerClassMap(
          factory.classMap(AuthorNested.class, AuthorDTO.class)
            .field("name.fullName", "name").byDefault().toClassMap());
   
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

     
      Holder holder = new Holder(primitiveHolder);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      factory.registerClassMap(
          factory.classMap(NestedPrimitiveHolder.class, PrimitiveWrapperHolder.class)
            .field("numbers.shortValue", "shortValue")
            .field("numbers.intValue", "intValue")
            .field("numbers.longValue", "longValue")
            .field("numbers.floatValue", "floatValue")
            .field("numbers.doubleValue", "doubleValue")
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

   
    @Test
    public void testConstructorsWithoutDebugInfo() {
      MapperFactory factory = MappingUtil.getMapperFactory();
      factory.registerClassMap(
          factory.classMap(URLDto1.class, URL.class)
            .field("protocolX", "protocol")
            .field("hostX", "host")
            .field("portX", "port")
            .field("fileX", "file"));
      MapperFacade mapper = factory.getMapperFacade();
View Full Code Here

Examples of ma.glasnost.orika.MapperFactory.classMap()

                                    "readThe([\\w]+)ForThisBean",
                                    "assignThe([\\w]+)",
                                    true, true))
                    .build();
        factory.registerClassMap(
                factory.classMap(A.class, B.class)
                    .field("name.firstName", "givenName")
                    .field("name.lastName", "sirName")
                    .field("address.city", "city")
                    .field("address.street", "street")
                    .field("address.postalCode", "postalCode")
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.