#import "enunciate.h" #ifndef DEF_ENUNCIATENS0Persona_M #define DEF_ENUNCIATENS0Persona_M /** * @author Ryan Heaton */ @implementation ENUNCIATENS0Persona /** * (no documentation provided) */ - (NSString *) identifier { return _identifier; } /** * (no documentation provided) */ - (void) setIdentifier: (NSString *) newIdentifier { [newIdentifier retain]; [_identifier release]; _identifier = newIdentifier; } /** * (no documentation provided) */ - (NSString *) email { return _email; } /** * (no documentation provided) */ - (void) setEmail: (NSString *) newEmail { [newEmail retain]; [_email release]; _email = newEmail; } /** * (no documentation provided) */ - (NSString *) alias { return _alias; } /** * (no documentation provided) */ - (void) setAlias: (NSString *) newAlias { [newAlias retain]; [_alias release]; _alias = newAlias; } /** * (no documentation provided) */ - (NSArray *) groups { return _groups; } /** * (no documentation provided) */ - (void) setGroups: (NSArray *) newGroups { [newGroups retain]; [_groups release]; _groups = newGroups; } /** * (no documentation provided) */ - (ENUNCIATENS0Name *) name { return _name; } /** * (no documentation provided) */ - (void) setName: (ENUNCIATENS0Name *) newName { [newName retain]; [_name release]; _name = newName; } /** * (no documentation provided) */ - (NSData *) picture { return _picture; } /** * (no documentation provided) */ - (void) setPicture: (NSData *) newPicture { [newPicture retain]; [_picture release]; _picture = newPicture; } - (void) dealloc { [self setIdentifier: nil]; [self setEmail: nil]; [self setAlias: nil]; [self setGroups: nil]; [self setName: nil]; [self setPicture: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { ENUNCIATENS0Persona *_eNUNCIATENS0Persona; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _eNUNCIATENS0Persona = (ENUNCIATENS0Persona *) [ENUNCIATENS0Persona readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _eNUNCIATENS0Persona; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation ENUNCIATENS0Persona */ /** * Internal, private interface for JAXB reading and writing. */ @interface ENUNCIATENS0Persona (JAXB) @end /*interface ENUNCIATENS0Persona (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation ENUNCIATENS0Persona (JAXB) /** * Read an instance of ENUNCIATENS0Persona from an XML reader. * * @param reader The reader. * @return An instance of ENUNCIATENS0Persona defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { ENUNCIATENS0Persona *_eNUNCIATENS0Persona = [[ENUNCIATENS0Persona alloc] init]; NS_DURING { [_eNUNCIATENS0Persona initWithReader: reader]; } NS_HANDLER { _eNUNCIATENS0Persona = nil; [localException raise]; } NS_ENDHANDLER [_eNUNCIATENS0Persona autorelease]; return _eNUNCIATENS0Persona; } /** * Initialize this instance of ENUNCIATENS0Persona according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of ENUNCIATENS0Persona to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a ENUNCIATENS0Persona from an XML reader. The element to be read is * "persona". * * @param reader The XML reader. * @return The ENUNCIATENS0Persona. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; ENUNCIATENS0Persona *_persona = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element persona."]; } } if (xmlStrcmp(BAD_CAST "persona", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}persona."); #endif _persona = (ENUNCIATENS0Persona *)[ENUNCIATENS0Persona readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}persona."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read ENUNCIATENS0Persona. Expected element persona. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read ENUNCIATENS0Persona. Expected element persona. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _persona; } /** * Writes this ENUNCIATENS0Persona to XML under element name "persona". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _persona The Persona to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this ENUNCIATENS0Persona to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "persona", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}persona. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}persona for root element {}persona..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}persona for root element {}persona..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}persona. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}id of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}id of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setIdentifier: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "email", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}email of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}email of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setEmail: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "alias", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}alias of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}alias of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAlias: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "groups", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}groups of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}groups of type {http://www.w3.org/2001/XMLSchema}string."); #endif if ([self groups]) { [self setGroups: [[self groups] arrayByAddingObject: __child]]; } else { [self setGroups: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}name of type {}name."); #endif __child = [ENUNCIATENS0Name readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}name of type {}name."); #endif [self setName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "picture", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}picture of type {http://www.w3.org/2001/XMLSchema}base64Binary."); #endif __child = [NSData readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}picture of type {http://www.w3.org/2001/XMLSchema}base64Binary."); #endif [self setPicture: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self identifier]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "id", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}id."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}id..."); #endif [[self identifier] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}id..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}id."]; } } if ([self email]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "email", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}email."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}email..."); #endif [[self email] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}email..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}email."]; } } if ([self alias]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "alias", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}alias."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}alias..."); #endif [[self alias] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}alias..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}alias."]; } } if ([self groups]) { __enumerator = [[self groups] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "groups", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}groups."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}groups..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}groups..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}groups."]; } } //end item iterator. } if ([self name]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}name."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}name..."); #endif [[self name] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}name..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}name."]; } } if ([self picture]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "picture", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}picture."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}picture..."); #endif [[self picture] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}picture..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}picture."]; } } } @end /* implementation ENUNCIATENS0Persona (JAXB) */ #endif /* DEF_ENUNCIATENS0Persona_M */ #ifndef DEF_ENUNCIATENS0Name_M #define DEF_ENUNCIATENS0Name_M /** * @author Ryan Heaton */ @implementation ENUNCIATENS0Name /** * (no documentation provided) */ - (NSString *) givenName { return _givenName; } /** * (no documentation provided) */ - (void) setGivenName: (NSString *) newGivenName { [newGivenName retain]; [_givenName release]; _givenName = newGivenName; } /** * (no documentation provided) */ - (NSString *) surname { return _surname; } /** * (no documentation provided) */ - (void) setSurname: (NSString *) newSurname { [newSurname retain]; [_surname release]; _surname = newSurname; } - (void) dealloc { [self setGivenName: nil]; [self setSurname: nil]; [super dealloc]; } @end /* implementation ENUNCIATENS0Name */ /** * Internal, private interface for JAXB reading and writing. */ @interface ENUNCIATENS0Name (JAXB) @end /*interface ENUNCIATENS0Name (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation ENUNCIATENS0Name (JAXB) /** * Read an instance of ENUNCIATENS0Name from an XML reader. * * @param reader The reader. * @return An instance of ENUNCIATENS0Name defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { ENUNCIATENS0Name *_eNUNCIATENS0Name = [[ENUNCIATENS0Name alloc] init]; NS_DURING { [_eNUNCIATENS0Name initWithReader: reader]; } NS_HANDLER { _eNUNCIATENS0Name = nil; [localException raise]; } NS_ENDHANDLER [_eNUNCIATENS0Name autorelease]; return _eNUNCIATENS0Name; } /** * Initialize this instance of ENUNCIATENS0Name according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of ENUNCIATENS0Name to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "givenName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}givenName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}givenName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setGivenName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "surname", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}surname of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}surname of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSurname: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self givenName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "givenName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}givenName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}givenName..."); #endif [[self givenName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}givenName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}givenName."]; } } if ([self surname]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "surname", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}surname."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}surname..."); #endif [[self surname] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}surname..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}surname."]; } } } @end /* implementation ENUNCIATENS0Name (JAXB) */ #endif /* DEF_ENUNCIATENS0Name_M */ #ifndef DEF_ENUNCIATENS0SocialGroup_M #define DEF_ENUNCIATENS0SocialGroup_M /** * @author Ryan Heaton */ @implementation ENUNCIATENS0SocialGroup /** * (no documentation provided) */ - (NSString *) identifier { return _identifier; } /** * (no documentation provided) */ - (void) setIdentifier: (NSString *) newIdentifier { [newIdentifier retain]; [_identifier release]; _identifier = newIdentifier; } /** * (no documentation provided) */ - (NSArray *) memberIds { return _memberIds; } /** * (no documentation provided) */ - (void) setMemberIds: (NSArray *) newMemberIds { [newMemberIds retain]; [_memberIds release]; _memberIds = newMemberIds; } /** * (no documentation provided) */ - (NSString *) groupLeaderId { return _groupLeaderId; } /** * (no documentation provided) */ - (void) setGroupLeaderId: (NSString *) newGroupLeaderId { [newGroupLeaderId retain]; [_groupLeaderId release]; _groupLeaderId = newGroupLeaderId; } /** * (no documentation provided) */ - (BOOL) exclusive { return _exclusive; } /** * (no documentation provided) */ - (void) setExclusive: (BOOL) newExclusive { _exclusive = newExclusive; } - (void) dealloc { [self setIdentifier: nil]; [self setMemberIds: nil]; [self setGroupLeaderId: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { ENUNCIATENS0SocialGroup *_eNUNCIATENS0SocialGroup; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _eNUNCIATENS0SocialGroup = (ENUNCIATENS0SocialGroup *) [ENUNCIATENS0SocialGroup readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _eNUNCIATENS0SocialGroup; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation ENUNCIATENS0SocialGroup */ /** * Internal, private interface for JAXB reading and writing. */ @interface ENUNCIATENS0SocialGroup (JAXB) @end /*interface ENUNCIATENS0SocialGroup (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation ENUNCIATENS0SocialGroup (JAXB) /** * Read an instance of ENUNCIATENS0SocialGroup from an XML reader. * * @param reader The reader. * @return An instance of ENUNCIATENS0SocialGroup defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { ENUNCIATENS0SocialGroup *_eNUNCIATENS0SocialGroup = [[ENUNCIATENS0SocialGroup alloc] init]; NS_DURING { [_eNUNCIATENS0SocialGroup initWithReader: reader]; } NS_HANDLER { _eNUNCIATENS0SocialGroup = nil; [localException raise]; } NS_ENDHANDLER [_eNUNCIATENS0SocialGroup autorelease]; return _eNUNCIATENS0SocialGroup; } /** * Initialize this instance of ENUNCIATENS0SocialGroup according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of ENUNCIATENS0SocialGroup to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a ENUNCIATENS0SocialGroup from an XML reader. The element to be read is * "socialGroup". * * @param reader The XML reader. * @return The ENUNCIATENS0SocialGroup. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; ENUNCIATENS0SocialGroup *_socialGroup = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element socialGroup."]; } } if (xmlStrcmp(BAD_CAST "socialGroup", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}socialGroup."); #endif _socialGroup = (ENUNCIATENS0SocialGroup *)[ENUNCIATENS0SocialGroup readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}socialGroup."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read ENUNCIATENS0SocialGroup. Expected element socialGroup. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read ENUNCIATENS0SocialGroup. Expected element socialGroup. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _socialGroup; } /** * Writes this ENUNCIATENS0SocialGroup to XML under element name "socialGroup". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _socialGroup The SocialGroup to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this ENUNCIATENS0SocialGroup to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "socialGroup", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}socialGroup. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}socialGroup for root element {}socialGroup..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}socialGroup for root element {}socialGroup..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}socialGroup. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}id of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}id of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setIdentifier: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "memberIds", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}memberIds of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}memberIds of type {http://www.w3.org/2001/XMLSchema}string."); #endif if ([self memberIds]) { [self setMemberIds: [[self memberIds] arrayByAddingObject: __child]]; } else { [self setMemberIds: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "groupLeaderId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}groupLeaderId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}groupLeaderId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setGroupLeaderId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "exclusive", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setExclusive: *((BOOL*) _child_accessor)]; free(_child_accessor); return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self identifier]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "id", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}id."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}id..."); #endif [[self identifier] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}id..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}id."]; } } if ([self memberIds]) { __enumerator = [[self memberIds] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "memberIds", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}memberIds."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}memberIds..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}memberIds..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}memberIds."]; } } //end item iterator. } if ([self groupLeaderId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "groupLeaderId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}groupLeaderId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}groupLeaderId..."); #endif [[self groupLeaderId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}groupLeaderId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}groupLeaderId."]; } } if (YES) { //always write the primitive element... status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "exclusive", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}exclusive."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}exclusive..."); #endif status = xmlTextWriterWriteBooleanType(writer, &_exclusive); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}exclusive..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}exclusive."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}exclusive."]; } } } @end /* implementation ENUNCIATENS0SocialGroup (JAXB) */ #endif /* DEF_ENUNCIATENS0SocialGroup_M */