Re: Using NSDictionary as attribute
Re: Using NSDictionary as attribute
- Subject: Re: Using NSDictionary as attribute
- From: PA <email@hidden>
- Date: Sat, 11 Dec 2004 12:51:35 +0100
On Dec 10, 2004, at 23:06, Jacky Gagnon wrote:
Is this a bug with WebObjects,
Nope. Works as advertised:
http://developer.apple.com/documentation/WebObjects/Reference/API/com/
webobjects/foundation/NSPropertyListSerialization.html
Note though that there are some discrepancies between what Cocoa
supports and what Webobjects does:
http://developer.apple.com/documentation/Cocoa/Conceptual/
PropertyLists/Concepts/AboutPropertyLists.html
or I cannot use Boolean in NSDictionary as attribute?
You can, but it will get converted to a String.
To re-iterate what plist serialization is about:
"... the serialization process preserves only structural information,
not class information. If a property list is serialized and then
deserialized, the objects in the resulting property list might not be
of the same class as the objects in the original property list.
However, the structure and interrelationships of the data in the
resulting property list are identical to that in the original... "
http://docs.sun.com/app/docs/doc/802-2112/6i63mn65o?a=view
In any case, if you want to preserve type information you can either
extend the plist format to support your specific needs, use accessor
methods to convert String to other types, or use a different
serialization format altogether...
If you don't mind angle brackets, you may want to take a look at
XStream:
http://xstream.codehaus.org/
Cheers,
PA.
P.S.
For your entertainment:
http://www.javalobby.org/forums/thread.jspa?threadID=16260&tstart=0
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden