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 #ifndef __SaxObjC_SaxObjectModel_H__
23 #define __SaxObjC_SaxObjectModel_H__
25 #import <Foundation/NSObject.h>
27 @class NSDictionary, NSString, NSArray;
30 @interface SaxObjectModel : NSObject
32 NSDictionary *nsToModel;
35 + (id)modelWithName:(NSString *)_name;
36 + (id)modelWithContentsOfFile:(NSString *)_path;
38 - (id)initWithDictionary:(NSDictionary *)_dict;
42 - (SaxTagModel *)modelForTag:(NSString *)_localName namespace:(NSString *)_ns;
46 @interface SaxNamespaceModel : NSObject
48 NSDictionary *tagToModel;
53 - (SaxTagModel *)modelForTag:(NSString *)_localName;
57 @interface SaxTagModel : NSObject
61 NSString *tagKey; /* the key to store the tag name under */
62 NSString *namespaceKey; /* the key to store the namespace uri under */
63 NSString *parentKey; /* the key to store the parent object under */
64 NSString *contentKey; /* the key to store the cdata content under */
65 NSArray *toManyRelationshipKeys;
66 NSDictionary *defaultValues;
67 NSDictionary *tagToKey;
68 NSDictionary *attrToKey;
73 - (NSString *)className;
76 - (NSString *)namespaceKey;
77 - (NSString *)parentKey;
78 - (NSString *)contentKey;
79 - (NSDictionary *)defaultValues;
81 - (NSString *)propertyKeyForChildTag:(NSString *)_tag;
83 - (BOOL)isToManyKey:(NSString *)_key;
84 - (NSArray *)toManyRelationshipKeys;
86 - (NSArray *)attributeKeys;
87 - (NSString *)propertyKeyForAttribute:(NSString *)_attr;
89 /* object operations */
91 - (void)addValue:(id)_val toPropertyWithKey:(NSString *)_key ofObject:(id)_obj;
95 #endif /* __SaxObjC_SaxObjectModel_H__ */