Examples of classMap()


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()

    public void testNestedInheritance() {
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.registerClassMap(factory.classMap(Person.class, PersonDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Client.class, ClientDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Subscription.class, SubscriptionDTO.class).field("client", "person").toClassMap());
       
        Client client = new Client();
        client.setName("Khalil Gebran");
       
        Subscription subscription = new Subscription();
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()

   
    @Test
    public void testNestedPolymorphicInheritance() {
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.registerClassMap(factory.classMap(Person.class, PersonDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Client.class, ClientDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Employee.class, EmployeeDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Subscription.class, SubscriptionDTO.class).field("client", "person").toClassMap());
       
        Client client = new Client();
View Full Code Here

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

    @Test
    public void testNestedPolymorphicInheritance() {
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.registerClassMap(factory.classMap(Person.class, PersonDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Client.class, ClientDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Employee.class, EmployeeDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Subscription.class, SubscriptionDTO.class).field("client", "person").toClassMap());
       
        Client client = new Client();
        client.setName("Khalil Gebran");
View Full Code Here

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

    public void testNestedPolymorphicInheritance() {
        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.registerClassMap(factory.classMap(Person.class, PersonDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Client.class, ClientDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Employee.class, EmployeeDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Subscription.class, SubscriptionDTO.class).field("client", "person").toClassMap());
       
        Client client = new Client();
        client.setName("Khalil Gebran");
       
View Full Code Here

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

        MapperFactory factory = MappingUtil.getMapperFactory();
       
        factory.registerClassMap(factory.classMap(Person.class, PersonDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Client.class, ClientDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Employee.class, EmployeeDTO.class).byDefault().toClassMap());
        factory.registerClassMap(factory.classMap(Subscription.class, SubscriptionDTO.class).field("client", "person").toClassMap());
       
        Client client = new Client();
        client.setName("Khalil Gebran");
       
        Employee employee = new Employee();
View Full Code Here

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

    @Test
    public void testAdHocResolution_integration_customResolverUsingDeclarativeProperties() {
       
        MapperFactory factory = new DefaultMapperFactory.Builder().propertyResolverStrategy(new ElementPropertyResolver()).build();
       
        factory.classMap(Element.class, Person.class)
                .field("employment.jobTitle", "jobTitle")
                .field("employment.salary", "salary")
                .field("name.first", "firstName")
                .field("name.last", "lastName")
                .register();
View Full Code Here

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

  public void testMapToMapGeneration() throws Exception {
   
   
    MapperFactory factory = MappingUtil.getMapperFactory();
    factory.registerClassMap(
        factory.classMap(MapWithSetter.class, MapWithSetterDto.class)
        .field("testScores", "scores").byDefault());
   
    BoundMapperFacade<MapWithSetter, MapWithSetterDto> mapper = factory.getMapperFacade(MapWithSetter.class, MapWithSetterDto.class);
       
    MapWithSetter source = new MapWithSetter();
View Full Code Here

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

  public void testMapToMapGeneration_noSetter() throws Exception {
   
   
    MapperFactory factory = MappingUtil.getMapperFactory();
    factory.registerClassMap(
        factory.classMap(MapWithSetter.class, MapWithoutSetter.class)
        .field("testScores", "scores").byDefault());
   
    BoundMapperFacade<MapWithSetter, MapWithoutSetter> mapper = factory.getMapperFacade(MapWithSetter.class, MapWithoutSetter.class);
       
    MapWithSetter source = new MapWithSetter();
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.