GBModelBase Class Reference
Inherits from | NSObject |
Declared in | GBModelBase.h GBModelBase.m |
Tasks
Declared files handling
-
– registerSourceInfo:
Registers the givenGBSourceInfo
tosourceInfos
list. -
– sourceInfosSortedByName
Returns the array of allsourceInfos
sorted by file name. -
prefferedSourceInfo
Returns the preffered source info that should be rendered to output. property -
sourceInfos
The list of all declared file data asGBSourceInfo
objects. property
Comments handling
-
comment
The comment associated with this object ornil
if no comment is associated. property
Data handling
-
– mergeDataFromObject:
Merges all data from the given object.
Hierarchy handling
-
parentObject
Object's parent object ornil
if object has no parent. property -
isTopLevelObject
Specifies whether this is a top level object or not. property
Output generation helpers
-
htmlLocalReference
Returns the HTML reference for the object that can be used within the same HTML file. property -
htmlReferenceName
Returns the HTML reference name of the object that can be used as an anchor to link against. property
Properties
comment
The comment associated with this object or nil
if no comment is associated.
@property (retain) GBComment *comment
Declared In
GBModelBase.h
htmlLocalReference
Returns the HTML reference for the object that can be used within the same HTML file.
@property (copy) NSString *htmlLocalReference
Discussion
This is simply a wrapper over [GBApplicationSettingsProvider htmlReferenceForObject:fromSource:]
, passing the given object as both method arguments. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
See Also
Declared In
GBModelBase.h
htmlReferenceName
Returns the HTML reference name of the object that can be used as an anchor to link against.
@property (copy) NSString *htmlReferenceName
Discussion
This is simply a wrapper over [GBApplicationSettingsProvider htmlReferenceNameForObject:]
, passing the given object as the method argument. The major reason for introducing this method is the ability to reference it from the output templates! In this way all knowledge about references is handled in a single point and doesn't have to be repeated in various places.
See Also
Declared In
GBModelBase.h
isTopLevelObject
Specifies whether this is a top level object or not.
@property (readonly) BOOL isTopLevelObject
Discussion
Top level objects are classes, categories and protocols.
Declared In
GBModelBase.h
parentObject
Object's parent object or nil
if object has no parent.
@property (retain) id parentObject
Discussion
This is mostly used for more in-context logging messages.
Declared In
GBModelBase.h
prefferedSourceInfo
Returns the preffered source info that should be rendered to output.
@property (readonly) GBSourceInfo *prefferedSourceInfo
Return Value
Returns preffered source information object to be used for output.
Discussion
This investigates sourceInfos
list and comment
and returns the most likely used one. If comment is given and has source information attached, that one is used. If comment is not given, source information list from the receiver is used. If header file is found in the list, that one is preffered. If header file is not found, the first file is returned.
Declared In
GBModelBase.h
Instance Methods
mergeDataFromObject:
Merges all data from the given object.
- (void)mergeDataFromObject:(id)source
Parameters
- source
- Source object to merge from.
Discussion
Source object is left unchanged. If the same object is passed in, nothing happens. Subclasses should override and add their own specifics, however they should send super object the message as well! Here's overriden method example:
- (void)mergeDataFromObject:(GBModelBase *)source { // source data validation here... [super mergeDataFromObject:source]; // merge custom data here... }
Declared In
GBModelBase.h
registerSourceInfo:
Registers the given GBSourceInfo
to sourceInfos
list.
- (void)registerSourceInfo:(GBSourceInfo *)data
Parameters
- data
- Source information data.
Discussion
If file data with the same filename already exists in the set, it is replaced with the given one.
Exceptions
- NSException
- Thrown if the given filename is
nil
or empty.
Declared In
GBModelBase.h