Used to implement exception handling (creating & raising). More...
#import <CPException.h>
Inheritance diagram for CPException:Class Methods | |
| (id) | + alloc |
| (CPException) | + exceptionWithName:reason:userInfo: |
| (void) | + raise:format: |
| (void) | + raise:reason: |
Class Methods inherited from CPObject | |
| (BOOL) | + accessInstanceVariablesDirectly |
| (id) | + allocWithCoder: |
| (BOOL) | + automaticallyNotifiesObserversForKey: |
| (void) | + cancelPreviousPerformRequestsWithTarget: |
| (void) | + cancelPreviousPerformRequestsWithTarget:selector:object: |
| (Class) | + class |
| (BOOL) | + conformsToProtocol: |
| (void) | + exposeBinding: |
| (void) | + initialize |
| (IMP) | + instanceMethodForSelector: |
| (BOOL) | + instancesImplementSelector: |
| (BOOL) | + instancesRespondToSelector: |
| (BOOL) | + isBindingExclusive: |
| (BOOL) | + isSubclassOfClass: |
| (CPSet) | + keyPathsForValuesAffectingValueForKey: |
| (void) | + load |
| (id) | + new |
| (void) | + object:performSelector:withObject:afterDelay:inModes: |
| (void) | + setVersion: |
| (Class) | + superclass |
| (int) | + version |
Instance Variables | |
| CPString | message |
| CPString | name |
Used to implement exception handling (creating & raising).
An example of throwing an exception in Objective-J:
// some code here...
if (input == nil)
[CPException raise:"MyException" reason:"You didn't do something right."];// code that gets executed if no exception was raised
Definition at line 2 of file CPException.h.
|
implementation |
Allocates a new instance of the receiving class
Reimplemented from CPObject.
Definition at line 54 of file CPException.j.
|
implementation |
Makes a deep copy of the receiver. The copy should be functionally equivalent to the receiver.
Reimplemented from CPObject.
Provided by category CPException(CPCopying).
Definition at line 175 of file CPException.j.
|
implementation |
Returns the exception's reason.
Reimplemented from CPObject.
Definition at line 147 of file CPException.j.
|
implementation |
Encodes the exception's data into a coder.
| aCoder | the coder to which the data will be written |
Provided by category CPException(CPCoding).
Definition at line 209 of file CPException.j.
|
implementation |
Creates an exception with a name, reason and user info.
| aName | the name of the exception |
| aReason | the reason the exception occurred |
| aUserInfo | a dictionary containing information about the exception |
Definition at line 94 of file CPException.j.
|
implementation |
Initializes the exception with data from a coder.
| aCoder | the coder from which to read the exception data |
Provided by category CPException(CPCoding).
Definition at line 193 of file CPException.j.
|
implementation |
Initializes the exception.
| aName | the name of the exception |
| aReason | the reason for the exception |
| aUserInfo | a dictionary containing information about the exception |
Definition at line 106 of file CPException.j.
|
implementation |
Determines if anObject is functionally equivalent to the receiver.
YES if anObject is functionally equivalent to the receiver. Reimplemented from CPObject.
Definition at line 160 of file CPException.j.
|
implementation |
Raises the exception and causes the program to go to the exception handler.
Definition at line 155 of file CPException.j.
Raises an exception with a name and a formatted reason.
| aName | the name of the exception to raise |
| aFormat | the reason for the exception in sprintf style |
| ... | the arguments for the sprintf format |
Definition at line 77 of file CPException.j.
Raises an exception with a name and reason.
| aName | the name of the exception to raise |
| aReason | the reason for the exception |
Definition at line 66 of file CPException.j.
|
implementation |
Returns the reason for the exception.
Definition at line 131 of file CPException.j.
|
implementation |
Returns data containing info about the receiver.
Definition at line 139 of file CPException.j.
|
protected |
Definition at line 6 of file CPException.h.
|
protected |
Returns the name of the exception.
Definition at line 5 of file CPException.h.