public CloneMapper(Mapper mapr) {
this.mapr = mapr;
}
void map(Class sourceClass, Class destClass){
MappedClass destMC = mapr.getMappedClass(destClass);
MappedClass sourceMC = mapr.getMappedClass(sourceClass);
//copy the class level annotations
for(Entry<Class<? extends Annotation>, ArrayList<Annotation>> e: sourceMC.getRelevantAnnotations().entrySet()) {
if ( e.getValue() != null && e.getValue().size() > 0)
for(Annotation ann : e.getValue())
destMC.addAnnotation(e.getKey(), ann);
}
//copy the fields.
for(MappedField mf : sourceMC.getMappedFields()){
Map<Class<? extends Annotation>, Annotation> annMap = mf.getAnnotations();
MappedField destMF = destMC.getMappedFieldByJavaField(mf.getJavaFieldName());
if (destMF != null && annMap != null && annMap.size() > 0) {
for(Entry e : annMap.entrySet())
destMF.addAnnotation((Class)e.getKey(), (Annotation)e.getValue());