The following example you be to create a custom serializer for the my.package.ApiException class.
package com.google.gwt.user.client.rpc.core.my.package;
public class ApiException_CustomFieldSerializer extends CustomFieldSerializer{ @Override public void deserializeInstance(SerializationStreamReader streamReader, ApiException instance) throws SerializationException { deserialize(streamReader,instance); } @Override public void serializeInstance(SerializationStreamWriter streamWriter, ApiException instance) throws SerializationException { serialize(streamWriter,instance); } public static void serialize(SerializationStreamWriter streamWriter,ApiException instance) throws SerializationException { streamWriter.writeString( instance.getMessage() ); } public static void deserialize(SerializationStreamReader streamReader,ApiException instance) throws SerializationException { instance.setMessage( streamReader.readString() ); } public static ApiException instantiate(SerializationStreamReader reader) throws SerializationException { return new ApiException(); } }
No comments:
Post a Comment