Files
RestKit/Code/ObjectMapping/RKParserRegistry.h
Blake Watters f3c0995d5e Implementation of Object Mapping 2.0 design:
* Removed RestKit from inheritance hierarchy
  * Mappings are implemented as concrete classes
  * Mapper is much more flexible & powerful
  * Much more robust error handling
  * Serialization is reimplemented as an object mapping operation
  * Added ability to serialize to JSON natively
  * Reworked Core Data integration
  * Simplified the codebase substantially
2011-06-11 19:26:56 -04:00

49 lines
1.3 KiB
Objective-C

//
// RKParserRegistry.h
// RestKit
//
// Created by Blake Watters on 5/18/11.
// Copyright 2011 Two Toasters. All rights reserved.
//
#import "../Support/RKMIMETypes.h"
#import "../Support/RKParser.h"
/**
The Parser Registry provides for the registration of RKParser classes
for a particular MIME Type. This enables
*/
@interface RKParserRegistry : NSObject {
NSMutableDictionary* _MIMETypeToParserClasses;
}
/**
Return the global shared singleton registry for MIME Type to Parsers
*/
+ (RKParserRegistry*)sharedRegistry;
/**
Instantiate and return a Parser for the given MIME Type
*/
- (id<RKParser>)parserForMIMEType:(NSString*)MIMEType;
/**
Return the class registered for handling parser/encoder operations
for a given MIME Type
*/
- (Class<RKParser>)parserClassForMIMEType:(NSString*)MIMEType;
/**
Registers an RKParser conformant class as the handler for the specified MIME Type
*/
- (void)setParserClass:(Class<RKParser>)parserClass forMIMEType:(NSString*)MIMEType;
/**
Automatically configure the registry via run-time reflection of the RKParser classes
available that ship with RestKit. This happens automatically when the shared registry
singleton is initialized and makes configuration transparent to users.
*/
- (void)autoconfigure;
@end