|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The NSKeyValueCoding.ErrorHandling interface declares an API for handling errors that occur during key-value coding. If implemented, these methods allow customized handling error in the default implementation of key value coding.
NSKeyValueCoding
Method Summary | |
Object |
handleQueryWithUnboundKey(String key)
Invoked from valueForKey when it finds no property binding
for key . |
void |
handleTakeValueForUnboundKey(Object value,
String key)
Invoked from takeValueForKey when it finds no property binding
for key . |
void |
unableToSetNullForKey(String key)
Invoked from takeValueForKey when it is given a null value
for a scalar property (such as an int or a float ). |
Method Detail |
public Object handleQueryWithUnboundKey(String key)
valueForKey
when it finds no property binding
for key
. The default implementation
throws an NSKeyValueCoding.UnknownKeyException,
with the target object(TargetObjectUserInfoKey)
and
key(UnknownUserInfokey)
in the user info. An NSKeyValueCoding.ErrorHandling class can override this
method to handle the query in some other way. The method can return a value,
in which case that value is returned by the corresponding
valueForKey
invocation.
key
- the property name which generated this error
null
that the custom implementation desires. The default implementation throws an exception instead.
NSKeyValueCoding.UnknownKeyException
- when it finds no
property binding for keyNSKeyValueCoding.valueForKey(java.lang.String)
,
NSKeyValueCoding.UnknownKeyException
,
NSKeyValueCoding.DefaultImplementation
public void handleTakeValueForUnboundKey(Object value, String key)
takeValueForKey
when it finds no property binding
for key
. The default implementation
throws an NSKeyValueCoding.UnknownKeyException, with the
target object(TargetObjectUserInfoKey)
and key(UnknownUserInfoKey)
in the user info dictionary of the exception. An NSKeyValueCoding.ErrorHandling class can override this
method to handle the error in some other way.
value
- the new value which could not be setkey
- the name of the property which generated this error
NSKeyValueCoding.UnknownKeyException
- when it finds
no property binding for keyNSKeyValueCoding.takeValueForKey(java.lang.Object, java.lang.String)
,
NSKeyValueCoding.UnknownKeyException
,
NSKeyValueCoding.DefaultImplementation
public void unableToSetNullForKey(String key)
takeValueForKey
when it is given a null
value
for a scalar property (such as an int
or a float
).
The default implementation throws an IllegalArgumentException
.
You might want to implement the method (or override the inherited
implementation) to handle the request in some other way, such as by
substituting new Integer(0)
or a sentinel value and invoking takeValueForKey
again.
key
- the name of the property which generated this error
IllegalArgumentException
- when it is given a null value
for a scalar propertyNSKeyValueCoding.takeValueForKey(Object value, String key)
,
NSKeyValueCoding.DefaultImplementation
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |