StanzaFactory class documentation

Authors

Generated by root

Software documentation for the StanzaFactory class

StanzaFactory : NSObject

Declared in:
StanzaFactory.h
The StanzaFactory class is a base class, subclassed to provide iq, presence and message stanza factories. When parsing an XMPP stanza, the classes used to parse the children and the keys with which they should be returned to the parent node are defined in one of these subclasses. The StanzaFactory class should be treated as abstract. Every occurrence of the word 'Value' in this class should be replaced with 'Key' by someone who has some spare time.

Instance Variables

Method summary

sharedStazaFactory 

+ (id) sharedStazaFactory;
Returns the singleton stanza factory.

addHandler: forTag: 

- (void) addHandler: (Class)aHandler forTag: (NSString*)aTag;
Add a handler independent of the key used to return it to the parent.

addHandler: forTag: inNamespace: 

- (void) addHandler: (Class)aHandler forTag: (NSString*)aTag inNamespace: (NSString*)aNamespace;
Add a namespace-specific handler.

addHandler: withValue: forTag: 

- (void) addHandler: (Class)aHandler withValue: (NSString*)aValue forTag: (NSString*)aTag;
Add a handler for a given child tag. When parsing encounters a tag with the specified name, the given class will be instantiated and the value it returns will be passed to the handler identified by aValue.

addHandler: withValue: forTag: inNamespace: 

- (void) addHandler: (Class)aHandler withValue: (NSString*)aValue forTag: (NSString*)aTag inNamespace: (NSString*)aNamespace;
In cases where the same tag exists in a number of namespaces, this variant can be used to differentiate between them.

addValue: forTag: 

- (void) addValue: (NSString*)aValue forTag: (NSString*)aTag;
Set the key used to return a value to the parent, without setting a corresponding handler class.

addValue: forTag: inNamespace: 

- (void) addValue: (NSString*)aValue forTag: (NSString*)aTag inNamespace: (NSString*)aNamespace;
Add a namespace-specific key.

handlerForTag: 

- (Class) handlerForTag: (NSString*)aTag;
Returns the handler for a specified (un-namespaced) XML tag.

handlerForTag: inNamespace: 

- (Class) handlerForTag: (NSString*)aTag inNamespace: (NSString*)aNamespace;
Returns the handler for a specified XML tag in the given namespace.

parser 

- (id) parser;
Always returns nil. Not entirely sure why this is here...

valueForTag: 

- (NSString*) valueForTag: (NSString*)aTag;
Returns the key for a specified XML tag.

valueForTag: inNamespace: 

- (NSString*) valueForTag: (NSString*)aTag inNamespace: (NSString*)aNamespace;
Returns the key for a specified XML tag in the given namespace.



Instance Variables for StanzaFactory Class

namespacedTagHandlers

@protected NSMutableDictionary* namespacedTagHandlers;
Description forthcoming.

namespacedTagValues

@protected NSMutableDictionary* namespacedTagValues;
Description forthcoming.

tagHandlers

@protected NSMutableDictionary* tagHandlers;
Description forthcoming.

tagValues

@protected NSMutableDictionary* tagValues;
Description forthcoming.