2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __SaxObjC_SaxObjectModel_H__
24 #define __SaxObjC_SaxObjectModel_H__
26 #import <Foundation/NSObject.h>
28 @class NSDictionary, NSString, NSArray;
31 @interface SaxObjectModel : NSObject
33 NSDictionary *nsToModel;
36 + (id)modelWithName:(NSString *)_name;
37 + (id)modelWithContentsOfFile:(NSString *)_path;
39 - (id)initWithDictionary:(NSDictionary *)_dict;
43 - (SaxTagModel *)modelForTag:(NSString *)_localName namespace:(NSString *)_ns;
47 @interface SaxNamespaceModel : NSObject
49 NSDictionary *tagToModel;
54 - (SaxTagModel *)modelForTag:(NSString *)_localName;
58 @interface SaxTagModel : NSObject
62 NSString *tagKey; /* the key to store the tag name under */
63 NSString *namespaceKey; /* the key to store the namespace uri under */
64 NSString *parentKey; /* the key to store the parent object under */
65 NSString *contentKey; /* the key to store the cdata content under */
66 NSArray *toManyRelationshipKeys;
67 NSDictionary *defaultValues;
68 NSDictionary *tagToKey;
69 NSDictionary *attrToKey;
74 - (NSString *)className;
77 - (NSString *)namespaceKey;
78 - (NSString *)parentKey;
79 - (NSString *)contentKey;
80 - (NSDictionary *)defaultValues;
82 - (NSString *)propertyKeyForChildTag:(NSString *)_tag;
84 - (BOOL)isToManyKey:(NSString *)_key;
85 - (NSArray *)toManyRelationshipKeys;
87 - (NSArray *)attributeKeys;
88 - (NSString *)propertyKeyForAttribute:(NSString *)_attr;
90 /* object operations */
92 - (void)addValue:(id)_val toPropertyWithKey:(NSString *)_key ofObject:(id)_obj;
96 #endif /* __SaxObjC_SaxObjectModel_H__ */