vendredi 17 avril 2015

Are there spring utilities to help me create annotation-based object mapper?

I need to create a specialized object mapper that maps between a custom object model and simple java beans, using custom annotations as shown below. The question is this:


Are there any spring utilities and/or classes that I should look at, in order to a) discover/enumerate the annotations, and b) read/write the properties?


Example bean with two attributes that need mapping:



public class MyBean {
// Field mapping
@Attribute(externalKey="type")
private Integer documentType;

// Method mapping
private String title;
@Attribute(externalKey = "IKB$TITLE")
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
}

Aucun commentaire:

Enregistrer un commentaire