I developed a plugin to generate the code CustomFieldSerializer,
thanks to the suggestion of @ GenSerializer by Flori, the idea is to
use it as follows:
@GenSerializer
public class CategoryItem {
List<Product> productKey;
int quantity;
....
}
result of the generated code:
public class CategoryItem_CustomFieldSerializer {
@SuppressWarnings("unchecked")
public static void deserialize(SerializationStreamReader reader,
CategoryItem instance) throws SerializationException {
instance.setProductKey((java.util.List<com.pe.sondx.shared.entities.Product
>)reader.readObject());
instance.setQuantity(reader.readInt());
}
public static void serialize(SerializationStreamWriter writer,
CategoryItem instance) throws SerializationException {
if (instance.getProductKey() == null) {
writer.writeObject(new
java.util.ArrayList<com.pe.sondx.shared.entities.Product>());
} else {
writer.writeObject(new
java.util.ArrayList<com.pe.sondx.shared.entities.Product>(instance.getProdu
ctKey()));
}
writer.writeInt(instance.getQuantity());
}
}
Here you can download:
http://code.google.com/p/gwtserializer-processors/
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.