#759130 : added template methods for BeanSerializer customizations

This commit is contained in:
Timo Westkämper 2011-04-12 20:06:58 +00:00
parent 9b89b0e55b
commit b19bfaceb3

View File

@ -74,6 +74,8 @@ public class BeanSerializer implements Serializer{
}
writer.beginClass(model);
bodyStart(model, writer);
// fields
for (Property property : model.getProperties()){
if (propertyAnnotations){
@ -98,9 +100,19 @@ public class BeanSerializer implements Serializer{
writer.end();
}
bodyEnd(model, writer);
writer.end();
}
protected void bodyStart(EntityType model, CodeWriter writer) throws IOException {
// template method
}
protected void bodyEnd(EntityType model, CodeWriter writer) throws IOException {
// template method
}
private Set<String> getAnnotationTypes(EntityType model) {
Set<String> imports = new HashSet<String>();
for (Annotation annotation : model.getAnnotations()){