ROTypeManager

Overview

The general purpose of this class is to provide a facility to create an instance of the class with a given class name. In this sense, it is a kind of substitute for the reflection feature that exists in .NET.
This class is used as a singleton, i.e. only one instance of it should exist during the application life time.
Note:
This class is intended to be used internally and no explicit user operations should be necessary.

Location

 

addType:className:

Establishes the link between the class object of the given class and the class name. Such method calls can be found in the Initialize<Name>Library function in the generated code (see ), if the corresponding RODL file contains definitions of custom types.
If necessary, the registered class will be created with the [[[aClass alloc] init] autorelease] call.

- (void) addType:(id)aClass className:(NSString *)aClassName

Parameters:

  • aClass: The class object to register. The class method is used to get the class object of the class.
  • aClassName: The class name.

addType:className:withActivator:

Having the similar purpose as the above mentioned method, this method allows to register a type activator class to perform custom (more complex) instance creation procedure.

- (void) addType:(id)aClass className:(NSString *)aClassName withActivator:(id)aActivatorClass

Parameters:

  • aClass: The class object to register. The class method is used to get the class object of the class.
  • aClassName: The class name.
  • aActivatorClass: The activator class (ROTypeActivator descendant) responsible for instance creation.

canCreateInstance:

- (BOOL) canCreateInstance:(NSString *)aClassName

Parameters:

  • aClassName:

containsType:

Checks if the class was registered or not. Returns YES if the class with the given name was registered by the addType methods. Otherwise returns NO.

- (BOOL) containsType:(NSString *)aClassName

Parameters:

  • aClassName: The class name to check.

containsTypeActivator:

Checks if the class was registered with the type activator. Returns YES if so, returns NO if the class was registered without the activator or was not registered at all.

- (BOOL) containsTypeActivator:(NSString *)aClassName

Parameters:

  • aClassName: The class name to check.

createExceptionInstance:message:fromServer:

Creates, but doesn't throw an exception with the given exception class name and the given text message.

- (id) createExceptionInstance:(NSString *)aClassName message:(NSString *)iMessage fromServer:(BOOL)iFromServer

Parameters:

  • aClassName: The exception class name to create.
  • iMessage: The text message to be the reason of the exception.
  • iFromServer: This parameter is used to indicate that the exception being created has actually been thrown on the server.

createInstanceOfType:

Creates in instance of the registered class with the given name. The instance will be created directly or by the type activator specified when the class was registered.

- (id) createInstanceOfType:(NSString *)aClassName

Parameters:

  • aClassName: The class name of the instance to create.

enableCache

@property () BOOL enableCache

findCachedType:

- (id) findCachedType:(NSString *)aClassName

Parameters:

  • aClassName:

findEventInvoker:

- (ROEventInvoker *) findEventInvoker:(NSString *)aEventId

Parameters:

  • aEventId:

findTypeActivator:

The method is used to obtain the previously registered type activator for the class object with the given name. Nil is returned if no activator or class with the given name is found.

- (id) findTypeActivator:(NSString *)aClassName

Parameters:

  • aClassName: The class name to find an activator for.

typeManager

Enforces singleton behavior and provides access to the only class instance. The instance is created by this method, if necessary.

+ (ROTypeManager *) typeManager

 

enableCache

@property () BOOL enableCache

 

typeManager

Enforces singleton behavior and provides access to the only class instance. The instance is created by this method, if necessary.

+ (ROTypeManager *) typeManager

 

addType:className:

Establishes the link between the class object of the given class and the class name. Such method calls can be found in the Initialize<Name>Library function in the generated code (see ), if the corresponding RODL file contains definitions of custom types.
If necessary, the registered class will be created with the [[[aClass alloc] init] autorelease] call.

- (void) addType:(id)aClass className:(NSString *)aClassName

Parameters:

  • aClass: The class object to register. The class method is used to get the class object of the class.
  • aClassName: The class name.

addType:className:withActivator:

Having the similar purpose as the above mentioned method, this method allows to register a type activator class to perform custom (more complex) instance creation procedure.

- (void) addType:(id)aClass className:(NSString *)aClassName withActivator:(id)aActivatorClass

Parameters:

  • aClass: The class object to register. The class method is used to get the class object of the class.
  • aClassName: The class name.
  • aActivatorClass: The activator class (ROTypeActivator descendant) responsible for instance creation.

canCreateInstance:

- (BOOL) canCreateInstance:(NSString *)aClassName

Parameters:

  • aClassName:

containsType:

Checks if the class was registered or not. Returns YES if the class with the given name was registered by the addType methods. Otherwise returns NO.

- (BOOL) containsType:(NSString *)aClassName

Parameters:

  • aClassName: The class name to check.

containsTypeActivator:

Checks if the class was registered with the type activator. Returns YES if so, returns NO if the class was registered without the activator or was not registered at all.

- (BOOL) containsTypeActivator:(NSString *)aClassName

Parameters:

  • aClassName: The class name to check.

createExceptionInstance:message:fromServer:

Creates, but doesn't throw an exception with the given exception class name and the given text message.

- (id) createExceptionInstance:(NSString *)aClassName message:(NSString *)iMessage fromServer:(BOOL)iFromServer

Parameters:

  • aClassName: The exception class name to create.
  • iMessage: The text message to be the reason of the exception.
  • iFromServer: This parameter is used to indicate that the exception being created has actually been thrown on the server.

createInstanceOfType:

Creates in instance of the registered class with the given name. The instance will be created directly or by the type activator specified when the class was registered.

- (id) createInstanceOfType:(NSString *)aClassName

Parameters:

  • aClassName: The class name of the instance to create.

findCachedType:

- (id) findCachedType:(NSString *)aClassName

Parameters:

  • aClassName:

findEventInvoker:

- (ROEventInvoker *) findEventInvoker:(NSString *)aEventId

Parameters:

  • aEventId:

findTypeActivator:

The method is used to obtain the previously registered type activator for the class object with the given name. Nil is returned if no activator or class with the given name is found.

- (id) findTypeActivator:(NSString *)aClassName

Parameters:

  • aClassName: The class name to find an activator for.