WebObjects 5.2

com.webobjects.eocontrol
Class EOKeyValueCoding.DefaultImplementation

java.lang.Object
  |
  +--com.webobjects.eocontrol.EOKeyValueCoding.DefaultImplementation
Enclosing class:
EOKeyValueCoding

public static class EOKeyValueCoding.DefaultImplementation
extends Object

The EOKeyValueCoding.DefaultImplementation class provides the WebObjects default implementation of the EOKeyValueCoding interface.

See Also:
EOKeyValueCoding

Method Summary
static Object storedValueForKey(Object object, String key)
          Retrieves the value associated with the property named key on object.
static void takeStoredValueForKey(Object object, Object value, String key)
          Sets the property identified by key to value on object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

storedValueForKey

public static Object storedValueForKey(Object object,
                                       String key)

Retrieves the value associated with the property named key on object. This method is used when the value is retrieved for storage in an object store (generally, this ultimately in a database) or for inclusion in a snapshot.

The default implementation searches for a method and (if canAccessFieldsDirectly is true) for a field matching key. For example, for key "value" the search order is as follows: (a) method "_getValue"; (b) method "_value"; (c) method "_isValue"; (d) field "_value"; (e) field "_isValue"; (f) field "value"; (g) field "isValue"; (h) method "getValue"; (i) method "value"; (j) method "isValue". If an unknown key is encountered and the object implements the NSKeyValueCoding.ErrorHandling interface, handleQueryWithUnboundKey is invoked, otherwise a NSKeyValueCoding.UnknownKeyException is raised.

Parameters:
object - the object on which to operate
key - the property of object to retrieve
Returns:
object's stored value for the property identified by key
See Also:
EOKeyValueCoding.storedValueForKey(String), NSKeyValueCoding, NSKeyValueCoding.ErrorHandling

takeStoredValueForKey

public static void takeStoredValueForKey(Object object,
                                         Object value,
                                         String key)

Sets the property identified by key to value on object. This method is used to initialize the receiver with values from an object store (generally, this is ultimately from a database) or to restore a value from a snapshot.

The default implementation searches for a method and (if canAccessFieldsDirectly is true) for a field matching key. For example, for key "value" the search order is as follows: (a) method "_setValue"; (b) field "_value"; (c) field "_isValue"; (d) field "value"; (e) field "isValue"; (f) method "setValue". If an unknown key is encountered and the object implements the NSKeyValueCoding.ErrorHandling interface, handleTakeValueForUnboundKey is invoked, otherwise a NSKeyValueCoding.UnknownKeyException is raised.

Parameters:
object - the object on which to operate
value - the new value for the key property
key - the property of object to set
See Also:
EOKeyValueCoding.takeStoredValueForKey(Object, String), NSKeyValueCoding, NSKeyValueCoding.ErrorHandling

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.