XMLToObjectParser Class Reference

#import <XMLToObjectParser.h>

Collaboration diagram for XMLToObjectParser:

Collaboration graph
[legend]

Public Member Functions

(NSArray *) - items
(id) - parseXMLAtURL:fromNodeName:toObject:parseError:
 Parses the XML document returned from the given URL into an array of instances of the named class.
(id) - parseXMLData:fromNodeName:toObject:parseError:
 Parses the XML contained in the given data object into an array of instances of the named class.

Protected Attributes

NSStringnodeName
 Name of the target XML node(s) to be converted to object(s).
NSStringclassName
 Name of the Obj-C class to be instantiated for each matched XML node.
NSMutableArray * items
 Array of objects created from the XML data.
NSObject * item
 Object being populated during XML parsing; an instance of the given className.
NSStringcurrentNodeName
 Name of the current XML node; used during parsing.
NSMutableString * currentNodeContent
 Mutable string that collects the contents of the current XML node; used during parsing.
NSMutableDictionary * dropioErrorUserInfo
 Dictionary containing Drop.io error properties; used as NSError.userInfo.

Properties

NSError * dropioError
 NSError object describing the Drop.io error, if an error occurs during XML parsing.

Member Function Documentation

- (NSArray *) items  

- (id) parseXMLAtURL: (NSURL *)  url
fromNodeName: (NSString *)  aNodeName
toObject: (NSString *)  aClassName
parseError: (NSError **)  pError 

Parses the XML document returned from the given URL into an array of instances of the named class.

One instance is created for each XML node that matches the given node name. The named class must define properties whose names match the child XML nodes of the named target XML nodes when converted to "camelCase", or else it must implement setValue:forUndefinedKey:.

Parameters:
url NSURL of the XML document to be parsed.
aNodeName NSString containing the name of XML nodes to be matched in the XML document.
aClassName NSString containing the name of an NSObject subclass that will be instantiated once for each matched XML node in the XML document.
pError Output parameter pointing to an NSError object on return if any errors occur while loading and parsing the XML document. Pass nil to ignore errors.
Returns:
id of the XMLToObjectParser.

Referenced by DropIO::parseResponseFromURL:fromNodeName:toObject:parseError:.

- (id) parseXMLData: (NSData *)  data
fromNodeName: (NSString *)  aNodeName
toObject: (NSString *)  aClassName
parseError: (NSError **)  pError 

Parses the XML contained in the given data object into an array of instances of the named class.

One instance is created for each XML node that matches the given node name. The named class must define properties whose names match the child XML nodes of the named target XML nodes when converted to "camelCase", or else it must implement setValue:forUndefinedKey:.

Parameters:
data NSData object containing the XML data to be parsed.
aNodeName NSString containing the name of XML nodes to be matched in the XML data.
aClassName NSString containing the name of an NSObject subclass that will be instantiated once for each matched XML node in the XML data.
pError Output parameter pointing to an NSError object on return if any errors occur while loading and parsing the XML data. Pass nil to ignore errors.
Returns:
id of the XMLToObjectParser.

Referenced by DropIO::parseResponse:fromNodeName:toObject:parseError:, and parseXMLAtURL:fromNodeName:toObject:parseError:.


Field Documentation

- (NSString*) className [protected]

Name of the Obj-C class to be instantiated for each matched XML node.

Referenced by parseXMLData:fromNodeName:toObject:parseError:.

- (NSMutableString*) currentNodeContent [protected]

Mutable string that collects the contents of the current XML node; used during parsing.

- (NSString*) currentNodeName [protected]

Name of the current XML node; used during parsing.

- (NSMutableDictionary*) dropioErrorUserInfo [protected]

Dictionary containing Drop.io error properties; used as NSError.userInfo.

Referenced by parseXMLData:fromNodeName:toObject:parseError:.

- (NSObject*) item [protected]

Object being populated during XML parsing; an instance of the given className.

- (NSArray *) items [protected]

- (NSString*) nodeName [protected]

Name of the target XML node(s) to be converted to object(s).

Referenced by parseXMLData:fromNodeName:toObject:parseError:.


Property Documentation

- (NSError *) dropioError [read, write, retain]

NSError object describing the Drop.io error, if an error occurs during XML parsing.


The documentation for this class was generated from the following files:

Generated on Thu May 21 13:52:19 2009 for DropKit by  doxygen 1.5.8