Up

EOKeyValueCoding

Authors

Mircea Oancea (mircea@jupiter.elcom.pub.ro)
Mirko Viviani (mirko.viviani@gmail.com)
Manuel Guesdon (mguesdon@oxymium.net)
David Ayers (ayers@fsfe.org)

Copyright: (C) 1996-2002,2003,2004,2005 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSArray(EOKeyValueCoding) category
  2. Software documentation for the NSDictionary(EOKeyValueCoding) category
  3. Software documentation for the NSMutableDictionary(EOKeyValueCoding) category
  4. Software documentation for the NSObject(EOKVCGDL2Additions) informal protocol
  5. Software documentation for the NSObject(EOKeyValueCoding) informal protocol
  6. Software documentation for the NSObject(EOKeyValueCodingAdditions) informal protocol
  7. Software documentation for the NSObject(MacOSX) informal protocol
  8. EOKeyValueCoding variables

Software documentation for the NSArray(EOKeyValueCoding) category

NSArray(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

computeAvgForKey: 

- (id) computeAvgForKey: (NSString*)key;
Iterates over the objects of the receiver send each object valueForKey: with the parameter. The decimalValue of the returned object is accumalted and then divided by number of objects contained by the receiver as returned by NSArray count. An empty array returns NSDecimalNumber 0.

computeCountForKey: 

- (id) computeCountForKey: (NSString*)key;
Description forthcoming.

computeMaxForKey: 

- (id) computeMaxForKey: (NSString*)key;
Description forthcoming.

computeMinForKey: 

- (id) computeMinForKey: (NSString*)key;
Description forthcoming.

computeSumForKey: 

- (id) computeSumForKey: (NSString*)key;
Iterates over the objects of the receiver send each object valueForKey: with the parameter. The decimalValue of the returned object is accumalted. An empty array returns NSDecimalNumber 0.

valueForKey: 

- (id) valueForKey: (NSString*)key;
EOKeyValueCoding protocol
This overrides NSObjects implementation of this method. Generally this method returns an array of objects returned by invoking valueForKey: for each item in the receiver, substituting EONull for nil. Keys formated like "@function.someKeyPath" are resolved by invoking NSArray compute Function WithKey: "someKeyPath" on the receiver. If the keyPath is omitted, the function will be called with nil. The following functions are supported by default: Computational components generally expect a keyPath to be passed to the function. This is not mandatory in which case 'nil' will be supplied. (i.e. you may use "@myFuncWhichCanHandleNil" as a key.)
There is no special handling of EONull. Therefore expect exceptions on EONull not responding to decimalValue and compare: when the are used with this mechanism.

valueForKeyPath: 

- (id) valueForKeyPath: (NSString*)keyPath;
EOKeyValueCoding protocol
Returns the object returned by invoking valueForKeyPath: on the object returned by invoking valueForKey: on the receiver with the first key component supplied by the key path, with rest of the key path.
If the first component starts with "@", the first component includes the key of the computational key component and as the form "@function.keyPath". If there is only one key component, this method invokes valueForKey: in the receiver with that component.

Software documentation for the NSDictionary(EOKeyValueCoding) category

NSDictionary(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

storedValueForKey: 

- (id) storedValueForKey: (NSString*)key;
Returns the object stored in the dictionary for this key. Unlike Foundation, this method may return objects for keys other than those explicitly stored in the receiver. These special keys are 'count', 'allKeys' and 'allValues'. We do not simply invoke [NSDictionary -valueForKey:] to avoid recursions in subclasses that might implement [NSDictionary -valueForKey:] by calling [NSDictionary -storedValueForKey:]

storedValueForKeyPath: 

- (id) storedValueForKeyPath: (NSString*)keyPath;
First checks whether the entire keyPath is contained as a key in the receiver before invoking super's implementation. (The special quoted key handling will probably be moved to a GSWDictionary subclass to be used by GSWDisplayGroup.)

valueForKey: 

- (id) valueForKey: (NSString*)key;
Returns the object stored in the dictionary for this key. Unlike Foundation, this method may return objects for keys other than those explicitly stored in the receiver. These special keys are 'count', 'allKeys' and 'allValues'. We override the implementation to account for these special keys.

valueForKeyPath: 

- (id) valueForKeyPath: (NSString*)keyPath;
First checks whether the entire keyPath is contained as a key in the receiver before invoking super's implementation. (The special quoted key handling will probably be moved to a GSWDictionary subclass to be used by GSWDisplayGroup.)

Software documentation for the NSMutableDictionary(EOKeyValueCoding) category

NSMutableDictionary(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

takeValue: forKey: 

- (void) takeValue: (id)value forKey: (NSString*)key;
Description forthcoming.

Software documentation for the NSObject(EOKVCGDL2Additions) informal protocol

NSObject(EOKVCGDL2Additions)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

smartTakeValue: forKey: 

- (void) smartTakeValue: (id)object forKey: (NSString*)key;
Description forthcoming.

smartTakeValue: forKeyPath: 

- (void) smartTakeValue: (id)object forKeyPath: (NSString*)keyPath;
Description forthcoming.

storedValueForKeyPath: 

- (id) storedValueForKeyPath: (NSString*)key;
Description forthcoming.

storedValuesForKeyPaths: 

- (NSDictionary*) storedValuesForKeyPaths: (NSArray*)keyPaths;
Description forthcoming.

takeStoredValue: forKeyPath: 

- (void) takeStoredValue: (id)value forKeyPath: (NSString*)key;
Description forthcoming.

valuesForKeyPaths: 

- (NSDictionary*) valuesForKeyPaths: (NSArray*)keyPaths;
Description forthcoming.

Software documentation for the NSObject(EOKeyValueCoding) informal protocol

NSObject(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
GDL2 aims to be compatible with EOF of WebObjects 4.5 and expects to be compiled with gnustep-base or the current version Foundation of Mac OS X together with gnustep-baseadd, the Additions subproject of gnustep-base. As many of the EOKeyValueCoding methods have moved to NSKeyValueCoding, GDL2 merely implements those methods which are not part of NSKeyValueCoding or reimplements those methods to insure WebObjects 4.5 compatibility or augment the behavior for GDL2 specific features.
Method summary

accessInstanceVariablesDirectly 

+ (BOOL) accessInstanceVariablesDirectly;
Unimplemented here. Relies on NSKeyValueCoding.

flushAllKeyBindings 

+ (void) flushAllKeyBindings;
Does nothing. Key bindings are currently not cached so there is no need to flush them. This method exists for API compatibility.

useStoredAccessor 

+ (BOOL) useStoredAccessor;
Unimplemented here. Relies on NSKeyValueCoding.

handleQueryWithUnboundKey: 

- (id) handleQueryWithUnboundKey: (NSString*)key;
Unimplemented here. Relies on NSKeyValueCoding.

handleTakeValue: forUnboundKey: 

- (void) handleTakeValue: (id)value forUnboundKey: (NSString*)key;
Unimplemented here. Relies on NSKeyValueCoding.

storedValueForKey: 

- (id) storedValueForKey: (NSString*)key;
Unimplemented here. Relies on NSKeyValueCoding.

takeStoredValue: forKey: 

- (void) takeStoredValue: (id)value forKey: (NSString*)key;
Unimplemented here. Relies on NSKeyValueCoding.

takeValue: forKey: 

- (void) takeValue: (id)value forKey: (NSString*)key;
Overrides the implementation of gnustep-base/Foundation this method is currently deprecated in favor of setValue:forKey: yet we aim to maintain WebObjects 4.5 compatibility.

unableToSetNilForKey: 

- (void) unableToSetNilForKey: (NSString*)key;
This method is invoked by the EOKeyValueCoding mechanism when an attempt is made to set an null value for a scalar attribute. Contrary to the TOC of the documentation, this method is called unableToSetNilForKey: and not unableToSetNullForKey:
This implementation raises an NSInvalidArgument exception.
The NSKeyValueCoding setNilValueForKey: is overriden to invoke this method instead. We manipulate the runtime to insure that our implementation of unableToSetNilForKey: is used in favor of the one in gnustep-base or Foundation.

valueForKey: 

- (id) valueForKey: (NSString*)key;
Unimplemented here. Relies on NSKeyValueCoding.

Software documentation for the NSObject(EOKeyValueCodingAdditions) informal protocol

NSObject(EOKeyValueCodingAdditions)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

takeValue: forKeyPath: 

- (void) takeValue: (id)value forKeyPath: (NSString*)keyPath;
Overrides the implementation of gnustep-base/Foundation this method is currently deprecated in favor of setValue:forKeyPath: yet we aim to maintain WebObjects 4.5 compatibility.

takeValuesFromDictionary: 

- (void) takeValuesFromDictionary: (NSDictionary*)dictionary;
Overrides the implementation of gnustep-base/Foundation this method is currently deprecated in favor of setValue:forKeyPath: yet we aim to maintain WebObjects 4.5 compatibility.

valueForKeyPath: 

- (id) valueForKeyPath: (NSString*)keyPath;
Unimplemented here. Relies on NSKeyValueCoding.

valuesForKeys: 

- (NSDictionary*) valuesForKeys: (NSArray*)keys;
Unimplemented here. Relies on NSKeyValueCoding.

Software documentation for the NSObject(MacOSX) informal protocol

NSObject(MacOSX)

Declared in:
EOControl/EOKeyValueCoding.h
Description forthcoming.
Method summary

takeStoredValuesFromDictionary: 

- (void) takeStoredValuesFromDictionary: (NSDictionary*)dictionary;
Description forthcoming.

EOKeyValueCoding variables

EOTargetObjectUserInfoKey

NSString* EOTargetObjectUserInfoKey;
Description forthcoming.

EOUnknownUserInfoKey

NSString* EOUnknownUserInfoKey;
Description forthcoming.


Up