net.wotonomy.control
Class EODataSource

java.lang.Object
  extended by net.wotonomy.control.EODataSource
Direct Known Subclasses:
ChildDataSource, OrderedDataSource

public abstract class EODataSource
extends java.lang.Object

EODataSource is used by EODisplayGroup.fetch() to retrieve a list of objects to display. When a display group has a data source, the display group will use the data source to populate the object list and to create new objects to be displayed in the list, and will update the data source when objects are inserted or removed from the list.

In certain cases, as when a display group needs to populate a child display group to show a one-to-many relationship, the display group will call dataSourceQualifiedByKey to return a new data source that can vend objects associated with the specified key and then call qualifyWithRelationshipKey to specify the object and key that are the source of the child relationship.

Concrete subclasses are expected to override fetch() and are required to override insertObject and removeObject.

Version:
$Revision: 894 $
Author:
michael@mpowers.net, $Author: cgruber $

Constructor Summary
EODataSource()
           
 
Method Summary
 EOClassDescription classDescriptionForObjects()
          Returns the description of the class of the objects that is vended by this data source, or null if this cannot be determined.
 java.lang.Object createObject()
          Creates a new object.
abstract  EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
          Returns a data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source.
abstract  void deleteObject(java.lang.Object anObject)
          Deletes the specified object from this data source.
 EOEditingContext editingContext()
          Returns the editing context for this data source, or null if no editing context is used.
 net.wotonomy.foundation.NSArray fetchObjects()
          Returns a List containing the objects in this data source.
abstract  void insertObject(java.lang.Object anObject)
          Inserts the specified object into this data source.
abstract  void qualifyWithRelationshipKey(java.lang.String aKey, java.lang.Object anObject)
          Restricts this data source to vend those objects that are associated with the specified key on the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EODataSource

public EODataSource()
Method Detail

createObject

public java.lang.Object createObject()
Creates a new object. You should call insertObject() to insert the new object into this data source. This implementation attempts to create a new instance of the class returned by classDescriptionForObjects(). Override to return an object specific to your implementation.

Returns:
The newly created object, or null if new objects are not supported by this data source.
See Also:
classDescriptionForObjects()

insertObject

public abstract void insertObject(java.lang.Object anObject)
Inserts the specified object into this data source.


deleteObject

public abstract void deleteObject(java.lang.Object anObject)
Deletes the specified object from this data source.


editingContext

public EOEditingContext editingContext()
Returns the editing context for this data source, or null if no editing context is used. This implementation returns null.


fetchObjects

public net.wotonomy.foundation.NSArray fetchObjects()
Returns a List containing the objects in this data source. This implementation returns null.


dataSourceQualifiedByKey

public abstract EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
Returns a data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source.

See Also:
qualifyWithRelationshipKey(java.lang.String, java.lang.Object)

qualifyWithRelationshipKey

public abstract void qualifyWithRelationshipKey(java.lang.String aKey,
                                                java.lang.Object anObject)
Restricts this data source to vend those objects that are associated with the specified key on the specified object.


classDescriptionForObjects

public EOClassDescription classDescriptionForObjects()
Returns the description of the class of the objects that is vended by this data source, or null if this cannot be determined. This implementation returns null.



Copyright © 2006 null. All Rights Reserved.