资 源 简 介
DtoBuilder is annotation based java library for filling DTO objects from e.g. domain model objects.
Usage is quite simple just annotate your DTO java bean with DtoProperty or DtoClass annotations. The annotations are used to mark from which classes the DTO should be filled from e.g.
@DtoProperty(sourceClass=Person.class)public String getName() { return name;}
this means that the name property should be fetched from Person java bean. By default the builder uses the same property name for the source but it can also be defined like this
@DtoProperty(sourceClass=Person.class, sourceProperty="bday")public Date getBirthday() { return birthday;}
so here the value is fetched from a property named bday.
If you have multiple properties and they all are named the same way in the source and in the dto you can also annotate the whole dto class
@DtoClass(sourceClasses={Person.class})public class Per