Implemented By:
EOEnterpriseObject
EOCustomObject
EOGenericRecord
Implements:
com.apple.client.foundation.NSKeyValueCoding (Java Client only)
EOKeyValueCoding
Package:
com.apple.client.eocontrol (Java Client)
com.apple.yellow.eocontrol (WebObjects and Yellow Box)
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 between NSDictionaries and enterprise objects so your objects don't have to explicitly test for EONullValues.
takeValueForKeyPath
public abstract void takeValueForKeyPath (
java.lang.Object value,
java.lang.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 takeValueForKey message 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 java.lang.Object valueForKeyPath (java.lang.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.