You are not logged in.
Hi,
I don't quite understand this RegisterCustomSerializer yet.
It seems that it completely overrides the original serializer.
Is this true?
It would be VERY nice to implement possibility to add/remove
some selected properties.
thank you,
Vojko
Offline
Yes, RegisterCustomSerializer process is global for the class.
It allows custom serialization of an object not only into a JSON list of properties, but another layout, like a JSON array or a JSON string.
I do not understand what you want exactly about "add/remove some selected properties", since it is already the case: you can use "stored false" statement, or not publish a property.
Offline
Thank you for reply.
Ok I see.
How can we make something like this:
class procedure TCustomTagsSer.FVClassWriter(...)
....
// write a complete object ?
aSerializer.WriteObject(V); // this doesn't work because of callback. any idea how to hack this ?
// and then or between .... ?
// unpublished properties ...
aSerializer.AddCustomProperties(['PropName1', myvalue1, ....]);
....
class procedure TCustomTagsSer.FVClassReader(...)
....
// write a complete object ?
DecodeObject(V);
// and then or between .... ?
// unpublished properties ...
DecodeCustomProperties(['PropName1', myvalue1, ....]);
....
The thing is we have a lot of different ancestors.
We could implelement one dummy published string property and assign it in the service when we poll the service (not in the streamer),
and then decode it on the client, but it's ugly ...
Any ideas appretiated.
thank you,
Vojko
Last edited by VojkoCendak (2012-11-01 14:13:49)
Offline