Implementing Externalizable

50 views
Skip to first unread message

Thomas Lo

unread,
Aug 2, 2013, 4:05:42 PM8/2/13
to the-blink...@googlegroups.com
I need to integrate blink with another system and potentially the better way is to provide Externalizable on the data object itself. Could you tell me if that is possible? Since I think I can handle the write portion but I am not too sure about the read portion of it since jblink handles the object creation. 

david.rosenborg

unread,
Aug 14, 2013, 4:07:44 AM8/14/13
to the-blink...@googlegroups.com
From the jblink point of view, any class will do that is compatible with a corresponding group in the schema. It is compatible as long as it has setters and getters consistent with the fields of the group. If it also has other methods and implements interfaces like Externalizable doesn't matter as long as it also has a default constructor. If you use the blinkc class generator, then you'll have to modify it if you also want it to emit code for Externalizable. However, whether you get blinkc to do it or if you write those methods by hand, the code in the implementation of writeExternal and readExternal could be independent of any blink specific features. They'd just deal with the members of the class like you'd do with any other Java object.

/D

Thomas Lo

unread,
Aug 14, 2013, 8:16:27 AM8/14/13
to the-blink...@googlegroups.com
I think your other post on dumping the class bytes answer this question also. Super thanks.
Reply all
Reply to author
Forward
0 new messages