|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.eocontrol.EOKeyValueUnarchiver
EOKeyValueUnarchiver objects are used to re(create) an object graph which was archived into a "property list" with a EOKeyValueArchiver. A typical way to use EOKeyValueArchiver/EOKeyValueUnarchiver is:
Object objectToArchive = ...; EOKeyValueArchiver archiver = new EOKeyValueArchiver(); archiver.setDelegate(...); archiver.encodeObject(objectToArchive, "ArchiveName"); NSDictionary archive = archiver.dictionary();
Afterwards, to recreate the object graph:
NSDictionary archive = ...; // for example a dictionary loaded from a file EOKeyValueUnarchiver unarchiver = new EOKeyValueUnarchiver(archive); unarchiver.setDelegate(...); Object archivedObject = unarchiver.decodeObjectForKey("ArchiveName"); unarchiver.finishInitializationOfObjects(); unarchiver.awakeObjects();
EOKeyValueArchiver
,
EOKeyValueArchiving
Nested Class Summary | |
static interface |
EOKeyValueUnarchiver.Delegate
The EOKeyValueUnarchiver.Delegate interface defines methods which can be used by a delegate object of an EOKeyValueUnarchiver to control the behavior of the unarchiver object. |
Constructor Summary | |
EOKeyValueUnarchiver(NSDictionary dictionary)
Creates a new EOKeyValueUnarchiver to decode the property list dictionary . |
Method Summary | |
void |
awakeObjects()
Completes an unarchiving process by sending all unarchived objects which implement the EOKeyValueArchiving.Awaking interface a awakeFromKeyValueUnarchiver method. |
boolean |
decodeBoolForKey(String key)
Unarchives a boolean that was archived under the key key . |
int |
decodeIntForKey(String key)
Unarchives an integer that was archived under the key key . |
Object |
decodeObjectForKey(String key)
Unarchives an object that was archived in place under the key key . |
Object |
decodeObjectReferenceForKey(String key)
Unarchives an object that was archived as a reference (placeholder). |
Object |
delegate()
Returns the receiver's delegate. |
void |
ensureObjectAwake(Object object)
The order that objects an unarchiver sends awakeFromKeyValueUnarchiver
to the unarchived objects is not defined. |
void |
finishInitializationOfObjects()
Completes an unarchiving process by sending all unarchived objects that implement the EOKeyValueArchiving.FinishInitialization interface a finishInitializationWithKeyValueUnarchiver method. |
Object |
parent()
Returns the parent object for the currently unarchived object. |
void |
setDelegate(Object delegate)
Sets the receiver's delegate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EOKeyValueUnarchiver(NSDictionary dictionary)
dictionary
.
dictionary
- the property list to be decodedMethod Detail |
public void awakeObjects()
awakeFromKeyValueUnarchiver
method. This
methods needs to be invoked at the end of the unarchiving process, after
invoking finishInitializationOfObjects
.
ensureObjectAwake(Object)
,
finishInitializationOfObjects()
public boolean decodeBoolForKey(String key)
key
.
key
- the key under which the boolean to be unarchived is stored
public int decodeIntForKey(String key)
key
.
key
- the key under which the integer to be unarchived is stored
public Object decodeObjectForKey(String key)
key
.
The object to unarchive needs to be an instance of the NSArray or NSDictionary
class, implement the EOKeyValueArchiving interface, or have a Support object
registered with EOKeyValueArchiving.
key
- the key under which the object to be unarchived is stored
EOKeyValueArchiving
,
EOKeyValueArchiving.Support
public Object decodeObjectReferenceForKey(String key)
unarchiverObjectForReference
method.
key
- the key under which the object to be unarchived is storedpublic Object delegate()
public void ensureObjectAwake(Object object)
awakeFromKeyValueUnarchiver
to the unarchived objects is not defined. However, if in its implementation of
awakeFromKeyValueUnarchiver
an object depends a related object already
being awake, it can call ensureObjectAwake
passing the related object.
object
- the object which needs to be awakenawakeObjects()
public void finishInitializationOfObjects()
finishInitializationWithKeyValueUnarchiver
method. This
methods needs to be invoked at the end of the unarchiving process, but
before invoking awakeObjects
.
awakeObjects()
public Object parent()
public void setDelegate(Object delegate)
delegate
- the delegate
|
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 |