Inherits from NSObject
Declared in GBHTMLTemplateVariablesProvider.h
GBHTMLTemplateVariablesProvider.m

Overview

Provides variables for HTML template string for given objects.

The main purpose of this class is to prepare an intermediate variables from given objects suitable for template generation. Although original object could easily be used within templates, using simplified, intermediate, form greatly simplifies template files. Think of the variables as the controlley layer for the template engine.

This class is intended to be reused, create a single instance and pass it the objects - one by one - for which you'd like to get template variables.

Tasks

Initialization & disposal

Variables handling

Class Methods

providerWithSettingsProvider:

Returns autoreleased provider that work with the given GBApplicationSettingsProvider implementor.

+ (id)providerWithSettingsProvider:(id)settingsProvider

Parameters

settingsProvider
Application-wide settings provider to use for checking parameters.

Return Value

Returns initialized instance or nil if initialization fails.

Exceptions

NSException
Thrown if the given application is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

Instance Methods

initWithSettingsProvider:

Initializes the provider to work with the given GBApplicationSettingsProvider implementor.

- (id)initWithSettingsProvider:(id)settingsProvider

Parameters

settingsProvider
Application-wide settings provider to use for checking parameters.

Return Value

Returns initialized instance or nil if initialization fails.

Discussion

This is the designated initializer.

Exceptions

NSException
Thrown if the given application is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

variablesForCategory:withStore:

Returns the variables for the given GBCategoryData using the given GBStore for links.

- (NSDictionary *)variablesForCategory:(GBCategoryData *)object withStore:(id)store

Parameters

object
The category for which to return variables.
store
Store provider to be used for links generation.

Return Value

Returns dictionary of all variables

Discussion

The result can be used with GBTemplateHandler to generate category specific output.

Exceptions

NSException
Thrown if the given object or store is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

variablesForClass:withStore:

Returns the variables for the given GBClassData using the given GBStore for links.

- (NSDictionary *)variablesForClass:(GBClassData *)object withStore:(id)store

Parameters

object
The class for which to return variables.
store
Store provider to be used for links generation.

Return Value

Returns dictionary of all variables

Discussion

The result can be used with GBTemplateHandler to generate class specific output.

Exceptions

NSException
Thrown if the given object or store is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

variablesForHierarchyWithStore:

Returns the variables for the hierarchy file using the given GBStore for links.

- (NSDictionary *)variablesForHierarchyWithStore:(id)store

Parameters

store
Store provider to be used for links generation.

Return Value

Returns dictionary of all variables.

Discussion

The result can be used with GBTemplateHandler to generate protocol specific output.

Exceptions

NSException
Thrown if the given object or store is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

variablesForIndexWithStore:

Returns the variables for the index file using the given GBStore for links.

- (NSDictionary *)variablesForIndexWithStore:(id)store

Parameters

store
Store provider to be used for links generation.

Return Value

Returns dictionary of all variables

Discussion

The result can be used with GBTemplateHandler to generate protocol specific output.

Exceptions

NSException
Thrown if the given object or store is nil.

Declared In

GBHTMLTemplateVariablesProvider.h

variablesForProtocol:withStore:

Returns the variables for the given GBProtocolData using the given GBStore for links.

- (NSDictionary *)variablesForProtocol:(GBProtocolData *)object withStore:(id)store

Parameters

object
The protocol for which to return variables.
store
Store provider to be used for links generation.

Return Value

Returns dictionary of all variables

Discussion

The result can be used with GBTemplateHandler to generate protocol specific output.

Exceptions

NSException
Thrown if the given object or store is nil.

Declared In

GBHTMLTemplateVariablesProvider.h