Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

< JDCSVParserDelegate > Protocol Reference

#import <JDCSVParserDelegate.h>

Inheritance diagram for < JDCSVParserDelegate >:

JDCSVStringDictionaryFactory JDCSVXMLFactory List of all members.

Public Member Functions

(void) - parserStartDocument:
(void) - parserEndDocument:
(NSObject *) - parserBuildNewRecord:
(NSObject *) - parser:buildRecordKey:
(void) - parser:populateField:forRecordKey:inRecord:
(void) - parser:closeRecord:
(void) - parser:fatalErrorRaised:

Detailed Description

Author:
Jeff Disher
Date:
2012-05-19
The concrete protocol which must be implemented by objects used as factories for the CSV parser.


Member Function Documentation

- (NSObject *) parser: (JDCSVParseMachine *)  parser
buildRecordKey: (NSString *)  rawValue
 
 

Parameters:
parser The parsing maching making the callback
rawValue The key read from the column for field at index
Returns:
an opaque, non-nil key which will be passed back to the factory whenever the parser reads data in this column
Called by the parser when it encounters a column heading in the beginning of the document so that the factory knows which key should be applied to the fields under it

- (void) parser: (JDCSVParseMachine *)  parser
closeRecord: (NSObject *)  record
 
 

Parameters:
parser The parsing maching making the callback
record The record which is now complete and will no longer be written into by the parser
Called when the parser is finished parsing one record

- (void) parser: (JDCSVParseMachine *)  parser
fatalErrorRaised: (NSString *)  errorMsg
 
 

Parameters:
parser The parsing maching making the callback
errorMsg The message produced by the parser when an error is encountered
Called by the parser when a fatal error is encountered during a parse operation

- (void) parser: (JDCSVParseMachine *)  parser
populateField: (NSString *)  rawValue
forRecordKey: (NSObject *)  recordKey
inRecord: (NSObject *)  recordToken
 
 

Parameters:
parser The parsing maching making the callback
rawValue The string read for the field
recordKey The key created by buildRecordKey: which resolves this field in the recordToken record
recordToken The opaque token representing the record into which this field should be stored
Called by the parser to ask the factory to populate the field for recordKey in recordToken with the data in rawValue

- (NSObject *) parserBuildNewRecord: (JDCSVParseMachine *)  parser  
 

Parameters:
parser The parsing maching making the callback
Returns:
An opaque, non-nil token which will be passed back to the factory whenever the record is to be manipulated
Called by the parser when it encounters the beginning of a new record in the input stream. Allows the factory to create any new meta-data structures to back the information which is about to be read.

- (void) parserEndDocument: (JDCSVParseMachine *)  parser  
 

Parameters:
parser The parsing maching making the callback
Called once at the end of a parse job perfromed by the parser so that the factory can shut down, write back data, etc

- (void) parserStartDocument: (JDCSVParseMachine *)  parser  
 

Parameters:
parser The parsing maching making the callback
Called once at the beginning of a parse job being performed by the parser so that the factory can initialize internal state, etc


The documentation for this protocol was generated from the following file:
Generated on Sun Jun 10 16:41:27 2012 for JDCSVParser by  doxygen 1.4.3