diff --git a/GSWeb.framework/GSWKeyValueAssociation.h b/GSWeb.framework/GSWKeyValueAssociation.h index 6597d86..26b2627 100644 --- a/GSWeb.framework/GSWKeyValueAssociation.h +++ b/GSWeb.framework/GSWKeyValueAssociation.h @@ -46,11 +46,6 @@ -(BOOL)isValueConstant; -(BOOL)isValueSettable; -@end - -//==================================================================== -@interface GSWKeyValueAssociation (GSWAssociationB) - -(NSString*)keyPath; -(NSString*)debugDescription; @end diff --git a/GSWeb.framework/GSWKeyValueAssociation.m b/GSWeb.framework/GSWKeyValueAssociation.m index cd6feaf..3b5229f 100644 --- a/GSWeb.framework/GSWKeyValueAssociation.m +++ b/GSWeb.framework/GSWKeyValueAssociation.m @@ -84,23 +84,28 @@ RCS_ID("$Id$") //-------------------------------------------------------------------- -(void)setValue:(id)aValue - inComponent:(GSWComponent*)object + inComponent:(GSWComponent*)component { + NSException *ex = nil; + if ([_keyPath length]==0) - { - [NSException raise:NSInvalidArgumentException - format:@"No key path when setting value %@ in object of class %@ for association %@", - aValue,NSStringFromClass([object class]),self]; - } - /*Not Here because self is not a string key ! - //TODO (return something!) - [object validateValue:&aValue - forKey:self]; - */ - [GSWAssociation setValue:aValue - inComponent:object - forKeyPath:_keyPath]; -}; + { + [NSException raise:NSInvalidArgumentException + format:@"No key path when setting value %@ in object of class %@ for association %@", + aValue,NSStringFromClass([component class]),self]; + } + + NS_DURING { + [component validateTakeValue:aValue + forKeyPath:_keyPath]; + } NS_HANDLER { + ex = localException; + } NS_ENDHANDLER; + + [component validationFailedWithException:ex + value:aValue + keyPath:_keyPath]; +} //-------------------------------------------------------------------- -(BOOL)isValueConstant