protected void generateTightMarshal2Body(PrintWriter out) {
List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty)iter.next();
JAnnotation annotation = property.getAnnotation("openwire:property");
JAnnotationValue size = annotation.getValue("size");
JClass propertyType = property.getType();
String type = propertyType.getSimpleName();
String getter = "info." + property.getGetter().getSimpleName() + "()";
if (type.equals("boolean")) {
out.println(" bs.readBoolean();");
} else if (type.equals("byte")) {
out.println(" dataOut.writeByte(" + getter + ");");
} else if (type.equals("char")) {
out.println(" dataOut.writeChar(" + getter + ");");
} else if (type.equals("short")) {
out.println(" dataOut.writeShort(" + getter + ");");
} else if (type.equals("int")) {
out.println(" dataOut.writeInt(" + getter + ");");
} else if (type.equals("long")) {
out.println(" tightMarshalLong2(wireFormat, " + getter + ", dataOut, bs);");
} else if (type.equals("String")) {
out.println(" tightMarshalString2(" + getter + ", dataOut, bs);");
} else if (type.equals("byte[]")) {
if (size != null) {
out.println(" tightMarshalConstByteArray2(" + getter + ", dataOut, bs, " + size.asInt() + ");");
} else {
out.println(" tightMarshalByteArray2(" + getter + ", dataOut, bs);");
}
} else if (type.equals("ByteSequence")) {
out.println(" tightMarshalByteSequence2(" + getter + ", dataOut, bs);");
} else if (propertyType.isArrayType()) {
if (size != null) {
out.println(" tightMarshalObjectArrayConstSize2(wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + ");");
} else {
out.println(" tightMarshalObjectArray2(wireFormat, " + getter + ", dataOut, bs);");
}
} else if (isThrowable(propertyType)) {
out.println(" tightMarshalThrowable2(wireFormat, " + getter + ", dataOut, bs);");