Reputation: 2845
recently I've developed a protocol serializer/deserializer using anotations and reflection. The final result was like this:
class oneCommElement extends BaseProtocolType{
@Position(0)
otherProtocolType o1;
@Position(1)
otherProtocolType2 o2;
}
that way I caniterate every elements using reflection.
But now I want to make this in J2ME (for insertion of bluetooth communications), and there I loose the reflection.
My question is: Can we develop some custom reflection just to have Filed.set and Filed.get ?
Upvotes: 0
Views: 708
Reputation: 8287
There is no reflection, so you cannot get the Fields. You will have to make some kind of custom getter and setter code in the objects you want so serialize and deserialize - it will be ugly and I recommend you follow another path.
Upvotes: 2