PATH  Documentation > WebObjects 4.5 > EOControl Reference

Table of Contents

EOKeyValueCodingAdditions


Implemented by:
EOEnterpriseObject
EOCustomObject
EOGenericRecord
Implements:
EOKeyValueCoding
(com.apple.client.eocontrol only) NSKeyValueCoding
Package:
com.apple.client.eocontrol
com.apple.yellow.eocontrol

Interface Description


The EOKeyValueCodingAdditions interface defines extensions to the basic EOKeyValueCoding interface. One pair of methods, takeValuesFromDictionary and valuesForKeys, gives access to groups of properties. Another pair of methods, takeValueForKeyPath and valueForKeyPath give access to properties across relationships with key paths of the form relationship.property ; for example, "department.name". EOCustomObject and EOGenericRecord provide default implementations of EOKeyValueCodingAdditions, which you rarely (if ever) need to override.


EONullValue in Collections

Because collection objects such as NSArray and NSDictionary can't contain null as a value, null must be represented by a special object, EONullValue. EONullValue provides a single instance that represents the NULL value for object attributes. The default implementations of takeValuesFromDictionary and valuesForKeys translate EONullValue and null between NSDictionaries and enterprise objects so your objects don't have to explicitly test for EONullValues.



Instance Methods



takeValueForKeyPath

public abstract void takeValueForKeyPath( Object value, String keyPath)

Sets the value for the property identified by keyPath to value. A key path has the form relationship.property (with one or more relationships); for example "movieRole.roleName" or "movieRole.Talent.lastName". EOCustomObject's implementation of this method gets the destination object for each relationship using valueForKey, and sends the final object a takeValueForKeymessage with value and property.

takeValuesFromDictionary

public abstract void takeValuesFromDictionary(NSDictionary aDictionary)

Sets properties of the receiver with values from aDictionary, using its keys to identify the properties. EOCustomObject's implementation invokes takeValueForKey for each key-value pair, substituting null for EONullValues in aDictionary.

valueForKeyPath

public abstract Object valueForKeyPath(String keyPath)

Returns the value for the derived property identified by keyPath. A key path has the form relationship.property (with one or more relationships); for example "movieRole.roleName" or "movieRole.Talent.lastName". EOCustomObject's implementation of this method gets the destination object for each relationship using valueForKey, and returns the result of a valueForKey message to the final object.

valuesForKeys

public abstract NSDictionary valuesForKeys(NSArray keys)

Returns a dictionary containing the property values identified by each of keys. EOCustomObject's implementation invokes valueForKey for each key in keys, substituting EONullValues in the dictionary for returned null values.


Table of Contents