Giter Club home page Giter Club logo

jmapper-core's Introduction

JMapper Framework Join the chat at https://gitter.im/jmapper-framework/jmapper-core Donate

Fast as hand-written code with zero compromise.

Artifact information

Maven Central Javadocs Dependency Status

updated GroupId Name ``io.github.someshwar1

Status

Codacy Badge Build Status

Write the configuration using what you prefer: Annotation, XML or API.

Most relevant features:

especially its use is intuitive

Configuration

Below it is shown the same configuration in the three types allowed

Annotation
class Destination{                      class Source{
    @JMap
    private String id;                      private String id;
    @JMap("sourceField")                    
    private String destinationField;        private String sourceField;
    private String other;                   private String other;

    // getters and setters...               // getters and setters...
}                                       }
XML
<jmapper>
  <class name="it.jmapper.bean.Destination">
    <attribute name="id">
      <value name="id"/>
    </attribute>
    <attribute name="destinationField">
      <value name="sourceField">
    </attribute>
  </class>
</jmapper>
API
JMapperAPI jmapperAPI = new JMapperAPI()
    .add(mappedClass(Destination.class)
             .add(attribute("id")
                     .value("id"))
             .add(attribute("destinationField")
                     .value("sourceField")));

Creation

JMapper<Destination, Source> mapper;
Annotation
mapper = new JMapper<>(Destination.class, Source.class);
XML
mapper = new JMapper<>(Destination.class, Source.class, xml);
API
mapper = new JMapper<>(Destination.class, Source.class, jmapperAPI);

Usage

Source source = new Source("id", "sourceField", "other");
Destination destination = mapper.getDestination(source);

Result

destination ["id", "sourceField", null]

With JMapper we have all the advantages of dynamic mapping with the performance of static code, with 0 memory consumption.
Required java 8+

Would you like to contribute to the development of JMapper?
contact us ([email protected]) for more information.

Follow us on twitter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.