WebObjects 5.4.2

com.webobjects.foundation
Class NSKeyValueCoding.Utility

java.lang.Object
  extended by com.webobjects.foundation.NSKeyValueCoding.Utility
Enclosing interface:
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 Object nullValue()
          Returns the Null Object (NSKeyValueCoding.NullValue ).
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

nullValue

public static final Object nullValue()
Returns the Null Object (NSKeyValueCoding.NullValue ).

Implementation note: Implementations of this method need not create a separate NSKeyValueCoding.Null object for each call. Using this method is likely to have comparable cost to using the like-named field. (Unlike this method, the field does not provide type safety.)

Since:
5.4
See Also:
NSKeyValueCoding.NullValue

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

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

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)

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)

Last updated June 2008

Copyright © 2000-2008 Apple Inc.