final NewMethodParameter objectInputStream = newMethod.newParameter();
objectInputStream.setName(SerializationConstants.CLIENT_OBJECT_READER_IMPL_READ_FIELDS_OBJECT_INPUT_STREAM_PARAMETER);
objectInputStream.setFinal(true);
objectInputStream.setType(this.getObjectInputStream());
final ReadFieldsTemplatedFile body = new ReadFieldsTemplatedFile();
newMethod.setBody(body);
body.setType(type);
// add all fields to the template
final Iterator<Field> fields = this.filterSerializableFields(type.getFields()).iterator();
int fieldCount = 0;
context.branch();
while (fields.hasNext()) {
final Field field = fields.next();
final Method setter = this.createFieldSetter(reader, field);
body.addFieldSetter(setter);
fieldCount++;
}
context.unbranch();