@Override
public Template buildTemplate(Class<?> targetClass, IFieldEntry[] entries) {
ReflectionEntry[] refEntries = new ReflectionEntry[entries.length];
for(int i = 0;i < entries.length;i++){
BeansFieldEntry e = (BeansFieldEntry)entries[i];
Class<?> type = e.getType();
if(type.equals(boolean.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(byte.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(short.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(int.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(long.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(float.class)) {
refEntries[i] = new ReflectionEntry(e);
} else if(type.equals(double.class)) {
refEntries[i] = new ReflectionEntry(e);
} else {
Template tmpl = TemplateRegistry.lookup(e.getGenericType(), true);
refEntries[i] = new ObjectFieldEntry(e, tmpl);
}
}
return new BeansReflectionTemplate(targetClass,refEntries);
}