Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

EOKeyValueCodingAdditions.DefaultImplementation


Inherits from:
Object
Package:
com.webobjects.eocontrol


Class Description


The EOKeyValueCodingAdditions.DefaultImplementation class provides default implementations of the EOKeyValueCodingAdditions interface.

An EOCustomObject uses EOKeyValueCodingAdditions.DefaultImplementation's default implementations. EOKeyValueCodingAdditions.Support also enables you to put non-enterprise objects into the interface layer by declaring that your class conforms to key-value coding.

The methods in the DefaultImplementation class are just like the methods defined by the EOKeyValueCodingAdditions interface, except they are all static methods and they take an extra argument-the enterprise object on which the default implementation should operate. For example, suppose you want to implement an Employee enterprise object class that doesn't inherit from EOCustomObject but that uses DefaultImplementation's default implementations. Employee's valuesForKeys method would look like this:


public abstract NSDictionary valuesForKeys(NSArray keys)
    return EOKeyValueCodingAdditions.Support.valuesForKeys(this, keys);
}




Static Methods



takeValueForKeyPath

public static void takeValueForKeyPath( NSKeyValueCoding anObject, Object value, String keyPath)

Sets anObject's property identified by keyPath to value. A key path has the form relationship.property (with one or more relationships). Support's implementation gets the destination object for each relationship using valueForKey, and sends the final object a takeValueForKeymessage with value and property.

takeValuesFromDictionary

public static void takeValuesFromDictionary( NSKeyValueCoding anObject, NSDictionary aDictionary)

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

See Also: takeValuesFromDictionary (EOKeyValueCodingAdditions)



valueForKeyPath

public static Object valueForKeyPath( NSKeyValueCoding anObject, String keyPath)

Returns anObject's value for the derived property identified by keyPath. A key path has the form relationship.property (with one or more relationships). Support'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 static NSDictionary valuesForKeys( NSKeyValueCoding anObject, NSArray keys)

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

See Also: valuesForKeys (EOKeyValueCodingAdditions)



© 2001 Apple Computer, Inc. (Last Published April 19, 2001)


Table of Contents