net.wotonomy.control
Class PropertyDataSource

java.lang.Object
  extended by net.wotonomy.control.EODataSource
      extended by net.wotonomy.control.OrderedDataSource
          extended by net.wotonomy.control.PropertyDataSource

public class PropertyDataSource
extends OrderedDataSource

A data source that reads and writes to an indexed property of a java object. This class is used by MasterDetailAssociation to retreive objects from the master display group.

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

Field Summary
protected  EOClassDescription classDesc
           
protected  EOEditingContext context
           
protected  java.lang.String key
           
protected  java.lang.Class lastKnownType
           
protected  java.lang.Object source
           
 
Constructor Summary
PropertyDataSource()
          Creates a new PropertyDataSource with no editing context and will try to guess the appropriate class description when trying to create objects.
PropertyDataSource(EOEditingContext aContext)
          Creates a new PropertyDataSource that uses the specified editing context, but will try to guess the appropriate class description when trying to create objects.
PropertyDataSource(EOEditingContext aContext, java.lang.Class aClass)
          Creates a new PropertyDataSource that uses the specified editing context and vends objects of the specified class.
PropertyDataSource(EOEditingContext aContext, EOClassDescription aClassDesc)
          Creates a new PropertyDataSource that uses the specified editing context and vends objects of the specified class description.
 
Method Summary
 EOClassDescription classDescriptionForObjects()
          Returns the class description passed to the constructor, if any.
 EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
          Returns a new instance of this class.
 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.
protected  java.lang.Object getValue()
          Returns the value of the indexed property specified by qualifyWithRelationshipKey.
 void insertObject(java.lang.Object anObject)
          Inserts the specified object into this data source.
 void insertObjectAtIndex(java.lang.Object anObject, int anIndex)
          Inserts the specified object into this data source, at the specified index.
 java.lang.String key()
          Provides the detail key for detail display groups.
 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.
protected  net.wotonomy.foundation.NSMutableArray readAsList()
          Calls getValue() and returns the result as a List.
 void setKey(java.lang.String aKey)
          Allows a detail display group to set the detail key.
 void setSource(java.lang.Object anObject)
          Allows a detail display group to set the master object.
protected  void setValue(java.lang.Object aValue)
          Sets the value of the indexed property specified by qualifyWithRelationshipKey.
 java.lang.Object source()
          Provides the master object for detail display groups.
protected  void writeAsList(java.util.List anObjectList)
          Converts the specified List to lastKnownType and calls setValue().
 
Methods inherited from class net.wotonomy.control.EODataSource
createObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected java.lang.Object source

key

protected java.lang.String key

lastKnownType

protected java.lang.Class lastKnownType

classDesc

protected EOClassDescription classDesc

context

protected EOEditingContext context
Constructor Detail

PropertyDataSource

public PropertyDataSource()
Creates a new PropertyDataSource with no editing context and will try to guess the appropriate class description when trying to create objects.


PropertyDataSource

public PropertyDataSource(EOEditingContext aContext)
Creates a new PropertyDataSource that uses the specified editing context, but will try to guess the appropriate class description when trying to create objects.


PropertyDataSource

public PropertyDataSource(EOEditingContext aContext,
                          java.lang.Class aClass)
Creates a new PropertyDataSource that uses the specified editing context and vends objects of the specified class.


PropertyDataSource

public PropertyDataSource(EOEditingContext aContext,
                          EOClassDescription aClassDesc)
Creates a new PropertyDataSource that uses the specified editing context and vends objects of the specified class description.

Method Detail

source

public java.lang.Object source()
Provides the master object for detail display groups.


setSource

public void setSource(java.lang.Object anObject)
Allows a detail display group to set the master object.


key

public java.lang.String key()
Provides the detail key for detail display groups.


setKey

public void setKey(java.lang.String aKey)
Allows a detail display group to set the detail key.


insertObject

public void insertObject(java.lang.Object anObject)
Inserts the specified object into this data source. Calls insertObjectAtIndex and appends to the end of the list.

Specified by:
insertObject in class EODataSource

insertObjectAtIndex

public void insertObjectAtIndex(java.lang.Object anObject,
                                int anIndex)
Inserts the specified object into this data source, at the specified index.

Specified by:
insertObjectAtIndex in class OrderedDataSource

deleteObject

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

Specified by:
deleteObject in class EODataSource

editingContext

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

Overrides:
editingContext in class EODataSource

fetchObjects

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

Overrides:
fetchObjects in class EODataSource

dataSourceQualifiedByKey

public EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
Returns a new instance of this class.

Specified by:
dataSourceQualifiedByKey in class EODataSource
See Also:
EODataSource.qualifyWithRelationshipKey(java.lang.String, java.lang.Object)

qualifyWithRelationshipKey

public 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.

Specified by:
qualifyWithRelationshipKey in class EODataSource

classDescriptionForObjects

public EOClassDescription classDescriptionForObjects()
Returns the class description passed to the constructor, if any. If no class description and if the bound property is an indexed property, the type of the array is returned, otherwise this method returns null. This method is called by createObject().

Overrides:
classDescriptionForObjects in class EODataSource

readAsList

protected net.wotonomy.foundation.NSMutableArray readAsList()
Calls getValue() and returns the result as a List. Sets lastKnownType to the retrieved type.


writeAsList

protected void writeAsList(java.util.List anObjectList)
Converts the specified List to lastKnownType and calls setValue().


getValue

protected java.lang.Object getValue()
Returns the value of the indexed property specified by qualifyWithRelationshipKey.


setValue

protected void setValue(java.lang.Object aValue)
Sets the value of the indexed property specified by qualifyWithRelationshipKey. The argument is assumed to be of appropriate type for the property. EOObserverCenter is notified that the object will change.



Copyright © 2006 null. All Rights Reserved.