I have been struggling with the Rocket serialization mechanism because I am wanting a symmetric client serialization system. While the doclet annotation system seems to work, it doesn't seem to deal with generics at all down stream. For example:
public class TestContextItem implements WindowContextItem {
/**
* @serialization-type com.totsp.gwittir.example.client.TestContextItem.SomethingElse
*/
private List somethings;
private String string;
private int intPropert;
// getters and setters omitted.
public static class SomethingElse implements Serializable {
private String world;
//getters and setters omitted.
}
}
I started with the wiki docs, but was getting a index out of bounds on SerializationFactoryGenerator:800, and followed back to find the new values, but the generic declaration on the array on the ArrayList internal is causing problems.
ava.lang.AssertionError: Unable to find array component type "E extends java.lang.Object".
at rocket.util.client.Checker.fail(Checker.java:41)
at rocket.util.client.Checker.handleNull(Checker.java:60)
I have tried using a genericized ArrayList and not, but I end up with the same breakdown on ArrayList serialization.
BTW SerializationFactoryGenerator like 797+ should be:
if (values.size() < index -1 ) {
throw new SerializationException("Unable to locate \"" + SerializationConstants.CONTAINER_TYPE + "\" on field " + field);
}
final String typeName = (String) values.get(index);
So I guess the big questions are: Is the serialization API going to be supported in the future? Should I punt on this or try and work around it?
--
:Robert "kebernet" Cooper
::
kebe...@gmail.comAlice's cleartext
Charlie is the attacker
Bob signs and encrypts
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x9E8759F8