| 
 | WebObjects 5.2.3 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.webobjects.foundation.NSCoding.Support
NSCoding.Support is an abstract class that defines a mechanism for one class to provide NSCoding behavior on behalf of another class. Subclasses of NSCoding.Support encode and decode objects of a different class. Subclasses of NSCoding.Support are needed to provide coding for classes whose code you don't own and that don't implement NSCoding.
For example, consider Java Client WebObjects applications that use NSCoding to distribute objects between client and server. Not all objects that Java Client distributes implement NSCoding (java.lang.String, for example). To encode and decode non-NSCoding objects, Java Client uses specialized (private) subclasses of NSCoding.Support. A subclass of NSCoding.Support should implement the methodsencodeWithCoder
 and decodeObject to encode and decode objects of a
 specific non-NSCoding class. NSCoding.Support's default implementations of
 these methods do nothing.
 
 NSCoding.Support manages a registry of Support classes for classes
 that don't implement NSCoding. The methods setSupportForClass
 and supportForClass are used to register and access the NSCoding.Support
 classes for performing coding on non-NSCoding objects. There is pre-register list of
 NSCoding.Support classes for the following types:
 
NSCoding.encodeWithCoder(NSCoder coder), 
decodeObject(NSCoder aCoder), 
setSupportForClass(NSCoding.Support supportClass, Class aClass), 
supportForClass(Class aClass), 
NSCoding| Constructor Summary | |
| NSCoding.Support() | |
| Method Summary | |
|  Class | classForCoder(Object receiver)NSCoding.Support's default implementation simply returns receiver's actual class. | 
| abstract  Object | decodeObject(NSCoder coder)Implemented by subclasses to decode an object of a specific type from the data in coder. | 
| abstract  void | encodeWithCoder(Object receiver,
                NSCoder coder)Implemented by subclasses to encode an object receiverof a specific
 type using NSCodercoder. | 
| static void | setSupportForClass(NSCoding.Support support,
                   Class aClass)Sets supportas the NSCoding.Support class to use for encoding and
 decoding instances ofaClass. | 
| static NSCoding.Support | supportForClass(Class aClass)Gets the registered NSCoding.Support class to encode and decode instances of aClass. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
public NSCoding.Support()
| Method Detail | 
public Class classForCoder(Object receiver)
receiver's actual class.
receiver - the object being encoded
receiver
                 when receiver is encoded.NSCoding.classForCoder()public abstract Object decodeObject(NSCoder coder)
coder.
coder - an NSCoder object that will be used to decode an object out of its data
NSCoding
public abstract void encodeWithCoder(Object receiver,
                                     NSCoder coder)
receiver of a specific
 type using NSCoder coder.
receiver - the object being encodedcoder - an NSCoder object that will be used to encode receiverNSCoding.encodeWithCoder(NSCoder coder)
public static void setSupportForClass(NSCoding.Support support,
                                      Class aClass)
support as the NSCoding.Support class to use for encoding and
 decoding instances of aClass.
support - the NSCoding.Support class to be registered for aClassaClass - class whose instances are to be encoded or decodedpublic static NSCoding.Support supportForClass(Class aClass)
aClass.
aClass - class whose instances are to be encoded or decoded
aClass or null otherwise| 
 | Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||