WebObjects 5.4.2

com.webobjects.eoapplication
Class EOArchive

java.lang.Object
  extended by com.webobjects.eoapplication.EOArchive

public class EOArchive
extends Object

EOArchive is used to load interface files created with the Interface Builder application. It is important that the file's owner of the interface file is specified correctly in Interface Builder. The class of the file's owner has to be set exactly to the class of the object which is the owner of the archive at runtime, including the full package name.


Constructor Summary
EOArchive(Object owner, NSDisposableRegistry registry)
          Creates a new archive object with the owner owner and the disposably registry registry for the objects loaded from the archive.
 
Method Summary
protected  void debug(String message)
          Logs a debug message.
 NSDisposableRegistry disposableRegistry()
          Returns the disposable registry for the objects loaded from the archive.
static NSDictionary loadArchiveNamed(String archiveName, Object owner, String archivePackageName, NSDisposableRegistry registry)
          Loads an archive.
 NSDictionary namedObjects()
          Returns a dictionary with all named objects loaded from the archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOArchive

public EOArchive(Object owner,
                 NSDisposableRegistry registry)
Creates a new archive object with the owner owner and the disposably registry registry for the objects loaded from the archive. You never instantiate an EOArchive directly. Rather, you use the loadArchiveNamed methods to load interface files.

Parameters:
owner - the owner of the archive
registry - the disposable registry for the objects loaded from the archive
Method Detail

disposableRegistry

public NSDisposableRegistry disposableRegistry()
Returns the disposable registry for the objects loaded from the archive. All objects loaded from the archive are added to this registry and are disposed off together with the registry object.

Returns:
the disposable registry for the objects loaded from the archive

debug

protected void debug(String message)
Logs a debug message.

Parameters:
message - the debug message

loadArchiveNamed

public static NSDictionary loadArchiveNamed(String archiveName,
                                            Object owner,
                                            String archivePackageName,
                                            NSDisposableRegistry registry)

Loads an archive. archiveName is the name of the interface file created in Interface Builder, owner is the owner of the archive (the object loading the archive), and archivePackageName is the package name of the owner's class (you can just pass null and this method will find the package name automatically). All objects loaded from the archive will be placed in the disposable registry registry (which can also be null if you don't need a disposable registry), so that you can easily dispose off all the objects loaded by disposing the registry.

If the archive can't be found or there is an error while loading it, this method throws a runtime exception.

Parameters:
archiveName - the name of the interface file
owner - the owner of the archive
archivePackageName - the package name of the owner (or simply null)
registry - the disposable registry for the objects loaded from the archive
Returns:
a dictionary with all named objects loaded from the archive

namedObjects

public NSDictionary namedObjects()
Returns a dictionary with all named objects loaded from the archive. Not all objects are named. The keys in the dictionary are the names, the values are the objects.

Returns:
a dictionary with all named objects loaded from the archive

Last updated June 2008

Copyright © 2000-2008 Apple Inc.