WebObjects 5.2

com.webobjects.foundation
Class NSKeyValueCoding.Utility

java.lang.Object
  |
  +--com.webobjects.foundation.NSKeyValueCoding.Utility
Enclosing class:
NSKeyValueCoding

public static class NSKeyValueCoding.Utility
extends Object

The NSKeyValueCoding.Utility class is a convenience that allows you to access the properties of NSKeyValueCoding objects and non-NSKeyValueCoding objects using the same code.

See Also:
NSKeyValueCoding

Method Summary
static Object handleQueryWithUnboundKey(Object object, String key)
          If object implements NSKeyValueCoding.ErrorHandling, this method invokes handleQueryWithUnboundKey on object.
static void handleTakeValueForUnboundKey(Object object, Object value, String key)
          If object is an NSKeyValueCoding.ErrorHandling, this method invokes handleTakeValueForUnboundKey on object.
static void takeValueForKey(Object object, Object value, String key)
          If object implements NSKeyValueCoding, this method invokes takeValueForKey on object.
static void unableToSetNullForKey(Object object, String key)
          If object is an NSKeyValueCoding.ErrorHandling, this method invokes unableToSetNullForKey on object.
static Object valueForKey(Object object, String key)
          If object implements NSKeyValueCoding, this method invokes valueForKey on object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handleQueryWithUnboundKey

public static Object handleQueryWithUnboundKey(Object object,
                                               String key)
If object implements NSKeyValueCoding.ErrorHandling, this method invokes handleQueryWithUnboundKey on object. Otherwise it invokes NSKeyValueCoding.DefaultImplementation's handleQueryWithUnboundKey method with object as the object on which to operate.
Parameters:
object - the object on which to operate
key - identifies the property of an object
Returns:
custom implementations may return any Object to substitute for the erroneous query
Throws:
NSKeyValueCoding.UnknownKeyException. - The default implementation always throws.
See Also:
NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ErrorHandling.handleQueryWithUnboundKey(java.lang.String), NSKeyValueCoding.DefaultImplementation.handleQueryWithUnboundKey(java.lang.Object, java.lang.String)

handleTakeValueForUnboundKey

public static void handleTakeValueForUnboundKey(Object object,
                                                Object value,
                                                String key)
If object is an NSKeyValueCoding.ErrorHandling, this method invokes handleTakeValueForUnboundKey on object. Otherwise it invokes NSKeyValueCoding.DefaultImplementation's handleTakeValueForUnboundKey method with object as the object on which to operate.
Parameters:
object - the object on which to operate
value - the new value to set the key property to
key - identifies the property on object to operate upon
Throws:
NSKeyValueCoding.UnknownKeyException. - The default implementation always throws.
See Also:
NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ErrorHandling.handleTakeValueForUnboundKey(java.lang.Object, java.lang.String), NSKeyValueCoding.DefaultImplementation.handleTakeValueForUnboundKey(java.lang.Object, java.lang.Object, java.lang.String)

takeValueForKey

public static void takeValueForKey(Object object,
                                   Object value,
                                   String key)
If object implements NSKeyValueCoding, this method invokes takeValueForKey on object. Otherwise it invokes NSKeyValueCoding.DefaultImplementation's takeValueForKey method with object as the object on which to operate.
Parameters:
object - the object on which to operate
value - new value for the key property
key - identifies the property of a object
See Also:
NSKeyValueCoding.takeValueForKey(java.lang.Object, java.lang.String), NSKeyValueCoding.DefaultImplementation

unableToSetNullForKey

public static void unableToSetNullForKey(Object object,
                                         String key)
If object is an NSKeyValueCoding.ErrorHandling, this method invokes unableToSetNullForKey on object. Otherwise it invokes NSKeyValueCoding.DefaultImplementation's unableToSetNullForKey method with object as the object on which to operate.
Parameters:
object - the object on which to operate
key - identifies the property of an object
See Also:
NSKeyValueCoding.ErrorHandling.unableToSetNullForKey(java.lang.String), NSKeyValueCoding.DefaultImplementation.unableToSetNullForKey(java.lang.Object, java.lang.String)

valueForKey

public static Object valueForKey(Object object,
                                 String key)
If object implements NSKeyValueCoding, this method invokes valueForKey on object. Otherwise it invokes NSKeyValueCoding.DefaultImplementation's valueForKey method with object as the object on which to operate.
Parameters:
object - the object on which to operate
key - identifies the property of object to retrieve
Returns:
the result of either object.valueForKey(key) or NSKeyValueCoding.DefaultImplementation.valueForKey(object, key)
See Also:
NSKeyValueCoding.valueForKey(java.lang.String), NSKeyValueCoding.DefaultImplementation

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

Copyright © 2003 Apple Computer, Inc.