Up

EOKeyValueCoding

Authors

Mircea Oancea (mircea@jupiter.elcom.pub.ro)
Mirko Viviani (mirko.viviani@rccr.cremona.it)
Manuel Guesdon (mguesdon@oxymium.net)
David Ayers (d.ayers@inode.at)

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

Software documentation for the NSArray(EOKeyValueCoding) category

NSArray(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

Description forthcoming.
Method summary

computeAvgForKey: 

- (id) computeAvgForKey: (NSString*)key;
Availability: OpenStep

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 -coung] . An empty array returns NSDecimalNumber 0.

computeCountForKey: 

- (id) computeCountForKey: (NSString*)key;
Availability: OpenStep

Description forthcoming.

computeMaxForKey: 

- (id) computeMaxForKey: (NSString*)key;
Availability: OpenStep

Description forthcoming.

computeMinForKey: 

- (id) computeMinForKey: (NSString*)key;
Availability: OpenStep

Description forthcoming.

computeSumForKey: 

- (id) computeSumForKey: (NSString*)key;
Availability: OpenStep

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;
Availability: OpenStep

EOKeyValueCoding protocol
This overrides NSObjects implementation of this method. Generally this method returns an array of objects returned by invoking [NSObject -valueForKey:] for each item in the receiver, substituting EONull for nil. Keys formated like "@function.someKey" are resolved by invoking [NSArray -computeFuncionWithKey:] "someKey" on the receiver. If the key is omitted, the function will be called with nil. The following functions are supported by default: Computational components generally expect a key 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.) As a special case the key "count" does not actually invoke computeCountForKey: on receiver but returns the number of objects of the receiver.
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;
Availability: OpenStep

EOKeyValueCoding protocol
Returns the object returned by invoking [NSObject -valueForKeyPath:] on the object returned by invoking [NSObject -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.key". If there is only one key component, this method invokes [NSObject -valueForKey:] in the receiver with that component. Unlike the reference implementation GDL2 allows you to continue the keyPath in a meaningful way after @count but the path must then contain a key as the computational key structure implies. (i.e. you may use "@count.self.decimalValue") The actual key "self" is in fact ignored during the computation, but the formal structure must be maintained.
It should be mentioned that the reference implementation would return the result of "@count" independent of any additional key paths, even if they were meaningless like "@count.bla.strange". GDL2 will raise, if the object returned by valueForKey:@"count.bla" (which generally is an NSDecimalNumber) raises on valueForKey:@"strange".

Software documentation for the NSDictionary(EOKeyValueCoding) category

NSDictionary(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

Description forthcoming.
Method summary

storedValueForKey: 

- (id) storedValueForKey: (NSString*)key;
Availability: OpenStep

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;
Availability: OpenStep

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;
Availability: OpenStep

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;
Availability: OpenStep

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
Availability: OpenStep

Description forthcoming.
Method summary

takeValue: forKey: 

- (void) takeValue: (id)value forKey: (NSString*)key;
Availability: OpenStep

Description forthcoming.

Software documentation for the NSObject(EOKVCGDL2Additions) informal protocol

NSObject(EOKVCGDL2Additions)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

Description forthcoming.
Method summary

smartTakeValue: forKey: 

- (void) smartTakeValue: (id)object forKey: (NSString*)key;
Availability: OpenStep

Description forthcoming.

smartTakeValue: forKeyPath: 

- (void) smartTakeValue: (id)object forKeyPath: (NSString*)keyPath;
Availability: OpenStep

Description forthcoming.

storedValueForKeyPath: 

- (id) storedValueForKeyPath: (NSString*)key;
Availability: OpenStep

Description forthcoming.

storedValuesForKeyPaths: 

- (NSDictionary*) storedValuesForKeyPaths: (NSArray*)keyPaths;
Availability: OpenStep

Description forthcoming.

takeStoredValue: forKeyPath: 

- (void) takeStoredValue: (id)value forKeyPath: (NSString*)key;
Availability: OpenStep

Description forthcoming.

valuesForKeyPaths: 

- (NSDictionary*) valuesForKeyPaths: (NSArray*)keyPaths;
Availability: OpenStep

Description forthcoming.

Software documentation for the NSObject(EOKeyValueCoding) informal protocol

NSObject(EOKeyValueCoding)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

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;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

flushAllKeyBindings 

+ (void) flushAllKeyBindings;
Availability: OpenStep

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;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

handleQueryWithUnboundKey: 

- (id) handleQueryWithUnboundKey: (NSString*)key;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

handleTakeValue: forUnboundKey: 

- (void) handleTakeValue: (id)value forUnboundKey: (NSString*)key;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

storedValueForKey: 

- (id) storedValueForKey: (NSString*)key;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

takeStoredValue: forKey: 

- (void) takeStoredValue: (id)value forKey: (NSString*)key;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

takeValue: forKey: 

- (void) takeValue: (id)value forKey: (NSString*)key;
Availability: OpenStep

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;
Availability: OpenStep

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;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

Software documentation for the NSObject(EOKeyValueCodingAdditions) informal protocol

NSObject(EOKeyValueCodingAdditions)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

Description forthcoming.
Method summary

takeValue: forKeyPath: 

- (void) takeValue: (id)value forKeyPath: (NSString*)keyPath;
Availability: OpenStep

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;
Availability: OpenStep

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;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

valuesForKeys: 

- (NSDictionary*) valuesForKeys: (NSArray*)keys;
Availability: OpenStep

Unimplemented here. Relies on NSKeyValueCoding.

Software documentation for the NSObject(MacOSX) informal protocol

NSObject(MacOSX)

Declared in:
EOControl/EOKeyValueCoding.h
Availability: OpenStep

Description forthcoming.
Method summary

takeStoredValuesFromDictionary: 

- (void) takeStoredValuesFromDictionary: (NSDictionary*)dictionary;
Availability: OpenStep

Description forthcoming.


Up