2
Copyright (C) 2000-2005 SKYRIX Software AG
4
This file is part of SOPE.
6
SOPE is free software; you can redistribute it and/or modify it under
7
the terms of the GNU Lesser General Public License as published by the
8
Free Software Foundation; either version 2, or (at your option) any
11
SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14
License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with SOPE; see the file COPYING. If not, write to the
18
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22
#include "SoLookupAssociation.h"
24
#include <NGObjWeb/WOComponent.h>
27
@implementation SoLookupAssociation
30
return [super version] /* v2 */;
33
NSAssert2([super version] == 2,
34
@"invalid superclass (%@) version %i !",
35
NSStringFromClass([self superclass]), [super version]);
38
- (id)initWithTraversalPath:(NSArray *)_tp acquire:(BOOL)_ac {
39
if ((self = [super init])) {
40
self->traversalPath = [_tp copy];
46
- (id)initWithString:(NSString *)_s {
49
if ((acq = [_s hasPrefix:@"+"]))
50
_s = [_s substringFromIndex:1];
52
return [self initWithTraversalPath:[_s pathComponents] acquire:acq];
56
[self->traversalPath release];
62
- (NSArray *)traversalPath {
63
return self->traversalPath;
71
- (BOOL)isValueConstant {
74
- (BOOL)isValueSettable {
80
- (void)setValue:(id)_value inComponent:(WOComponent *)_component {
82
[NSException raise:@"AssociationException"
83
format:@"association value is not settable !"];
86
- (id)valueInComponent:(WOComponent *)_component {
87
return [_component traversePathArray:self->traversalPath
88
acquire:self->acquire];
91
@end /* SoLookupAssociation */