Couchbase Lite
Objective-C API for iOS and Mac OS
CBLModelFactory.h
Go to the documentation of this file.
1 //
2 // CBLModelFactory.h
3 // CouchbaseLite
4 //
5 // Created by Jens Alfke on 11/22/11.
6 // Copyright (c) 2011-2013 Couchbase, Inc. All rights reserved.
7 //
8 
9 #import "CBLDatabase.h"
10 @class CBLDocument;
11 
13 
16 @interface CBLModelFactory : NSObject
17 
20 + (instancetype) sharedInstance;
21 
26 - (id) modelForDocument: (CBLDocument*)document;
27 
35 - (void) registerClass: (id)classOrName
36  forDocumentType: (NSString*)type;
37 
40 - (nullable Class) classForDocument: (CBLDocument*)document;
41 
43 - (nullable Class) classForDocumentType: (NSString*)type;
44 
47 - (nullable NSString*) documentTypeForClass: (Class)modelClass;
48 
50 - (CBLArrayOf(NSString*)*) documentTypesForClass: (Class)modelClass;
51 
52 @end
53 
54 
56 
59 @property (retain, nullable) CBLModelFactory* modelFactory;
60 
61 @end
62 
63 
#define NS_ASSUME_NONNULL_BEGIN
Definition: CBLBase.h:20
A configurable mapping from CBLDocument to CBLModel.
Definition: CBLModelFactory.h:16
#define nullable
Definition: CBLBase.h:22
A CouchbaseLite document (as opposed to any specific revision of it.)
Definition: CBLDocument.h:16
instancetype sharedInstance()
Returns a global shared CBLModelFactory that's consulted by all databases.
#define NS_ASSUME_NONNULL_END
Definition: CBLBase.h:21
CBLArrayOf(NSNumber *) *CBLGeoPointToCoordPair(CBLGeoPoint pt)
Converts a point to a JSON-compatible array of two coordinates.
Definition: CBLModelFactory.h:55