#import "novaglobalapi.h" #ifndef DEF_NOVAGLOBALAPINS0CountryTaxDto_M #define DEF_NOVAGLOBALAPINS0CountryTaxDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0CountryTaxDto /** * (no documentation provided) */ - (NSString *) countryCode { return _countryCode; } /** * (no documentation provided) */ - (void) setCountryCode: (NSString *) newCountryCode { [newCountryCode retain]; [_countryCode release]; _countryCode = newCountryCode; } /** * (no documentation provided) */ - (NSDecimalNumber *) taxValue { return _taxValue; } /** * (no documentation provided) */ - (void) setTaxValue: (NSDecimalNumber *) newTaxValue { [newTaxValue retain]; [_taxValue release]; _taxValue = newTaxValue; } - (void) dealloc { [self setCountryCode: nil]; [self setTaxValue: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0CountryTaxDto *_nOVAGLOBALAPINS0CountryTaxDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0CountryTaxDto = (NOVAGLOBALAPINS0CountryTaxDto *) [NOVAGLOBALAPINS0CountryTaxDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0CountryTaxDto; } //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 NOVAGLOBALAPINS0CountryTaxDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0CountryTaxDto (JAXB) @end /*interface NOVAGLOBALAPINS0CountryTaxDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0CountryTaxDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0CountryTaxDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0CountryTaxDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0CountryTaxDto *_nOVAGLOBALAPINS0CountryTaxDto = [[NOVAGLOBALAPINS0CountryTaxDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0CountryTaxDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0CountryTaxDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0CountryTaxDto autorelease]; return _nOVAGLOBALAPINS0CountryTaxDto; } /** * Initialize this instance of NOVAGLOBALAPINS0CountryTaxDto 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 NOVAGLOBALAPINS0CountryTaxDto 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 NOVAGLOBALAPINS0CountryTaxDto from an XML reader. The element to be read is * "countryTax". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0CountryTaxDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0CountryTaxDto *_countryTaxDto = 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 countryTax."]; } } if (xmlStrcmp(BAD_CAST "countryTax", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}countryTax."); #endif _countryTaxDto = (NOVAGLOBALAPINS0CountryTaxDto *)[NOVAGLOBALAPINS0CountryTaxDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}countryTax."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryTaxDto. Expected element countryTax. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryTaxDto. Expected element countryTax. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _countryTaxDto; } /** * Writes this NOVAGLOBALAPINS0CountryTaxDto to XML under element name "countryTax". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _countryTaxDto The CountryTaxDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0CountryTaxDto 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 "countryTax", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}countryTax. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}countryTaxDto for root element {}countryTax..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}countryTaxDto for root element {}countryTax..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}countryTax. 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 "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCountryCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxValue", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}taxValue of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}taxValue of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setTaxValue: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self countryCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}countryCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}countryCode..."); #endif [[self countryCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}countryCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}countryCode."]; } } if ([self taxValue]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxValue", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}taxValue."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}taxValue..."); #endif [[self taxValue] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}taxValue..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}taxValue."]; } } } @end /* implementation NOVAGLOBALAPINS0CountryTaxDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0CountryTaxDto_M */ #ifndef DEF_NOVAGLOBALAPINS0RecurringChargeDto_M #define DEF_NOVAGLOBALAPINS0RecurringChargeDto_M /** * @author Edward P. Legaspi @since Nov 4, 2013 */ @implementation NOVAGLOBALAPINS0RecurringChargeDto /** * (no documentation provided) */ - (NSString *) currencyCode { return _currencyCode; } /** * (no documentation provided) */ - (void) setCurrencyCode: (NSString *) newCurrencyCode { [newCurrencyCode retain]; [_currencyCode release]; _currencyCode = newCurrencyCode; } /** * (no documentation provided) */ - (NSDate *) startDate { return _startDate; } /** * (no documentation provided) */ - (void) setStartDate: (NSDate *) newStartDate { [newStartDate retain]; [_startDate release]; _startDate = newStartDate; } /** * (no documentation provided) */ - (NSDate *) endDate { return _endDate; } /** * (no documentation provided) */ - (void) setEndDate: (NSDate *) newEndDate { [newEndDate retain]; [_endDate release]; _endDate = newEndDate; } /** * (no documentation provided) */ - (int *) minAge { return _minAge; } /** * (no documentation provided) */ - (void) setMinAge: (int *) newMinAge { if (_minAge != NULL) { free(_minAge); } _minAge = newMinAge; } /** * (no documentation provided) */ - (int *) maxAge { return _maxAge; } /** * (no documentation provided) */ - (void) setMaxAge: (int *) newMaxAge { if (_maxAge != NULL) { free(_maxAge); } _maxAge = newMaxAge; } /** * (no documentation provided) */ - (NSDecimalNumber *) price { return _price; } /** * (no documentation provided) */ - (void) setPrice: (NSDecimalNumber *) newPrice { [newPrice retain]; [_price release]; _price = newPrice; } /** * (no documentation provided) */ - (NSDecimalNumber *) recommendedPrice { return _recommendedPrice; } /** * (no documentation provided) */ - (void) setRecommendedPrice: (NSDecimalNumber *) newRecommendedPrice { [newRecommendedPrice retain]; [_recommendedPrice release]; _recommendedPrice = newRecommendedPrice; } - (void) dealloc { [self setCurrencyCode: nil]; [self setStartDate: nil]; [self setEndDate: nil]; [self setMinAge: NULL]; [self setMaxAge: NULL]; [self setPrice: nil]; [self setRecommendedPrice: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0RecurringChargeDto *_nOVAGLOBALAPINS0RecurringChargeDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0RecurringChargeDto = (NOVAGLOBALAPINS0RecurringChargeDto *) [NOVAGLOBALAPINS0RecurringChargeDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0RecurringChargeDto; } //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 NOVAGLOBALAPINS0RecurringChargeDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0RecurringChargeDto (JAXB) @end /*interface NOVAGLOBALAPINS0RecurringChargeDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0RecurringChargeDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0RecurringChargeDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0RecurringChargeDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0RecurringChargeDto *_nOVAGLOBALAPINS0RecurringChargeDto = [[NOVAGLOBALAPINS0RecurringChargeDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0RecurringChargeDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0RecurringChargeDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0RecurringChargeDto autorelease]; return _nOVAGLOBALAPINS0RecurringChargeDto; } /** * Initialize this instance of NOVAGLOBALAPINS0RecurringChargeDto 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 NOVAGLOBALAPINS0RecurringChargeDto 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 NOVAGLOBALAPINS0RecurringChargeDto from an XML reader. The element to be read is * "recurringCharge". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0RecurringChargeDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0RecurringChargeDto *_recurringChargeDto = 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 recurringCharge."]; } } if (xmlStrcmp(BAD_CAST "recurringCharge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}recurringCharge."); #endif _recurringChargeDto = (NOVAGLOBALAPINS0RecurringChargeDto *)[NOVAGLOBALAPINS0RecurringChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}recurringCharge."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0RecurringChargeDto. Expected element recurringCharge. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0RecurringChargeDto. Expected element recurringCharge. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _recurringChargeDto; } /** * Writes this NOVAGLOBALAPINS0RecurringChargeDto to XML under element name "recurringCharge". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _recurringChargeDto The RecurringChargeDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0RecurringChargeDto 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 "recurringCharge", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}recurringCharge. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}recurringChargeDto for root element {}recurringCharge..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}recurringChargeDto for root element {}recurringCharge..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}recurringCharge. 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 "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setStartDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setEndDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "minAge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setMinAge: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "maxAge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setMaxAge: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setPrice: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setRecommendedPrice: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self currencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currencyCode..."); #endif [[self currencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currencyCode."]; } } if ([self startDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}startDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}startDate..."); #endif [[self startDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}startDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}startDate."]; } } if ([self endDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}endDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}endDate..."); #endif [[self endDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}endDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}endDate."]; } } if ([self minAge] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "minAge", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}minAge."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}minAge..."); #endif status = xmlTextWriterWriteIntType(writer, [self minAge]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}minAge..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}minAge."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}minAge."]; } } if ([self maxAge] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "maxAge", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}maxAge."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}maxAge..."); #endif status = xmlTextWriterWriteIntType(writer, [self maxAge]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}maxAge..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}maxAge."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}maxAge."]; } } if ([self price]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}price."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}price..."); #endif [[self price] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}price..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}price."]; } } if ([self recommendedPrice]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recommendedPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recommendedPrice..."); #endif [[self recommendedPrice] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recommendedPrice..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recommendedPrice."]; } } } @end /* implementation NOVAGLOBALAPINS0RecurringChargeDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0RecurringChargeDto_M */ #ifndef DEF_NOVAGLOBALAPINS0SubscriptionFeeDto_M #define DEF_NOVAGLOBALAPINS0SubscriptionFeeDto_M /** * @author Edward P. Legaspi @since Nov 4, 2013 */ @implementation NOVAGLOBALAPINS0SubscriptionFeeDto /** * (no documentation provided) */ - (NSString *) currencyCode { return _currencyCode; } /** * (no documentation provided) */ - (void) setCurrencyCode: (NSString *) newCurrencyCode { [newCurrencyCode retain]; [_currencyCode release]; _currencyCode = newCurrencyCode; } /** * (no documentation provided) */ - (NSDate *) startDate { return _startDate; } /** * (no documentation provided) */ - (void) setStartDate: (NSDate *) newStartDate { [newStartDate retain]; [_startDate release]; _startDate = newStartDate; } /** * (no documentation provided) */ - (NSDate *) endDate { return _endDate; } /** * (no documentation provided) */ - (void) setEndDate: (NSDate *) newEndDate { [newEndDate retain]; [_endDate release]; _endDate = newEndDate; } /** * (no documentation provided) */ - (NSDecimalNumber *) price { return _price; } /** * (no documentation provided) */ - (void) setPrice: (NSDecimalNumber *) newPrice { [newPrice retain]; [_price release]; _price = newPrice; } /** * (no documentation provided) */ - (NSDecimalNumber *) recommendedPrice { return _recommendedPrice; } /** * (no documentation provided) */ - (void) setRecommendedPrice: (NSDecimalNumber *) newRecommendedPrice { [newRecommendedPrice retain]; [_recommendedPrice release]; _recommendedPrice = newRecommendedPrice; } - (void) dealloc { [self setCurrencyCode: nil]; [self setStartDate: nil]; [self setEndDate: nil]; [self setPrice: nil]; [self setRecommendedPrice: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0SubscriptionFeeDto *_nOVAGLOBALAPINS0SubscriptionFeeDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0SubscriptionFeeDto = (NOVAGLOBALAPINS0SubscriptionFeeDto *) [NOVAGLOBALAPINS0SubscriptionFeeDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0SubscriptionFeeDto; } //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 NOVAGLOBALAPINS0SubscriptionFeeDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0SubscriptionFeeDto (JAXB) @end /*interface NOVAGLOBALAPINS0SubscriptionFeeDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0SubscriptionFeeDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0SubscriptionFeeDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0SubscriptionFeeDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0SubscriptionFeeDto *_nOVAGLOBALAPINS0SubscriptionFeeDto = [[NOVAGLOBALAPINS0SubscriptionFeeDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0SubscriptionFeeDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0SubscriptionFeeDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0SubscriptionFeeDto autorelease]; return _nOVAGLOBALAPINS0SubscriptionFeeDto; } /** * Initialize this instance of NOVAGLOBALAPINS0SubscriptionFeeDto 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 NOVAGLOBALAPINS0SubscriptionFeeDto 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 NOVAGLOBALAPINS0SubscriptionFeeDto from an XML reader. The element to be read is * "subscriptionFee". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0SubscriptionFeeDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0SubscriptionFeeDto *_subscriptionFeeDto = 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 subscriptionFee."]; } } if (xmlStrcmp(BAD_CAST "subscriptionFee", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}subscriptionFee."); #endif _subscriptionFeeDto = (NOVAGLOBALAPINS0SubscriptionFeeDto *)[NOVAGLOBALAPINS0SubscriptionFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}subscriptionFee."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionFeeDto. Expected element subscriptionFee. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionFeeDto. Expected element subscriptionFee. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _subscriptionFeeDto; } /** * Writes this NOVAGLOBALAPINS0SubscriptionFeeDto to XML under element name "subscriptionFee". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _subscriptionFeeDto The SubscriptionFeeDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0SubscriptionFeeDto 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 "subscriptionFee", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}subscriptionFee. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}subscriptionFeeDto for root element {}subscriptionFee..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}subscriptionFeeDto for root element {}subscriptionFee..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}subscriptionFee. 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 "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setStartDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setEndDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setPrice: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setRecommendedPrice: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self currencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currencyCode..."); #endif [[self currencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currencyCode."]; } } if ([self startDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}startDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}startDate..."); #endif [[self startDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}startDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}startDate."]; } } if ([self endDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}endDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}endDate..."); #endif [[self endDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}endDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}endDate."]; } } if ([self price]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}price."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}price..."); #endif [[self price] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}price..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}price."]; } } if ([self recommendedPrice]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recommendedPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recommendedPrice..."); #endif [[self recommendedPrice] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recommendedPrice..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recommendedPrice."]; } } } @end /* implementation NOVAGLOBALAPINS0SubscriptionFeeDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0SubscriptionFeeDto_M */ #ifndef DEF_NOVAGLOBALAPINS0UsageChargeDto_M #define DEF_NOVAGLOBALAPINS0UsageChargeDto_M /** * @author Edward P. Legaspi @since Nov 4, 2013 */ @implementation NOVAGLOBALAPINS0UsageChargeDto /** * (no documentation provided) */ - (int *) min { return _min; } /** * (no documentation provided) */ - (void) setMin: (int *) newMin { if (_min != NULL) { free(_min); } _min = newMin; } /** * (no documentation provided) */ - (int *) max { return _max; } /** * (no documentation provided) */ - (void) setMax: (int *) newMax { if (_max != NULL) { free(_max); } _max = newMax; } /** * (no documentation provided) */ - (NSString *) currencyCode { return _currencyCode; } /** * (no documentation provided) */ - (void) setCurrencyCode: (NSString *) newCurrencyCode { [newCurrencyCode retain]; [_currencyCode release]; _currencyCode = newCurrencyCode; } /** * (no documentation provided) */ - (NSDate *) startDate { return _startDate; } /** * (no documentation provided) */ - (void) setStartDate: (NSDate *) newStartDate { [newStartDate retain]; [_startDate release]; _startDate = newStartDate; } /** * (no documentation provided) */ - (NSDate *) endDate { return _endDate; } /** * (no documentation provided) */ - (void) setEndDate: (NSDate *) newEndDate { [newEndDate retain]; [_endDate release]; _endDate = newEndDate; } /** * (no documentation provided) */ - (NSDecimalNumber *) price { return _price; } /** * (no documentation provided) */ - (void) setPrice: (NSDecimalNumber *) newPrice { [newPrice retain]; [_price release]; _price = newPrice; } /** * (no documentation provided) */ - (NSDecimalNumber *) recommendedPrice { return _recommendedPrice; } /** * (no documentation provided) */ - (void) setRecommendedPrice: (NSDecimalNumber *) newRecommendedPrice { [newRecommendedPrice retain]; [_recommendedPrice release]; _recommendedPrice = newRecommendedPrice; } - (void) dealloc { [self setMin: NULL]; [self setMax: NULL]; [self setCurrencyCode: nil]; [self setStartDate: nil]; [self setEndDate: nil]; [self setPrice: nil]; [self setRecommendedPrice: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0UsageChargeDto *_nOVAGLOBALAPINS0UsageChargeDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0UsageChargeDto = (NOVAGLOBALAPINS0UsageChargeDto *) [NOVAGLOBALAPINS0UsageChargeDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0UsageChargeDto; } //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 NOVAGLOBALAPINS0UsageChargeDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0UsageChargeDto (JAXB) @end /*interface NOVAGLOBALAPINS0UsageChargeDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0UsageChargeDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0UsageChargeDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0UsageChargeDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0UsageChargeDto *_nOVAGLOBALAPINS0UsageChargeDto = [[NOVAGLOBALAPINS0UsageChargeDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0UsageChargeDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0UsageChargeDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0UsageChargeDto autorelease]; return _nOVAGLOBALAPINS0UsageChargeDto; } /** * Initialize this instance of NOVAGLOBALAPINS0UsageChargeDto 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 NOVAGLOBALAPINS0UsageChargeDto 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 NOVAGLOBALAPINS0UsageChargeDto from an XML reader. The element to be read is * "usageCharge". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0UsageChargeDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0UsageChargeDto *_usageChargeDto = 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 usageCharge."]; } } if (xmlStrcmp(BAD_CAST "usageCharge", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}usageCharge."); #endif _usageChargeDto = (NOVAGLOBALAPINS0UsageChargeDto *)[NOVAGLOBALAPINS0UsageChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}usageCharge."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0UsageChargeDto. Expected element usageCharge. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0UsageChargeDto. Expected element usageCharge. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _usageChargeDto; } /** * Writes this NOVAGLOBALAPINS0UsageChargeDto to XML under element name "usageCharge". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _usageChargeDto The UsageChargeDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0UsageChargeDto 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 "usageCharge", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}usageCharge. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}usageChargeDto for root element {}usageCharge..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}usageChargeDto for root element {}usageCharge..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}usageCharge. 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 "min", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setMin: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "max", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setMax: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setStartDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setEndDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setPrice: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setRecommendedPrice: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self min] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "min", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}min."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}min..."); #endif status = xmlTextWriterWriteIntType(writer, [self min]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}min..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}min."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}min."]; } } if ([self max] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "max", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}max."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}max..."); #endif status = xmlTextWriterWriteIntType(writer, [self max]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}max..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}max."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}max."]; } } if ([self currencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currencyCode..."); #endif [[self currencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currencyCode."]; } } if ([self startDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}startDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}startDate..."); #endif [[self startDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}startDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}startDate."]; } } if ([self endDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}endDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}endDate..."); #endif [[self endDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}endDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}endDate."]; } } if ([self price]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}price."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}price..."); #endif [[self price] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}price..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}price."]; } } if ([self recommendedPrice]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recommendedPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recommendedPrice..."); #endif [[self recommendedPrice] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recommendedPrice..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recommendedPrice."]; } } } @end /* implementation NOVAGLOBALAPINS0UsageChargeDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0UsageChargeDto_M */ #ifndef DEF_NOVAGLOBALAPINS0CountryResponse_M #define DEF_NOVAGLOBALAPINS0CountryResponse_M /** * @author Edward P. Legaspi @since Oct 7, 2013 */ @implementation NOVAGLOBALAPINS0CountryResponse /** * (no documentation provided) */ - (NOVAGLOBALAPINS0ActionStatus *) actionStatus { return _actionStatus; } /** * (no documentation provided) */ - (void) setActionStatus: (NOVAGLOBALAPINS0ActionStatus *) newActionStatus { [newActionStatus retain]; [_actionStatus release]; _actionStatus = newActionStatus; } /** * (no documentation provided) */ - (NOVAGLOBALAPINS0CountryDto *) countryDto { return _countryDto; } /** * (no documentation provided) */ - (void) setCountryDto: (NOVAGLOBALAPINS0CountryDto *) newCountryDto { [newCountryDto retain]; [_countryDto release]; _countryDto = newCountryDto; } - (void) dealloc { [self setActionStatus: nil]; [self setCountryDto: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0CountryResponse *_nOVAGLOBALAPINS0CountryResponse; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0CountryResponse = (NOVAGLOBALAPINS0CountryResponse *) [NOVAGLOBALAPINS0CountryResponse readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0CountryResponse; } //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 NOVAGLOBALAPINS0CountryResponse */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0CountryResponse (JAXB) @end /*interface NOVAGLOBALAPINS0CountryResponse (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0CountryResponse (JAXB) /** * Read an instance of NOVAGLOBALAPINS0CountryResponse from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0CountryResponse defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0CountryResponse *_nOVAGLOBALAPINS0CountryResponse = [[NOVAGLOBALAPINS0CountryResponse alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0CountryResponse initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0CountryResponse = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0CountryResponse autorelease]; return _nOVAGLOBALAPINS0CountryResponse; } /** * Initialize this instance of NOVAGLOBALAPINS0CountryResponse 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 NOVAGLOBALAPINS0CountryResponse 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 NOVAGLOBALAPINS0CountryResponse from an XML reader. The element to be read is * "countryResponse". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0CountryResponse. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0CountryResponse *_countryResponse = 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 countryResponse."]; } } if (xmlStrcmp(BAD_CAST "countryResponse", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}countryResponse."); #endif _countryResponse = (NOVAGLOBALAPINS0CountryResponse *)[NOVAGLOBALAPINS0CountryResponse readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}countryResponse."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryResponse. Expected element countryResponse. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryResponse. Expected element countryResponse. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _countryResponse; } /** * Writes this NOVAGLOBALAPINS0CountryResponse to XML under element name "countryResponse". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _countryResponse The CountryResponse to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0CountryResponse 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 "countryResponse", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}countryResponse. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}countryResponse for root element {}countryResponse..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}countryResponse for root element {}countryResponse..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}countryResponse. 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 "actionStatus", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}actionStatus of type {}actionStatus."); #endif __child = [NOVAGLOBALAPINS0ActionStatus readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}actionStatus of type {}actionStatus."); #endif [self setActionStatus: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryDto", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}countryDto of type {}countryDto."); #endif __child = [NOVAGLOBALAPINS0CountryDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}countryDto of type {}countryDto."); #endif [self setCountryDto: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self actionStatus]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "actionStatus", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}actionStatus."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}actionStatus..."); #endif [[self actionStatus] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}actionStatus..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}actionStatus."]; } } if ([self countryDto]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryDto", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}countryDto."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}countryDto..."); #endif [[self countryDto] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}countryDto..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}countryDto."]; } } } @end /* implementation NOVAGLOBALAPINS0CountryResponse (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0CountryResponse_M */ #ifndef DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse_M #define DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse /** * (no documentation provided) */ - (NSString *) requestId { return _requestId; } /** * (no documentation provided) */ - (void) setRequestId: (NSString *) newRequestId { [newRequestId retain]; [_requestId release]; _requestId = newRequestId; } /** * (no documentation provided) */ - (BOOL *) accepted { return _accepted; } /** * (no documentation provided) */ - (void) setAccepted: (BOOL *) newAccepted { if (_accepted != NULL) { free(_accepted); } _accepted = newAccepted; } /** * (no documentation provided) */ - (NSString *) subscriptionId { return _subscriptionId; } /** * (no documentation provided) */ - (void) setSubscriptionId: (NSString *) newSubscriptionId { [newSubscriptionId retain]; [_subscriptionId release]; _subscriptionId = newSubscriptionId; } /** * (no documentation provided) */ - (NSString *) status { return _status; } /** * (no documentation provided) */ - (void) setStatus: (NSString *) newStatus { [newStatus retain]; [_status release]; _status = newStatus; } - (void) dealloc { [self setRequestId: nil]; [self setAccepted: NULL]; [self setSubscriptionId: nil]; [self setStatus: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse *) [NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse; } //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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse (JAXB) @end /*interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse (JAXB) /** * Read an instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse = [[NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse autorelease]; return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse; } /** * Initialize this instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse from an XML reader. The element to be read is * "subscriptionWithCreditLimitResponse". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse *_subscriptionWithCreditLimitResponse = 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 subscriptionWithCreditLimitResponse."]; } } if (xmlStrcmp(BAD_CAST "subscriptionWithCreditLimitResponse", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}subscriptionWithCreditLimitResponse."); #endif _subscriptionWithCreditLimitResponse = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse *)[NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}subscriptionWithCreditLimitResponse."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse. Expected element subscriptionWithCreditLimitResponse. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse. Expected element subscriptionWithCreditLimitResponse. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _subscriptionWithCreditLimitResponse; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse to XML under element name "subscriptionWithCreditLimitResponse". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitResponse The SubscriptionWithCreditLimitResponse to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse 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 "subscriptionWithCreditLimitResponse", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}subscriptionWithCreditLimitResponse. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}subscriptionWithCreditLimitResponse for root element {}subscriptionWithCreditLimitResponse..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}subscriptionWithCreditLimitResponse for root element {}subscriptionWithCreditLimitResponse..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}subscriptionWithCreditLimitResponse. 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 "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setRequestId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "accepted", 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 setAccepted: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subscriptionId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subscriptionId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSubscriptionId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}status of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}status of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setStatus: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self requestId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}requestId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}requestId..."); #endif [[self requestId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}requestId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}requestId."]; } } if ([self accepted] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "accepted", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}accepted."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}accepted..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self accepted]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}accepted..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}accepted."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}accepted."]; } } if ([self subscriptionId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionId..."); #endif [[self subscriptionId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionId."]; } } if ([self status]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}status."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}status..."); #endif [[self status] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}status..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}status."]; } } } @end /* implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitResponse_M */ #ifndef DEF_NOVAGLOBALAPINS0ActionStatus_M #define DEF_NOVAGLOBALAPINS0ActionStatus_M /** * @author Edward P. Legaspi @since Oct 3, 2013 */ @implementation NOVAGLOBALAPINS0ActionStatus /** * (no documentation provided) */ - (enum NOVAGLOBALAPINS0ActionStatusEnum *) status { return _status; } /** * (no documentation provided) */ - (void) setStatus: (enum NOVAGLOBALAPINS0ActionStatusEnum *) newStatus { if (_status != NULL) { free(_status); } _status = newStatus; } /** * (no documentation provided) */ - (int) errorCode { return _errorCode; } /** * (no documentation provided) */ - (void) setErrorCode: (int) newErrorCode { _errorCode = newErrorCode; } /** * (no documentation provided) */ - (NSString *) message { return _message; } /** * (no documentation provided) */ - (void) setMessage: (NSString *) newMessage { [newMessage retain]; [_message release]; _message = newMessage; } - (void) dealloc { [self setStatus: NULL]; [self setMessage: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0ActionStatus *_nOVAGLOBALAPINS0ActionStatus; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0ActionStatus = (NOVAGLOBALAPINS0ActionStatus *) [NOVAGLOBALAPINS0ActionStatus readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0ActionStatus; } //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 NOVAGLOBALAPINS0ActionStatus */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0ActionStatus (JAXB) @end /*interface NOVAGLOBALAPINS0ActionStatus (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0ActionStatus (JAXB) /** * Read an instance of NOVAGLOBALAPINS0ActionStatus from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0ActionStatus defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0ActionStatus *_nOVAGLOBALAPINS0ActionStatus = [[NOVAGLOBALAPINS0ActionStatus alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0ActionStatus initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0ActionStatus = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0ActionStatus autorelease]; return _nOVAGLOBALAPINS0ActionStatus; } /** * Initialize this instance of NOVAGLOBALAPINS0ActionStatus 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 NOVAGLOBALAPINS0ActionStatus 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 NOVAGLOBALAPINS0ActionStatus from an XML reader. The element to be read is * "actionStatus". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0ActionStatus. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0ActionStatus *_actionStatus = 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 actionStatus."]; } } if (xmlStrcmp(BAD_CAST "actionStatus", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}actionStatus."); #endif _actionStatus = (NOVAGLOBALAPINS0ActionStatus *)[NOVAGLOBALAPINS0ActionStatus readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}actionStatus."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ActionStatus. Expected element actionStatus. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ActionStatus. Expected element actionStatus. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _actionStatus; } /** * Writes this NOVAGLOBALAPINS0ActionStatus to XML under element name "actionStatus". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _actionStatus The ActionStatus to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0ActionStatus 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 "actionStatus", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}actionStatus. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}actionStatus for root element {}actionStatus..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}actionStatus for root element {}actionStatus..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}actionStatus. 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 "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadNOVAGLOBALAPINS0ActionStatusEnumType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setStatus: ((enum NOVAGLOBALAPINS0ActionStatusEnum*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "errorCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setErrorCode: *((int*) _child_accessor)]; free(_child_accessor); return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "message", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}message of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}message of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setMessage: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self status] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}status."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}status..."); #endif status = xmlTextWriterWriteNOVAGLOBALAPINS0ActionStatusEnumType(writer, [self status]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}status..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}status."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}status."]; } } if (YES) { //always write the primitive element... status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "errorCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}errorCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}errorCode..."); #endif status = xmlTextWriterWriteIntType(writer, &_errorCode); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}errorCode..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}errorCode."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}errorCode."]; } } if ([self message]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "message", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}message."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}message..."); #endif [[self message] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}message..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}message."]; } } } @end /* implementation NOVAGLOBALAPINS0ActionStatus (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0ActionStatus_M */ #ifndef DEF_NOVAGLOBALAPINS0TerminationFeeDto_M #define DEF_NOVAGLOBALAPINS0TerminationFeeDto_M /** * @author Edward P. Legaspi @since Nov 4, 2013 */ @implementation NOVAGLOBALAPINS0TerminationFeeDto /** * (no documentation provided) */ - (NSString *) currencyCode { return _currencyCode; } /** * (no documentation provided) */ - (void) setCurrencyCode: (NSString *) newCurrencyCode { [newCurrencyCode retain]; [_currencyCode release]; _currencyCode = newCurrencyCode; } /** * (no documentation provided) */ - (NSDate *) startDate { return _startDate; } /** * (no documentation provided) */ - (void) setStartDate: (NSDate *) newStartDate { [newStartDate retain]; [_startDate release]; _startDate = newStartDate; } /** * (no documentation provided) */ - (NSDate *) endDate { return _endDate; } /** * (no documentation provided) */ - (void) setEndDate: (NSDate *) newEndDate { [newEndDate retain]; [_endDate release]; _endDate = newEndDate; } /** * (no documentation provided) */ - (NSDecimalNumber *) price { return _price; } /** * (no documentation provided) */ - (void) setPrice: (NSDecimalNumber *) newPrice { [newPrice retain]; [_price release]; _price = newPrice; } /** * (no documentation provided) */ - (NSDecimalNumber *) recommendedPrice { return _recommendedPrice; } /** * (no documentation provided) */ - (void) setRecommendedPrice: (NSDecimalNumber *) newRecommendedPrice { [newRecommendedPrice retain]; [_recommendedPrice release]; _recommendedPrice = newRecommendedPrice; } - (void) dealloc { [self setCurrencyCode: nil]; [self setStartDate: nil]; [self setEndDate: nil]; [self setPrice: nil]; [self setRecommendedPrice: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0TerminationFeeDto *_nOVAGLOBALAPINS0TerminationFeeDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0TerminationFeeDto = (NOVAGLOBALAPINS0TerminationFeeDto *) [NOVAGLOBALAPINS0TerminationFeeDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0TerminationFeeDto; } //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 NOVAGLOBALAPINS0TerminationFeeDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0TerminationFeeDto (JAXB) @end /*interface NOVAGLOBALAPINS0TerminationFeeDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0TerminationFeeDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0TerminationFeeDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0TerminationFeeDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0TerminationFeeDto *_nOVAGLOBALAPINS0TerminationFeeDto = [[NOVAGLOBALAPINS0TerminationFeeDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0TerminationFeeDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0TerminationFeeDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0TerminationFeeDto autorelease]; return _nOVAGLOBALAPINS0TerminationFeeDto; } /** * Initialize this instance of NOVAGLOBALAPINS0TerminationFeeDto 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 NOVAGLOBALAPINS0TerminationFeeDto 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 NOVAGLOBALAPINS0TerminationFeeDto from an XML reader. The element to be read is * "terminationFee". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0TerminationFeeDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0TerminationFeeDto *_terminationFeeDto = 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 terminationFee."]; } } if (xmlStrcmp(BAD_CAST "terminationFee", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}terminationFee."); #endif _terminationFeeDto = (NOVAGLOBALAPINS0TerminationFeeDto *)[NOVAGLOBALAPINS0TerminationFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}terminationFee."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0TerminationFeeDto. Expected element terminationFee. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0TerminationFeeDto. Expected element terminationFee. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _terminationFeeDto; } /** * Writes this NOVAGLOBALAPINS0TerminationFeeDto to XML under element name "terminationFee". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _terminationFeeDto The TerminationFeeDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0TerminationFeeDto 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 "terminationFee", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}terminationFee. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}terminationFeeDto for root element {}terminationFee..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}terminationFeeDto for root element {}terminationFee..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}terminationFee. 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 "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "startDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}startDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setStartDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "endDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}endDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setEndDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}price of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setPrice: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recommendedPrice", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recommendedPrice of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setRecommendedPrice: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self currencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currencyCode..."); #endif [[self currencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currencyCode."]; } } if ([self startDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "startDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}startDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}startDate..."); #endif [[self startDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}startDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}startDate."]; } } if ([self endDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "endDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}endDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}endDate..."); #endif [[self endDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}endDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}endDate."]; } } if ([self price]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}price."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}price..."); #endif [[self price] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}price..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}price."]; } } if ([self recommendedPrice]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recommendedPrice", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recommendedPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recommendedPrice..."); #endif [[self recommendedPrice] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recommendedPrice..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recommendedPrice."]; } } } @end /* implementation NOVAGLOBALAPINS0TerminationFeeDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0TerminationFeeDto_M */ #ifndef DEF_NOVAGLOBALAPINS0DescriptionDto_M #define DEF_NOVAGLOBALAPINS0DescriptionDto_M /** * @author Edward P. Legaspi @since Oct 16, 2013 */ @implementation NOVAGLOBALAPINS0DescriptionDto /** * (no documentation provided) */ - (NSString *) languageCode { return _languageCode; } /** * (no documentation provided) */ - (void) setLanguageCode: (NSString *) newLanguageCode { [newLanguageCode retain]; [_languageCode release]; _languageCode = newLanguageCode; } /** * (no documentation provided) */ - (NSString *) description { return _description; } /** * (no documentation provided) */ - (void) setDescription: (NSString *) newDescription { [newDescription retain]; [_description release]; _description = newDescription; } - (void) dealloc { [self setLanguageCode: nil]; [self setDescription: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0DescriptionDto *_nOVAGLOBALAPINS0DescriptionDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0DescriptionDto = (NOVAGLOBALAPINS0DescriptionDto *) [NOVAGLOBALAPINS0DescriptionDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0DescriptionDto; } //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 NOVAGLOBALAPINS0DescriptionDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0DescriptionDto (JAXB) @end /*interface NOVAGLOBALAPINS0DescriptionDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0DescriptionDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0DescriptionDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0DescriptionDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0DescriptionDto *_nOVAGLOBALAPINS0DescriptionDto = [[NOVAGLOBALAPINS0DescriptionDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0DescriptionDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0DescriptionDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0DescriptionDto autorelease]; return _nOVAGLOBALAPINS0DescriptionDto; } /** * Initialize this instance of NOVAGLOBALAPINS0DescriptionDto 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 NOVAGLOBALAPINS0DescriptionDto 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 NOVAGLOBALAPINS0DescriptionDto from an XML reader. The element to be read is * "description". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0DescriptionDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0DescriptionDto *_descriptionDto = 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 description."]; } } if (xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}description."); #endif _descriptionDto = (NOVAGLOBALAPINS0DescriptionDto *)[NOVAGLOBALAPINS0DescriptionDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}description."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0DescriptionDto. Expected element description. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0DescriptionDto. Expected element description. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _descriptionDto; } /** * Writes this NOVAGLOBALAPINS0DescriptionDto to XML under element name "description". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _descriptionDto The DescriptionDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0DescriptionDto 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 "description", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}description. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}descriptionDto for root element {}description..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}descriptionDto for root element {}description..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}description. 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 "languageCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setLanguageCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}description of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}description of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setDescription: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self languageCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "languageCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}languageCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}languageCode..."); #endif [[self languageCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}languageCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}languageCode."]; } } if ([self description]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "description", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}description."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}description..."); #endif [[self description] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}description..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}description."]; } } } @end /* implementation NOVAGLOBALAPINS0DescriptionDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0DescriptionDto_M */ #ifndef DEF_NOVAGLOBALAPINS0BaseDto_M #define DEF_NOVAGLOBALAPINS0BaseDto_M /** * @author Edward P. Legaspi @since Oct 4, 2013 */ @implementation NOVAGLOBALAPINS0BaseDto /** * (no documentation provided) */ - (long long *) providerId { return _providerId; } /** * (no documentation provided) */ - (void) setProviderId: (long long *) newProviderId { if (_providerId != NULL) { free(_providerId); } _providerId = newProviderId; } /** * (no documentation provided) */ - (long long *) currentUserId { return _currentUserId; } /** * (no documentation provided) */ - (void) setCurrentUserId: (long long *) newCurrentUserId { if (_currentUserId != NULL) { free(_currentUserId); } _currentUserId = newCurrentUserId; } /** * (no documentation provided) */ - (NSString *) requestId { return _requestId; } /** * (no documentation provided) */ - (void) setRequestId: (NSString *) newRequestId { [newRequestId retain]; [_requestId release]; _requestId = newRequestId; } - (void) dealloc { [self setProviderId: NULL]; [self setCurrentUserId: NULL]; [self setRequestId: nil]; [super dealloc]; } @end /* implementation NOVAGLOBALAPINS0BaseDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0BaseDto (JAXB) @end /*interface NOVAGLOBALAPINS0BaseDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0BaseDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0BaseDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0BaseDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0BaseDto *_nOVAGLOBALAPINS0BaseDto = [[NOVAGLOBALAPINS0BaseDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0BaseDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0BaseDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0BaseDto autorelease]; return _nOVAGLOBALAPINS0BaseDto; } /** * Initialize this instance of NOVAGLOBALAPINS0BaseDto 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 NOVAGLOBALAPINS0BaseDto 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 "providerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setProviderId: ((long long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currentUserId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setCurrentUserId: ((long long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "requestId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}requestId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setRequestId: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self providerId] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "providerId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}providerId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}providerId..."); #endif status = xmlTextWriterWriteLongType(writer, [self providerId]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}providerId..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}providerId."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}providerId."]; } } if ([self currentUserId] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currentUserId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currentUserId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currentUserId..."); #endif status = xmlTextWriterWriteLongType(writer, [self currentUserId]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currentUserId..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}currentUserId."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currentUserId."]; } } if ([self requestId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "requestId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}requestId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}requestId..."); #endif [[self requestId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}requestId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}requestId."]; } } } @end /* implementation NOVAGLOBALAPINS0BaseDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0BaseDto_M */ #ifndef DEF_NOVAGLOBALAPINS0ServicePricePlanDto_M #define DEF_NOVAGLOBALAPINS0ServicePricePlanDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0ServicePricePlanDto /** * (no documentation provided) */ - (NSString *) serviceId { return _serviceId; } /** * (no documentation provided) */ - (void) setServiceId: (NSString *) newServiceId { [newServiceId retain]; [_serviceId release]; _serviceId = newServiceId; } /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } /** * (no documentation provided) */ - (NSString *) taxId { return _taxId; } /** * (no documentation provided) */ - (void) setTaxId: (NSString *) newTaxId { [newTaxId retain]; [_taxId release]; _taxId = newTaxId; } /** * (no documentation provided) */ - (BOOL *) subscriptionProrata { return _subscriptionProrata; } /** * (no documentation provided) */ - (void) setSubscriptionProrata: (BOOL *) newSubscriptionProrata { if (_subscriptionProrata != NULL) { free(_subscriptionProrata); } _subscriptionProrata = newSubscriptionProrata; } /** * (no documentation provided) */ - (BOOL *) terminationProrata { return _terminationProrata; } /** * (no documentation provided) */ - (void) setTerminationProrata: (BOOL *) newTerminationProrata { if (_terminationProrata != NULL) { free(_terminationProrata); } _terminationProrata = newTerminationProrata; } /** * (no documentation provided) */ - (BOOL *) applyInAdvance { return _applyInAdvance; } /** * (no documentation provided) */ - (void) setApplyInAdvance: (BOOL *) newApplyInAdvance { if (_applyInAdvance != NULL) { free(_applyInAdvance); } _applyInAdvance = newApplyInAdvance; } /** * (no documentation provided) */ - (NSString *) param1 { return _param1; } /** * (no documentation provided) */ - (void) setParam1: (NSString *) newParam1 { [newParam1 retain]; [_param1 release]; _param1 = newParam1; } /** * (no documentation provided) */ - (NSString *) param2 { return _param2; } /** * (no documentation provided) */ - (void) setParam2: (NSString *) newParam2 { [newParam2 retain]; [_param2 release]; _param2 = newParam2; } /** * (no documentation provided) */ - (NSString *) param3 { return _param3; } /** * (no documentation provided) */ - (void) setParam3: (NSString *) newParam3 { [newParam3 retain]; [_param3 release]; _param3 = newParam3; } /** * (no documentation provided) */ - (int *) billingPeriod { return _billingPeriod; } /** * (no documentation provided) */ - (void) setBillingPeriod: (int *) newBillingPeriod { if (_billingPeriod != NULL) { free(_billingPeriod); } _billingPeriod = newBillingPeriod; } /** * (no documentation provided) */ - (NSArray *) recurringCharges { return _recurringCharges; } /** * (no documentation provided) */ - (void) setRecurringCharges: (NSArray *) newRecurringCharges { [newRecurringCharges retain]; [_recurringCharges release]; _recurringCharges = newRecurringCharges; } /** * (no documentation provided) */ - (NSString *) usageUnit { return _usageUnit; } /** * (no documentation provided) */ - (void) setUsageUnit: (NSString *) newUsageUnit { [newUsageUnit retain]; [_usageUnit release]; _usageUnit = newUsageUnit; } /** * (no documentation provided) */ - (NSArray *) usageCharges { return _usageCharges; } /** * (no documentation provided) */ - (void) setUsageCharges: (NSArray *) newUsageCharges { [newUsageCharges retain]; [_usageCharges release]; _usageCharges = newUsageCharges; } /** * (no documentation provided) */ - (NSArray *) subscriptionFees { return _subscriptionFees; } /** * (no documentation provided) */ - (void) setSubscriptionFees: (NSArray *) newSubscriptionFees { [newSubscriptionFees retain]; [_subscriptionFees release]; _subscriptionFees = newSubscriptionFees; } /** * (no documentation provided) */ - (NSArray *) terminationFees { return _terminationFees; } /** * (no documentation provided) */ - (void) setTerminationFees: (NSArray *) newTerminationFees { [newTerminationFees retain]; [_terminationFees release]; _terminationFees = newTerminationFees; } - (void) dealloc { [self setServiceId: nil]; [self setOrganizationId: nil]; [self setTaxId: nil]; [self setSubscriptionProrata: NULL]; [self setTerminationProrata: NULL]; [self setApplyInAdvance: NULL]; [self setParam1: nil]; [self setParam2: nil]; [self setParam3: nil]; [self setBillingPeriod: NULL]; [self setRecurringCharges: nil]; [self setUsageUnit: nil]; [self setUsageCharges: nil]; [self setSubscriptionFees: nil]; [self setTerminationFees: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0ServicePricePlanDto *_nOVAGLOBALAPINS0ServicePricePlanDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0ServicePricePlanDto = (NOVAGLOBALAPINS0ServicePricePlanDto *) [NOVAGLOBALAPINS0ServicePricePlanDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0ServicePricePlanDto; } //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 NOVAGLOBALAPINS0ServicePricePlanDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0ServicePricePlanDto (JAXB) @end /*interface NOVAGLOBALAPINS0ServicePricePlanDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0ServicePricePlanDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0ServicePricePlanDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0ServicePricePlanDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0ServicePricePlanDto *_nOVAGLOBALAPINS0ServicePricePlanDto = [[NOVAGLOBALAPINS0ServicePricePlanDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0ServicePricePlanDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0ServicePricePlanDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0ServicePricePlanDto autorelease]; return _nOVAGLOBALAPINS0ServicePricePlanDto; } /** * Initialize this instance of NOVAGLOBALAPINS0ServicePricePlanDto 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 NOVAGLOBALAPINS0ServicePricePlanDto 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 NOVAGLOBALAPINS0ServicePricePlanDto from an XML reader. The element to be read is * "servicePlan". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0ServicePricePlanDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0ServicePricePlanDto *_servicePricePlanDto = 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 servicePlan."]; } } if (xmlStrcmp(BAD_CAST "servicePlan", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}servicePlan."); #endif _servicePricePlanDto = (NOVAGLOBALAPINS0ServicePricePlanDto *)[NOVAGLOBALAPINS0ServicePricePlanDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}servicePlan."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServicePricePlanDto. Expected element servicePlan. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServicePricePlanDto. Expected element servicePlan. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _servicePricePlanDto; } /** * Writes this NOVAGLOBALAPINS0ServicePricePlanDto to XML under element name "servicePlan". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _servicePricePlanDto The ServicePricePlanDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0ServicePricePlanDto 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 "servicePlan", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}servicePlan. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}servicePricePlanDto for root element {}servicePlan..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}servicePricePlanDto for root element {}servicePlan..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}servicePlan. 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 "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setServiceId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setTaxId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionProrata", 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 setSubscriptionProrata: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationProrata", 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 setTerminationProrata: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applyInAdvance", 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 setApplyInAdvance: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam1: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam2: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam3: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "billingPeriod", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setBillingPeriod: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recurringCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recurringCharges of type {}recurringChargeDto."); #endif __child = [NOVAGLOBALAPINS0RecurringChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recurringCharges of type {}recurringChargeDto."); #endif if ([self recurringCharges]) { [self setRecurringCharges: [[self recurringCharges] arrayByAddingObject: __child]]; } else { [self setRecurringCharges: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageUnit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUsageUnit: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}usageCharges of type {}usageChargeDto."); #endif __child = [NOVAGLOBALAPINS0UsageChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}usageCharges of type {}usageChargeDto."); #endif if ([self usageCharges]) { [self setUsageCharges: [[self usageCharges] arrayByAddingObject: __child]]; } else { [self setUsageCharges: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subscriptionFees of type {}subscriptionFeeDto."); #endif __child = [NOVAGLOBALAPINS0SubscriptionFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subscriptionFees of type {}subscriptionFeeDto."); #endif if ([self subscriptionFees]) { [self setSubscriptionFees: [[self subscriptionFees] arrayByAddingObject: __child]]; } else { [self setSubscriptionFees: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}terminationFees of type {}terminationFeeDto."); #endif __child = [NOVAGLOBALAPINS0TerminationFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}terminationFees of type {}terminationFeeDto."); #endif if ([self terminationFees]) { [self setTerminationFees: [[self terminationFees] arrayByAddingObject: __child]]; } else { [self setTerminationFees: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self serviceId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}serviceId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}serviceId..."); #endif [[self serviceId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}serviceId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}serviceId."]; } } if ([self organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } if ([self taxId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}taxId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}taxId..."); #endif [[self taxId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}taxId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}taxId."]; } } if ([self subscriptionProrata] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionProrata", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionProrata."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionProrata..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self subscriptionProrata]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionProrata..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}subscriptionProrata."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionProrata."]; } } if ([self terminationProrata] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationProrata", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}terminationProrata."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}terminationProrata..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self terminationProrata]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}terminationProrata..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}terminationProrata."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}terminationProrata."]; } } if ([self applyInAdvance] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "applyInAdvance", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}applyInAdvance."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}applyInAdvance..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self applyInAdvance]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}applyInAdvance..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}applyInAdvance."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}applyInAdvance."]; } } if ([self param1]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param1."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param1..."); #endif [[self param1] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param1..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param1."]; } } if ([self param2]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param2."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param2..."); #endif [[self param2] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param2..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param2."]; } } if ([self param3]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param3."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param3..."); #endif [[self param3] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param3..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param3."]; } } if ([self billingPeriod] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "billingPeriod", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}billingPeriod."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}billingPeriod..."); #endif status = xmlTextWriterWriteIntType(writer, [self billingPeriod]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}billingPeriod..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}billingPeriod."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}billingPeriod."]; } } if ([self recurringCharges]) { __enumerator = [[self recurringCharges] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recurringCharges", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recurringCharges."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recurringCharges..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recurringCharges..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recurringCharges."]; } } //end item iterator. } if ([self usageUnit]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageUnit", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}usageUnit."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}usageUnit..."); #endif [[self usageUnit] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}usageUnit..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}usageUnit."]; } } if ([self usageCharges]) { __enumerator = [[self usageCharges] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageCharges", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}usageCharges."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}usageCharges..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}usageCharges..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}usageCharges."]; } } //end item iterator. } if ([self subscriptionFees]) { __enumerator = [[self subscriptionFees] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionFees", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionFees."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionFees..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionFees..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionFees."]; } } //end item iterator. } if ([self terminationFees]) { __enumerator = [[self terminationFees] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationFees", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}terminationFees."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}terminationFees..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}terminationFees..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}terminationFees."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0ServicePricePlanDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0ServicePricePlanDto_M */ #ifndef DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto_M #define DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto /** * (no documentation provided) */ - (NSString *) userId { return _userId; } /** * (no documentation provided) */ - (void) setUserId: (NSString *) newUserId { [newUserId retain]; [_userId release]; _userId = newUserId; } /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } /** * (no documentation provided) */ - (NSString *) offerId { return _offerId; } /** * (no documentation provided) */ - (void) setOfferId: (NSString *) newOfferId { [newOfferId retain]; [_offerId release]; _offerId = newOfferId; } /** * (no documentation provided) */ - (NSArray *) servicesToAdd { return _servicesToAdd; } /** * (no documentation provided) */ - (void) setServicesToAdd: (NSArray *) newServicesToAdd { [newServicesToAdd retain]; [_servicesToAdd release]; _servicesToAdd = newServicesToAdd; } /** * (no documentation provided) */ - (NSArray *) creditLimits { return _creditLimits; } /** * (no documentation provided) */ - (void) setCreditLimits: (NSArray *) newCreditLimits { [newCreditLimits retain]; [_creditLimits release]; _creditLimits = newCreditLimits; } /** * (no documentation provided) */ - (NSDate *) subscriptionDate { return _subscriptionDate; } /** * (no documentation provided) */ - (void) setSubscriptionDate: (NSDate *) newSubscriptionDate { [newSubscriptionDate retain]; [_subscriptionDate release]; _subscriptionDate = newSubscriptionDate; } - (void) dealloc { [self setUserId: nil]; [self setOrganizationId: nil]; [self setOfferId: nil]; [self setServicesToAdd: nil]; [self setCreditLimits: nil]; [self setSubscriptionDate: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto *) [NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto; } //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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto (JAXB) @end /*interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto = [[NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto autorelease]; return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitDto; } /** * Initialize this instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto from an XML reader. The element to be read is * "subscriptionWithCreditLimitDto". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto *_subscriptionWithCreditLimitDto = 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 subscriptionWithCreditLimitDto."]; } } if (xmlStrcmp(BAD_CAST "subscriptionWithCreditLimitDto", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}subscriptionWithCreditLimitDto."); #endif _subscriptionWithCreditLimitDto = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto *)[NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}subscriptionWithCreditLimitDto."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto. Expected element subscriptionWithCreditLimitDto. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto. Expected element subscriptionWithCreditLimitDto. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _subscriptionWithCreditLimitDto; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto to XML under element name "subscriptionWithCreditLimitDto". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitDto The SubscriptionWithCreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto 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 "subscriptionWithCreditLimitDto", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}subscriptionWithCreditLimitDto. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}subscriptionWithCreditLimitDto for root element {}subscriptionWithCreditLimitDto..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}subscriptionWithCreditLimitDto for root element {}subscriptionWithCreditLimitDto..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}subscriptionWithCreditLimitDto. 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 "userId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUserId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOfferId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "servicesToAdd", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}servicesToAdd of type {}serviceToAddDto."); #endif __child = [NOVAGLOBALAPINS0ServiceToAddDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}servicesToAdd of type {}serviceToAddDto."); #endif if ([self servicesToAdd]) { [self setServicesToAdd: [[self servicesToAdd] arrayByAddingObject: __child]]; } else { [self setServicesToAdd: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditLimits", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}creditLimits of type {}creditLimitDto."); #endif __child = [NOVAGLOBALAPINS0CreditLimitDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}creditLimits of type {}creditLimitDto."); #endif if ([self creditLimits]) { [self setCreditLimits: [[self creditLimits] arrayByAddingObject: __child]]; } else { [self setCreditLimits: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setSubscriptionDate: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self userId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "userId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}userId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}userId..."); #endif [[self userId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}userId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}userId."]; } } if ([self organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } if ([self offerId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}offerId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}offerId..."); #endif [[self offerId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}offerId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}offerId."]; } } if ([self servicesToAdd]) { __enumerator = [[self servicesToAdd] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "servicesToAdd", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}servicesToAdd."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}servicesToAdd..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}servicesToAdd..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}servicesToAdd."]; } } //end item iterator. } if ([self creditLimits]) { __enumerator = [[self creditLimits] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditLimits", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creditLimits."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creditLimits..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creditLimits..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creditLimits."]; } } //end item iterator. } if ([self subscriptionDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionDate..."); #endif [[self subscriptionDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionDate."]; } } } @end /* implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitDto_M */ #ifndef DEF_NOVAGLOBALAPINS0ActionStatusEnum_M #define DEF_NOVAGLOBALAPINS0ActionStatusEnum_M /** * Reads a ActionStatusEnum from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The ActionStatusEnum, or NULL if unable to be read. */ static enum NOVAGLOBALAPINS0ActionStatusEnum *xmlTextReaderReadNOVAGLOBALAPINS0ActionStatusEnumType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum NOVAGLOBALAPINS0ActionStatusEnum *value = calloc(1, sizeof(enum NOVAGLOBALAPINS0ActionStatusEnum)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "SUCCESS") == 0) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "FAIL") == 0) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _actionStatusEnum The string to format. * @return The enum value or NULL on error. */ static enum NOVAGLOBALAPINS0ActionStatusEnum *formatStringToNOVAGLOBALAPINS0ActionStatusEnumType(NSString *_actionStatusEnum) { enum NOVAGLOBALAPINS0ActionStatusEnum *value = calloc(1, sizeof(enum NOVAGLOBALAPINS0ActionStatusEnum)); value = NULL; if ([@"SUCCESS" isEqualToString:_actionStatusEnum]) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS; } if ([@"FAIL" isEqualToString:_actionStatusEnum]) { *value = NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _actionStatusEnum); #endif return value; } /** * Writes a ActionStatusEnum to XML. * * @param writer The XML writer. * @param _actionStatusEnum The ActionStatusEnum to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteNOVAGLOBALAPINS0ActionStatusEnumType(xmlTextWriterPtr writer, enum NOVAGLOBALAPINS0ActionStatusEnum *_actionStatusEnum) { switch (*_actionStatusEnum) { case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS: return xmlTextWriterWriteString(writer, BAD_CAST "SUCCESS"); case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL: return xmlTextWriterWriteString(writer, BAD_CAST "FAIL"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of ActionStatusEnum. * * @param _actionStatusEnum The ActionStatusEnum to format. * @return The string value or NULL on error. */ static NSString *formatNOVAGLOBALAPINS0ActionStatusEnumTypeToString(enum NOVAGLOBALAPINS0ActionStatusEnum *_actionStatusEnum) { switch (*_actionStatusEnum) { case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_SUCCESS: return @"SUCCESS"; case NOVAGLOBALAPI_NS0_ACTIONSTATUSENUM_FAIL: return @"FAIL"; default: return NULL; } return NULL; } #endif /* DEF_NOVAGLOBALAPINS0ActionStatusEnum_M */ #ifndef DEF_NOVAGLOBALAPINS0UserDto_M #define DEF_NOVAGLOBALAPINS0UserDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0UserDto /** * (no documentation provided) */ - (NSString *) userId { return _userId; } /** * (no documentation provided) */ - (void) setUserId: (NSString *) newUserId { [newUserId retain]; [_userId release]; _userId = newUserId; } /** * (no documentation provided) */ - (NSString *) name { return _name; } /** * (no documentation provided) */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } - (void) dealloc { [self setUserId: nil]; [self setName: nil]; [self setOrganizationId: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0UserDto *_nOVAGLOBALAPINS0UserDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0UserDto = (NOVAGLOBALAPINS0UserDto *) [NOVAGLOBALAPINS0UserDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0UserDto; } //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 NOVAGLOBALAPINS0UserDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0UserDto (JAXB) @end /*interface NOVAGLOBALAPINS0UserDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0UserDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0UserDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0UserDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0UserDto *_nOVAGLOBALAPINS0UserDto = [[NOVAGLOBALAPINS0UserDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0UserDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0UserDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0UserDto autorelease]; return _nOVAGLOBALAPINS0UserDto; } /** * Initialize this instance of NOVAGLOBALAPINS0UserDto 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 NOVAGLOBALAPINS0UserDto 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 NOVAGLOBALAPINS0UserDto from an XML reader. The element to be read is * "user". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0UserDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0UserDto *_userDto = 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 user."]; } } if (xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}user."); #endif _userDto = (NOVAGLOBALAPINS0UserDto *)[NOVAGLOBALAPINS0UserDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}user."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0UserDto. Expected element user. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0UserDto. Expected element user. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _userDto; } /** * Writes this NOVAGLOBALAPINS0UserDto to XML under element name "user". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _userDto The UserDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0UserDto 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 "user", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}user. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}userDto for root element {}user..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}userDto for root element {}user..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}user. 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 "userId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}userId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUserId: __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 {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}name of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self userId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "userId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}userId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}userId..."); #endif [[self userId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}userId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}userId."]; } } 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 organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } } @end /* implementation NOVAGLOBALAPINS0UserDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0UserDto_M */ #ifndef DEF_NOVAGLOBALAPINS0TaxDto_M #define DEF_NOVAGLOBALAPINS0TaxDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0TaxDto /** * (no documentation provided) */ - (NSString *) taxId { return _taxId; } /** * (no documentation provided) */ - (void) setTaxId: (NSString *) newTaxId { [newTaxId retain]; [_taxId release]; _taxId = newTaxId; } /** * (no documentation provided) */ - (NSString *) name { return _name; } /** * (no documentation provided) */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * (no documentation provided) */ - (NSArray *) countryTaxes { return _countryTaxes; } /** * (no documentation provided) */ - (void) setCountryTaxes: (NSArray *) newCountryTaxes { [newCountryTaxes retain]; [_countryTaxes release]; _countryTaxes = newCountryTaxes; } - (void) dealloc { [self setTaxId: nil]; [self setName: nil]; [self setCountryTaxes: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0TaxDto *_nOVAGLOBALAPINS0TaxDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0TaxDto = (NOVAGLOBALAPINS0TaxDto *) [NOVAGLOBALAPINS0TaxDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0TaxDto; } //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 NOVAGLOBALAPINS0TaxDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0TaxDto (JAXB) @end /*interface NOVAGLOBALAPINS0TaxDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0TaxDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0TaxDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0TaxDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0TaxDto *_nOVAGLOBALAPINS0TaxDto = [[NOVAGLOBALAPINS0TaxDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0TaxDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0TaxDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0TaxDto autorelease]; return _nOVAGLOBALAPINS0TaxDto; } /** * Initialize this instance of NOVAGLOBALAPINS0TaxDto 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 NOVAGLOBALAPINS0TaxDto 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 NOVAGLOBALAPINS0TaxDto from an XML reader. The element to be read is * "tax". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0TaxDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0TaxDto *_taxDto = 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 tax."]; } } if (xmlStrcmp(BAD_CAST "tax", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}tax."); #endif _taxDto = (NOVAGLOBALAPINS0TaxDto *)[NOVAGLOBALAPINS0TaxDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}tax."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0TaxDto. Expected element tax. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0TaxDto. Expected element tax. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _taxDto; } /** * Writes this NOVAGLOBALAPINS0TaxDto to XML under element name "tax". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _taxDto The TaxDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0TaxDto 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 "tax", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}tax. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}taxDto for root element {}tax..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}taxDto for root element {}tax..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}tax. 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 "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setTaxId: __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 {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}name of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryTaxes", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}countryTaxes of type {}countryTaxDto."); #endif __child = [NOVAGLOBALAPINS0CountryTaxDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}countryTaxes of type {}countryTaxDto."); #endif if ([self countryTaxes]) { [self setCountryTaxes: [[self countryTaxes] arrayByAddingObject: __child]]; } else { [self setCountryTaxes: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self taxId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}taxId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}taxId..."); #endif [[self taxId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}taxId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}taxId."]; } } 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 countryTaxes]) { __enumerator = [[self countryTaxes] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryTaxes", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}countryTaxes."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}countryTaxes..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}countryTaxes..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}countryTaxes."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0TaxDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0TaxDto_M */ #ifndef DEF_NOVAGLOBALAPINS0ServiceToTerminateDto_M #define DEF_NOVAGLOBALAPINS0ServiceToTerminateDto_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0ServiceToTerminateDto /** * (no documentation provided) */ - (NSString *) serviceId { return _serviceId; } /** * (no documentation provided) */ - (void) setServiceId: (NSString *) newServiceId { [newServiceId retain]; [_serviceId release]; _serviceId = newServiceId; } /** * (no documentation provided) */ - (NSDate *) terminationDate { return _terminationDate; } /** * (no documentation provided) */ - (void) setTerminationDate: (NSDate *) newTerminationDate { [newTerminationDate retain]; [_terminationDate release]; _terminationDate = newTerminationDate; } - (void) dealloc { [self setServiceId: nil]; [self setTerminationDate: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0ServiceToTerminateDto *_nOVAGLOBALAPINS0ServiceToTerminateDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0ServiceToTerminateDto = (NOVAGLOBALAPINS0ServiceToTerminateDto *) [NOVAGLOBALAPINS0ServiceToTerminateDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0ServiceToTerminateDto; } //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 NOVAGLOBALAPINS0ServiceToTerminateDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0ServiceToTerminateDto (JAXB) @end /*interface NOVAGLOBALAPINS0ServiceToTerminateDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0ServiceToTerminateDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0ServiceToTerminateDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0ServiceToTerminateDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0ServiceToTerminateDto *_nOVAGLOBALAPINS0ServiceToTerminateDto = [[NOVAGLOBALAPINS0ServiceToTerminateDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0ServiceToTerminateDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0ServiceToTerminateDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0ServiceToTerminateDto autorelease]; return _nOVAGLOBALAPINS0ServiceToTerminateDto; } /** * Initialize this instance of NOVAGLOBALAPINS0ServiceToTerminateDto 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 NOVAGLOBALAPINS0ServiceToTerminateDto 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 NOVAGLOBALAPINS0ServiceToTerminateDto from an XML reader. The element to be read is * "serviceToTerminate". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0ServiceToTerminateDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0ServiceToTerminateDto *_serviceToTerminateDto = 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 serviceToTerminate."]; } } if (xmlStrcmp(BAD_CAST "serviceToTerminate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}serviceToTerminate."); #endif _serviceToTerminateDto = (NOVAGLOBALAPINS0ServiceToTerminateDto *)[NOVAGLOBALAPINS0ServiceToTerminateDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}serviceToTerminate."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceToTerminateDto. Expected element serviceToTerminate. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceToTerminateDto. Expected element serviceToTerminate. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _serviceToTerminateDto; } /** * Writes this NOVAGLOBALAPINS0ServiceToTerminateDto to XML under element name "serviceToTerminate". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _serviceToTerminateDto The ServiceToTerminateDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0ServiceToTerminateDto 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 "serviceToTerminate", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}serviceToTerminate. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}serviceToTerminateDto for root element {}serviceToTerminate..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}serviceToTerminateDto for root element {}serviceToTerminate..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}serviceToTerminate. 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 "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setServiceId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}terminationDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}terminationDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setTerminationDate: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self serviceId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}serviceId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}serviceId..."); #endif [[self serviceId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}serviceId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}serviceId."]; } } if ([self terminationDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}terminationDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}terminationDate..."); #endif [[self terminationDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}terminationDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}terminationDate."]; } } } @end /* implementation NOVAGLOBALAPINS0ServiceToTerminateDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0ServiceToTerminateDto_M */ #ifndef DEF_NOVAGLOBALAPINS0ServiceToAddDto_M #define DEF_NOVAGLOBALAPINS0ServiceToAddDto_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0ServiceToAddDto /** * (no documentation provided) */ - (NSString *) serviceId { return _serviceId; } /** * (no documentation provided) */ - (void) setServiceId: (NSString *) newServiceId { [newServiceId retain]; [_serviceId release]; _serviceId = newServiceId; } /** * (no documentation provided) */ - (NSDate *) subscriptionDate { return _subscriptionDate; } /** * (no documentation provided) */ - (void) setSubscriptionDate: (NSDate *) newSubscriptionDate { [newSubscriptionDate retain]; [_subscriptionDate release]; _subscriptionDate = newSubscriptionDate; } /** * (no documentation provided) */ - (NSString *) param1 { return _param1; } /** * (no documentation provided) */ - (void) setParam1: (NSString *) newParam1 { [newParam1 retain]; [_param1 release]; _param1 = newParam1; } /** * (no documentation provided) */ - (NSString *) param2 { return _param2; } /** * (no documentation provided) */ - (void) setParam2: (NSString *) newParam2 { [newParam2 retain]; [_param2 release]; _param2 = newParam2; } /** * (no documentation provided) */ - (NSString *) param3 { return _param3; } /** * (no documentation provided) */ - (void) setParam3: (NSString *) newParam3 { [newParam3 retain]; [_param3 release]; _param3 = newParam3; } - (void) dealloc { [self setServiceId: nil]; [self setSubscriptionDate: nil]; [self setParam1: nil]; [self setParam2: nil]; [self setParam3: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0ServiceToAddDto *_nOVAGLOBALAPINS0ServiceToAddDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0ServiceToAddDto = (NOVAGLOBALAPINS0ServiceToAddDto *) [NOVAGLOBALAPINS0ServiceToAddDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0ServiceToAddDto; } //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 NOVAGLOBALAPINS0ServiceToAddDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0ServiceToAddDto (JAXB) @end /*interface NOVAGLOBALAPINS0ServiceToAddDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0ServiceToAddDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0ServiceToAddDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0ServiceToAddDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0ServiceToAddDto *_nOVAGLOBALAPINS0ServiceToAddDto = [[NOVAGLOBALAPINS0ServiceToAddDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0ServiceToAddDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0ServiceToAddDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0ServiceToAddDto autorelease]; return _nOVAGLOBALAPINS0ServiceToAddDto; } /** * Initialize this instance of NOVAGLOBALAPINS0ServiceToAddDto 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 NOVAGLOBALAPINS0ServiceToAddDto 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 NOVAGLOBALAPINS0ServiceToAddDto from an XML reader. The element to be read is * "serviceToAdd". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0ServiceToAddDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0ServiceToAddDto *_serviceToAddDto = 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 serviceToAdd."]; } } if (xmlStrcmp(BAD_CAST "serviceToAdd", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}serviceToAdd."); #endif _serviceToAddDto = (NOVAGLOBALAPINS0ServiceToAddDto *)[NOVAGLOBALAPINS0ServiceToAddDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}serviceToAdd."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceToAddDto. Expected element serviceToAdd. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceToAddDto. Expected element serviceToAdd. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _serviceToAddDto; } /** * Writes this NOVAGLOBALAPINS0ServiceToAddDto to XML under element name "serviceToAdd". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _serviceToAddDto The ServiceToAddDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0ServiceToAddDto 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 "serviceToAdd", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}serviceToAdd. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}serviceToAddDto for root element {}serviceToAdd..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}serviceToAddDto for root element {}serviceToAdd..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}serviceToAdd. 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 "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setServiceId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif __child = [NSDate readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subscriptionDate of type {http://www.w3.org/2001/XMLSchema}dateTime."); #endif [self setSubscriptionDate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam1: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam2: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam3: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self serviceId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}serviceId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}serviceId..."); #endif [[self serviceId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}serviceId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}serviceId."]; } } if ([self subscriptionDate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionDate..."); #endif [[self subscriptionDate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionDate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionDate."]; } } if ([self param1]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param1."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param1..."); #endif [[self param1] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param1..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param1."]; } } if ([self param2]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param2."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param2..."); #endif [[self param2] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param2..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param2."]; } } if ([self param3]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param3."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param3..."); #endif [[self param3] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param3..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param3."]; } } } @end /* implementation NOVAGLOBALAPINS0ServiceToAddDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0ServiceToAddDto_M */ #ifndef DEF_NOVAGLOBALAPINS0ServiceDto_M #define DEF_NOVAGLOBALAPINS0ServiceDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0ServiceDto /** * (no documentation provided) */ - (NSString *) serviceId { return _serviceId; } /** * (no documentation provided) */ - (void) setServiceId: (NSString *) newServiceId { [newServiceId retain]; [_serviceId release]; _serviceId = newServiceId; } /** * (no documentation provided) */ - (NSArray *) descriptions { return _descriptions; } /** * (no documentation provided) */ - (void) setDescriptions: (NSArray *) newDescriptions { [newDescriptions retain]; [_descriptions release]; _descriptions = newDescriptions; } - (void) dealloc { [self setServiceId: nil]; [self setDescriptions: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0ServiceDto *_nOVAGLOBALAPINS0ServiceDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0ServiceDto = (NOVAGLOBALAPINS0ServiceDto *) [NOVAGLOBALAPINS0ServiceDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0ServiceDto; } //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 NOVAGLOBALAPINS0ServiceDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0ServiceDto (JAXB) @end /*interface NOVAGLOBALAPINS0ServiceDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0ServiceDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0ServiceDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0ServiceDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0ServiceDto *_nOVAGLOBALAPINS0ServiceDto = [[NOVAGLOBALAPINS0ServiceDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0ServiceDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0ServiceDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0ServiceDto autorelease]; return _nOVAGLOBALAPINS0ServiceDto; } /** * Initialize this instance of NOVAGLOBALAPINS0ServiceDto 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 NOVAGLOBALAPINS0ServiceDto 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 NOVAGLOBALAPINS0ServiceDto from an XML reader. The element to be read is * "service". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0ServiceDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0ServiceDto *_serviceDto = 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 service."]; } } if (xmlStrcmp(BAD_CAST "service", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}service."); #endif _serviceDto = (NOVAGLOBALAPINS0ServiceDto *)[NOVAGLOBALAPINS0ServiceDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}service."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceDto. Expected element service. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0ServiceDto. Expected element service. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _serviceDto; } /** * Writes this NOVAGLOBALAPINS0ServiceDto to XML under element name "service". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _serviceDto The ServiceDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0ServiceDto 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 "service", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}service. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}serviceDto for root element {}service..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}serviceDto for root element {}service..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}service. 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 "serviceId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}serviceId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setServiceId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "descriptions", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}descriptions of type {}descriptionDto."); #endif __child = [NOVAGLOBALAPINS0DescriptionDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}descriptions of type {}descriptionDto."); #endif if ([self descriptions]) { [self setDescriptions: [[self descriptions] arrayByAddingObject: __child]]; } else { [self setDescriptions: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self serviceId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "serviceId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}serviceId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}serviceId..."); #endif [[self serviceId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}serviceId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}serviceId."]; } } if ([self descriptions]) { __enumerator = [[self descriptions] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "descriptions", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}descriptions."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}descriptions..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}descriptions..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}descriptions."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0ServiceDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0ServiceDto_M */ #ifndef DEF_NOVAGLOBALAPINS0OrganizationDto_M #define DEF_NOVAGLOBALAPINS0OrganizationDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0OrganizationDto /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } /** * (no documentation provided) */ - (NSString *) name { return _name; } /** * (no documentation provided) */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * (no documentation provided) */ - (NSString *) parentId { return _parentId; } /** * (no documentation provided) */ - (void) setParentId: (NSString *) newParentId { [newParentId retain]; [_parentId release]; _parentId = newParentId; } /** * (no documentation provided) */ - (NSString *) countryCode { return _countryCode; } /** * (no documentation provided) */ - (void) setCountryCode: (NSString *) newCountryCode { [newCountryCode retain]; [_countryCode release]; _countryCode = newCountryCode; } /** * (no documentation provided) */ - (NSString *) defaultCurrencyCode { return _defaultCurrencyCode; } /** * (no documentation provided) */ - (void) setDefaultCurrencyCode: (NSString *) newDefaultCurrencyCode { [newDefaultCurrencyCode retain]; [_defaultCurrencyCode release]; _defaultCurrencyCode = newDefaultCurrencyCode; } /** * (no documentation provided) */ - (NSString *) languageCode { return _languageCode; } /** * (no documentation provided) */ - (void) setLanguageCode: (NSString *) newLanguageCode { [newLanguageCode retain]; [_languageCode release]; _languageCode = newLanguageCode; } - (void) dealloc { [self setOrganizationId: nil]; [self setName: nil]; [self setParentId: nil]; [self setCountryCode: nil]; [self setDefaultCurrencyCode: nil]; [self setLanguageCode: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0OrganizationDto *_nOVAGLOBALAPINS0OrganizationDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0OrganizationDto = (NOVAGLOBALAPINS0OrganizationDto *) [NOVAGLOBALAPINS0OrganizationDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0OrganizationDto; } //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 NOVAGLOBALAPINS0OrganizationDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0OrganizationDto (JAXB) @end /*interface NOVAGLOBALAPINS0OrganizationDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0OrganizationDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0OrganizationDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0OrganizationDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0OrganizationDto *_nOVAGLOBALAPINS0OrganizationDto = [[NOVAGLOBALAPINS0OrganizationDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0OrganizationDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0OrganizationDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0OrganizationDto autorelease]; return _nOVAGLOBALAPINS0OrganizationDto; } /** * Initialize this instance of NOVAGLOBALAPINS0OrganizationDto 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 NOVAGLOBALAPINS0OrganizationDto 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 NOVAGLOBALAPINS0OrganizationDto from an XML reader. The element to be read is * "organization". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0OrganizationDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0OrganizationDto *_organizationDto = 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 organization."]; } } if (xmlStrcmp(BAD_CAST "organization", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}organization."); #endif _organizationDto = (NOVAGLOBALAPINS0OrganizationDto *)[NOVAGLOBALAPINS0OrganizationDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}organization."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OrganizationDto. Expected element organization. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OrganizationDto. Expected element organization. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _organizationDto; } /** * Writes this NOVAGLOBALAPINS0OrganizationDto to XML under element name "organization". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _organizationDto The OrganizationDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0OrganizationDto 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 "organization", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}organization. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}organizationDto for root element {}organization..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}organizationDto for root element {}organization..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}organization. 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 "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __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 {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}name of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "parentId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}parentId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}parentId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParentId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCountryCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "defaultCurrencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}defaultCurrencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}defaultCurrencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setDefaultCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "languageCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setLanguageCode: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } 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 parentId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "parentId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}parentId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}parentId..."); #endif [[self parentId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}parentId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}parentId."]; } } if ([self countryCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}countryCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}countryCode..."); #endif [[self countryCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}countryCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}countryCode."]; } } if ([self defaultCurrencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "defaultCurrencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}defaultCurrencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}defaultCurrencyCode..."); #endif [[self defaultCurrencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}defaultCurrencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}defaultCurrencyCode."]; } } if ([self languageCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "languageCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}languageCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}languageCode..."); #endif [[self languageCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}languageCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}languageCode."]; } } } @end /* implementation NOVAGLOBALAPINS0OrganizationDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0OrganizationDto_M */ #ifndef DEF_NOVAGLOBALAPINS0OfferDto_M #define DEF_NOVAGLOBALAPINS0OfferDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0OfferDto /** * (no documentation provided) */ - (NSString *) offerId { return _offerId; } /** * (no documentation provided) */ - (void) setOfferId: (NSString *) newOfferId { [newOfferId retain]; [_offerId release]; _offerId = newOfferId; } /** * (no documentation provided) */ - (NSArray *) descriptions { return _descriptions; } /** * (no documentation provided) */ - (void) setDescriptions: (NSArray *) newDescriptions { [newDescriptions retain]; [_descriptions release]; _descriptions = newDescriptions; } /** * (no documentation provided) */ - (NSArray *) services { return _services; } /** * (no documentation provided) */ - (void) setServices: (NSArray *) newServices { [newServices retain]; [_services release]; _services = newServices; } - (void) dealloc { [self setOfferId: nil]; [self setDescriptions: nil]; [self setServices: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0OfferDto *_nOVAGLOBALAPINS0OfferDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0OfferDto = (NOVAGLOBALAPINS0OfferDto *) [NOVAGLOBALAPINS0OfferDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0OfferDto; } //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 NOVAGLOBALAPINS0OfferDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0OfferDto (JAXB) @end /*interface NOVAGLOBALAPINS0OfferDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0OfferDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0OfferDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0OfferDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0OfferDto *_nOVAGLOBALAPINS0OfferDto = [[NOVAGLOBALAPINS0OfferDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0OfferDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0OfferDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0OfferDto autorelease]; return _nOVAGLOBALAPINS0OfferDto; } /** * Initialize this instance of NOVAGLOBALAPINS0OfferDto 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 NOVAGLOBALAPINS0OfferDto 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 NOVAGLOBALAPINS0OfferDto from an XML reader. The element to be read is * "offer". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0OfferDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0OfferDto *_offerDto = 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 offer."]; } } if (xmlStrcmp(BAD_CAST "offer", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}offer."); #endif _offerDto = (NOVAGLOBALAPINS0OfferDto *)[NOVAGLOBALAPINS0OfferDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}offer."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OfferDto. Expected element offer. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OfferDto. Expected element offer. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _offerDto; } /** * Writes this NOVAGLOBALAPINS0OfferDto to XML under element name "offer". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _offerDto The OfferDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0OfferDto 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 "offer", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}offer. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}offerDto for root element {}offer..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}offerDto for root element {}offer..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}offer. 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 "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOfferId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "descriptions", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}descriptions of type {}descriptionDto."); #endif __child = [NOVAGLOBALAPINS0DescriptionDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}descriptions of type {}descriptionDto."); #endif if ([self descriptions]) { [self setDescriptions: [[self descriptions] arrayByAddingObject: __child]]; } else { [self setDescriptions: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "services", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}services of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}services of type {http://www.w3.org/2001/XMLSchema}string."); #endif if ([self services]) { [self setServices: [[self services] arrayByAddingObject: __child]]; } else { [self setServices: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self offerId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}offerId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}offerId..."); #endif [[self offerId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}offerId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}offerId."]; } } if ([self descriptions]) { __enumerator = [[self descriptions] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "descriptions", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}descriptions."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}descriptions..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}descriptions..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}descriptions."]; } } //end item iterator. } if ([self services]) { __enumerator = [[self services] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "services", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}services."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}services..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}services..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}services."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0OfferDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0OfferDto_M */ #ifndef DEF_NOVAGLOBALAPINS0OfferPricePlanDto_M #define DEF_NOVAGLOBALAPINS0OfferPricePlanDto_M /** * @author Edward P. Legaspi @since Oct 11, 2013 */ @implementation NOVAGLOBALAPINS0OfferPricePlanDto /** * (no documentation provided) */ - (NSString *) offerId { return _offerId; } /** * (no documentation provided) */ - (void) setOfferId: (NSString *) newOfferId { [newOfferId retain]; [_offerId release]; _offerId = newOfferId; } /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } /** * (no documentation provided) */ - (NSString *) taxId { return _taxId; } /** * (no documentation provided) */ - (void) setTaxId: (NSString *) newTaxId { [newTaxId retain]; [_taxId release]; _taxId = newTaxId; } /** * (no documentation provided) */ - (BOOL *) subscriptionProrata { return _subscriptionProrata; } /** * (no documentation provided) */ - (void) setSubscriptionProrata: (BOOL *) newSubscriptionProrata { if (_subscriptionProrata != NULL) { free(_subscriptionProrata); } _subscriptionProrata = newSubscriptionProrata; } /** * (no documentation provided) */ - (BOOL *) terminationProrata { return _terminationProrata; } /** * (no documentation provided) */ - (void) setTerminationProrata: (BOOL *) newTerminationProrata { if (_terminationProrata != NULL) { free(_terminationProrata); } _terminationProrata = newTerminationProrata; } /** * (no documentation provided) */ - (BOOL *) applyInAdvance { return _applyInAdvance; } /** * (no documentation provided) */ - (void) setApplyInAdvance: (BOOL *) newApplyInAdvance { if (_applyInAdvance != NULL) { free(_applyInAdvance); } _applyInAdvance = newApplyInAdvance; } /** * (no documentation provided) */ - (NSString *) param1 { return _param1; } /** * (no documentation provided) */ - (void) setParam1: (NSString *) newParam1 { [newParam1 retain]; [_param1 release]; _param1 = newParam1; } /** * (no documentation provided) */ - (NSString *) param2 { return _param2; } /** * (no documentation provided) */ - (void) setParam2: (NSString *) newParam2 { [newParam2 retain]; [_param2 release]; _param2 = newParam2; } /** * (no documentation provided) */ - (NSString *) param3 { return _param3; } /** * (no documentation provided) */ - (void) setParam3: (NSString *) newParam3 { [newParam3 retain]; [_param3 release]; _param3 = newParam3; } /** * (no documentation provided) */ - (int *) billingPeriod { return _billingPeriod; } /** * (no documentation provided) */ - (void) setBillingPeriod: (int *) newBillingPeriod { if (_billingPeriod != NULL) { free(_billingPeriod); } _billingPeriod = newBillingPeriod; } /** * (no documentation provided) */ - (NSArray *) recurringCharges { return _recurringCharges; } /** * (no documentation provided) */ - (void) setRecurringCharges: (NSArray *) newRecurringCharges { [newRecurringCharges retain]; [_recurringCharges release]; _recurringCharges = newRecurringCharges; } /** * (no documentation provided) */ - (NSString *) usageUnit { return _usageUnit; } /** * (no documentation provided) */ - (void) setUsageUnit: (NSString *) newUsageUnit { [newUsageUnit retain]; [_usageUnit release]; _usageUnit = newUsageUnit; } /** * (no documentation provided) */ - (NSArray *) usageCharges { return _usageCharges; } /** * (no documentation provided) */ - (void) setUsageCharges: (NSArray *) newUsageCharges { [newUsageCharges retain]; [_usageCharges release]; _usageCharges = newUsageCharges; } /** * (no documentation provided) */ - (NSArray *) subscriptionFees { return _subscriptionFees; } /** * (no documentation provided) */ - (void) setSubscriptionFees: (NSArray *) newSubscriptionFees { [newSubscriptionFees retain]; [_subscriptionFees release]; _subscriptionFees = newSubscriptionFees; } /** * (no documentation provided) */ - (NSArray *) terminationFees { return _terminationFees; } /** * (no documentation provided) */ - (void) setTerminationFees: (NSArray *) newTerminationFees { [newTerminationFees retain]; [_terminationFees release]; _terminationFees = newTerminationFees; } - (void) dealloc { [self setOfferId: nil]; [self setOrganizationId: nil]; [self setTaxId: nil]; [self setSubscriptionProrata: NULL]; [self setTerminationProrata: NULL]; [self setApplyInAdvance: NULL]; [self setParam1: nil]; [self setParam2: nil]; [self setParam3: nil]; [self setBillingPeriod: NULL]; [self setRecurringCharges: nil]; [self setUsageUnit: nil]; [self setUsageCharges: nil]; [self setSubscriptionFees: nil]; [self setTerminationFees: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0OfferPricePlanDto *_nOVAGLOBALAPINS0OfferPricePlanDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0OfferPricePlanDto = (NOVAGLOBALAPINS0OfferPricePlanDto *) [NOVAGLOBALAPINS0OfferPricePlanDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0OfferPricePlanDto; } //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 NOVAGLOBALAPINS0OfferPricePlanDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0OfferPricePlanDto (JAXB) @end /*interface NOVAGLOBALAPINS0OfferPricePlanDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0OfferPricePlanDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0OfferPricePlanDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0OfferPricePlanDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0OfferPricePlanDto *_nOVAGLOBALAPINS0OfferPricePlanDto = [[NOVAGLOBALAPINS0OfferPricePlanDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0OfferPricePlanDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0OfferPricePlanDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0OfferPricePlanDto autorelease]; return _nOVAGLOBALAPINS0OfferPricePlanDto; } /** * Initialize this instance of NOVAGLOBALAPINS0OfferPricePlanDto 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 NOVAGLOBALAPINS0OfferPricePlanDto 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 NOVAGLOBALAPINS0OfferPricePlanDto from an XML reader. The element to be read is * "offerPricePlan". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0OfferPricePlanDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0OfferPricePlanDto *_offerPricePlanDto = 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 offerPricePlan."]; } } if (xmlStrcmp(BAD_CAST "offerPricePlan", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}offerPricePlan."); #endif _offerPricePlanDto = (NOVAGLOBALAPINS0OfferPricePlanDto *)[NOVAGLOBALAPINS0OfferPricePlanDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}offerPricePlan."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OfferPricePlanDto. Expected element offerPricePlan. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0OfferPricePlanDto. Expected element offerPricePlan. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _offerPricePlanDto; } /** * Writes this NOVAGLOBALAPINS0OfferPricePlanDto to XML under element name "offerPricePlan". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _offerPricePlanDto The OfferPricePlanDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0OfferPricePlanDto 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 "offerPricePlan", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}offerPricePlan. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}offerPricePlanDto for root element {}offerPricePlan..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}offerPricePlanDto for root element {}offerPricePlan..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}offerPricePlan. 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 "offerId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}offerId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOfferId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "taxId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}taxId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setTaxId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionProrata", 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 setSubscriptionProrata: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationProrata", 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 setTerminationProrata: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "applyInAdvance", 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 setApplyInAdvance: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param1", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param1 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam1: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam2: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "param3", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}param3 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setParam3: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "billingPeriod", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setBillingPeriod: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "recurringCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}recurringCharges of type {}recurringChargeDto."); #endif __child = [NOVAGLOBALAPINS0RecurringChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}recurringCharges of type {}recurringChargeDto."); #endif if ([self recurringCharges]) { [self setRecurringCharges: [[self recurringCharges] arrayByAddingObject: __child]]; } else { [self setRecurringCharges: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageUnit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}usageUnit of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUsageUnit: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "usageCharges", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}usageCharges of type {}usageChargeDto."); #endif __child = [NOVAGLOBALAPINS0UsageChargeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}usageCharges of type {}usageChargeDto."); #endif if ([self usageCharges]) { [self setUsageCharges: [[self usageCharges] arrayByAddingObject: __child]]; } else { [self setUsageCharges: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subscriptionFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subscriptionFees of type {}subscriptionFeeDto."); #endif __child = [NOVAGLOBALAPINS0SubscriptionFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subscriptionFees of type {}subscriptionFeeDto."); #endif if ([self subscriptionFees]) { [self setSubscriptionFees: [[self subscriptionFees] arrayByAddingObject: __child]]; } else { [self setSubscriptionFees: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "terminationFees", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}terminationFees of type {}terminationFeeDto."); #endif __child = [NOVAGLOBALAPINS0TerminationFeeDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}terminationFees of type {}terminationFeeDto."); #endif if ([self terminationFees]) { [self setTerminationFees: [[self terminationFees] arrayByAddingObject: __child]]; } else { [self setTerminationFees: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self offerId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "offerId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}offerId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}offerId..."); #endif [[self offerId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}offerId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}offerId."]; } } if ([self organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } if ([self taxId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "taxId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}taxId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}taxId..."); #endif [[self taxId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}taxId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}taxId."]; } } if ([self subscriptionProrata] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionProrata", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionProrata."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionProrata..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self subscriptionProrata]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionProrata..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}subscriptionProrata."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionProrata."]; } } if ([self terminationProrata] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationProrata", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}terminationProrata."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}terminationProrata..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self terminationProrata]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}terminationProrata..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}terminationProrata."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}terminationProrata."]; } } if ([self applyInAdvance] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "applyInAdvance", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}applyInAdvance."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}applyInAdvance..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self applyInAdvance]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}applyInAdvance..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}applyInAdvance."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}applyInAdvance."]; } } if ([self param1]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param1", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param1."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param1..."); #endif [[self param1] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param1..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param1."]; } } if ([self param2]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param2", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param2."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param2..."); #endif [[self param2] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param2..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param2."]; } } if ([self param3]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "param3", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}param3."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}param3..."); #endif [[self param3] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}param3..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}param3."]; } } if ([self billingPeriod] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "billingPeriod", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}billingPeriod."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}billingPeriod..."); #endif status = xmlTextWriterWriteIntType(writer, [self billingPeriod]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}billingPeriod..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}billingPeriod."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}billingPeriod."]; } } if ([self recurringCharges]) { __enumerator = [[self recurringCharges] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "recurringCharges", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}recurringCharges."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}recurringCharges..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}recurringCharges..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}recurringCharges."]; } } //end item iterator. } if ([self usageUnit]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageUnit", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}usageUnit."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}usageUnit..."); #endif [[self usageUnit] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}usageUnit..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}usageUnit."]; } } if ([self usageCharges]) { __enumerator = [[self usageCharges] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "usageCharges", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}usageCharges."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}usageCharges..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}usageCharges..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}usageCharges."]; } } //end item iterator. } if ([self subscriptionFees]) { __enumerator = [[self subscriptionFees] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subscriptionFees", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subscriptionFees."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subscriptionFees..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subscriptionFees..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subscriptionFees."]; } } //end item iterator. } if ([self terminationFees]) { __enumerator = [[self terminationFees] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "terminationFees", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}terminationFees."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}terminationFees..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}terminationFees..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}terminationFees."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0OfferPricePlanDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0OfferPricePlanDto_M */ #ifndef DEF_NOVAGLOBALAPINS0CreditLimitDto_M #define DEF_NOVAGLOBALAPINS0CreditLimitDto_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0CreditLimitDto /** * (no documentation provided) */ - (NSString *) organizationId { return _organizationId; } /** * (no documentation provided) */ - (void) setOrganizationId: (NSString *) newOrganizationId { [newOrganizationId retain]; [_organizationId release]; _organizationId = newOrganizationId; } /** * (no documentation provided) */ - (NSDecimalNumber *) creditLimit { return _creditLimit; } /** * (no documentation provided) */ - (void) setCreditLimit: (NSDecimalNumber *) newCreditLimit { [newCreditLimit retain]; [_creditLimit release]; _creditLimit = newCreditLimit; } - (void) dealloc { [self setOrganizationId: nil]; [self setCreditLimit: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0CreditLimitDto *_nOVAGLOBALAPINS0CreditLimitDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0CreditLimitDto = (NOVAGLOBALAPINS0CreditLimitDto *) [NOVAGLOBALAPINS0CreditLimitDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0CreditLimitDto; } //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 NOVAGLOBALAPINS0CreditLimitDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0CreditLimitDto (JAXB) @end /*interface NOVAGLOBALAPINS0CreditLimitDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0CreditLimitDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0CreditLimitDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0CreditLimitDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0CreditLimitDto *_nOVAGLOBALAPINS0CreditLimitDto = [[NOVAGLOBALAPINS0CreditLimitDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0CreditLimitDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0CreditLimitDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0CreditLimitDto autorelease]; return _nOVAGLOBALAPINS0CreditLimitDto; } /** * Initialize this instance of NOVAGLOBALAPINS0CreditLimitDto 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 NOVAGLOBALAPINS0CreditLimitDto 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 NOVAGLOBALAPINS0CreditLimitDto from an XML reader. The element to be read is * "creditLimit". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0CreditLimitDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0CreditLimitDto *_creditLimitDto = 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 creditLimit."]; } } if (xmlStrcmp(BAD_CAST "creditLimit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}creditLimit."); #endif _creditLimitDto = (NOVAGLOBALAPINS0CreditLimitDto *)[NOVAGLOBALAPINS0CreditLimitDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}creditLimit."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CreditLimitDto. Expected element creditLimit. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CreditLimitDto. Expected element creditLimit. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _creditLimitDto; } /** * Writes this NOVAGLOBALAPINS0CreditLimitDto to XML under element name "creditLimit". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _creditLimitDto The CreditLimitDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0CreditLimitDto 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 "creditLimit", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}creditLimit. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}creditLimitDto for root element {}creditLimit..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}creditLimitDto for root element {}creditLimit..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}creditLimit. 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 "organizationId", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}organizationId of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOrganizationId: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditLimit", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}creditLimit of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif __child = [NSDecimalNumber readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}creditLimit of type {http://www.w3.org/2001/XMLSchema}decimal."); #endif [self setCreditLimit: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self organizationId]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "organizationId", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}organizationId."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}organizationId..."); #endif [[self organizationId] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}organizationId..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}organizationId."]; } } if ([self creditLimit]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditLimit", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creditLimit."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creditLimit..."); #endif [[self creditLimit] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creditLimit..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creditLimit."]; } } } @end /* implementation NOVAGLOBALAPINS0CreditLimitDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0CreditLimitDto_M */ #ifndef DEF_NOVAGLOBALAPINS0CountryDto_M #define DEF_NOVAGLOBALAPINS0CountryDto_M /** * @author Edward P. Legaspi @since Oct 4, 2013 */ @implementation NOVAGLOBALAPINS0CountryDto /** * (no documentation provided) */ - (NSString *) countryCode { return _countryCode; } /** * (no documentation provided) */ - (void) setCountryCode: (NSString *) newCountryCode { [newCountryCode retain]; [_countryCode release]; _countryCode = newCountryCode; } /** * (no documentation provided) */ - (NSString *) name { return _name; } /** * (no documentation provided) */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * (no documentation provided) */ - (NSString *) currencyCode { return _currencyCode; } /** * (no documentation provided) */ - (void) setCurrencyCode: (NSString *) newCurrencyCode { [newCurrencyCode retain]; [_currencyCode release]; _currencyCode = newCurrencyCode; } /** * (no documentation provided) */ - (NSString *) languageCode { return _languageCode; } /** * (no documentation provided) */ - (void) setLanguageCode: (NSString *) newLanguageCode { [newLanguageCode retain]; [_languageCode release]; _languageCode = newLanguageCode; } - (void) dealloc { [self setCountryCode: nil]; [self setName: nil]; [self setCurrencyCode: nil]; [self setLanguageCode: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0CountryDto *_nOVAGLOBALAPINS0CountryDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0CountryDto = (NOVAGLOBALAPINS0CountryDto *) [NOVAGLOBALAPINS0CountryDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0CountryDto; } //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 NOVAGLOBALAPINS0CountryDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0CountryDto (JAXB) @end /*interface NOVAGLOBALAPINS0CountryDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0CountryDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0CountryDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0CountryDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0CountryDto *_nOVAGLOBALAPINS0CountryDto = [[NOVAGLOBALAPINS0CountryDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0CountryDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0CountryDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0CountryDto autorelease]; return _nOVAGLOBALAPINS0CountryDto; } /** * Initialize this instance of NOVAGLOBALAPINS0CountryDto 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 NOVAGLOBALAPINS0CountryDto 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 NOVAGLOBALAPINS0CountryDto from an XML reader. The element to be read is * "country". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0CountryDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0CountryDto *_countryDto = 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 country."]; } } if (xmlStrcmp(BAD_CAST "country", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}country."); #endif _countryDto = (NOVAGLOBALAPINS0CountryDto *)[NOVAGLOBALAPINS0CountryDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}country."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryDto. Expected element country. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0CountryDto. Expected element country. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _countryDto; } /** * Writes this NOVAGLOBALAPINS0CountryDto to XML under element name "country". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _countryDto The CountryDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0CountryDto 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 "country", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}country. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}countryDto for root element {}country..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}countryDto for root element {}country..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}country. 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 "countryCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}countryCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCountryCode: __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 {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}name of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "currencyCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}currencyCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCurrencyCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "languageCode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}languageCode of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setLanguageCode: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self countryCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "countryCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}countryCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}countryCode..."); #endif [[self countryCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}countryCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}countryCode."]; } } 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 currencyCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "currencyCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}currencyCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}currencyCode..."); #endif [[self currencyCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}currencyCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}currencyCode."]; } } if ([self languageCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "languageCode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}languageCode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}languageCode..."); #endif [[self languageCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}languageCode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}languageCode."]; } } } @end /* implementation NOVAGLOBALAPINS0CountryDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0CountryDto_M */ #ifndef DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto_M #define DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto_M /** * @author Edward P. Legaspi @since Nov 13, 2013 */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto /** * (no documentation provided) */ - (NSArray *) servicesToTerminate { return _servicesToTerminate; } /** * (no documentation provided) */ - (void) setServicesToTerminate: (NSArray *) newServicesToTerminate { [newServicesToTerminate retain]; [_servicesToTerminate release]; _servicesToTerminate = newServicesToTerminate; } - (void) dealloc { [self setServicesToTerminate: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto *) [NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto; } //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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto */ /** * Internal, private interface for JAXB reading and writing. */ @interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto (JAXB) @end /*interface NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto (JAXB) /** * Read an instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto from an XML reader. * * @param reader The reader. * @return An instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto *_nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto = [[NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto alloc] init]; NS_DURING { [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto initWithReader: reader]; } NS_HANDLER { _nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto = nil; [localException raise]; } NS_ENDHANDLER [_nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto autorelease]; return _nOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto; } /** * Initialize this instance of NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto 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 NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto from an XML reader. The element to be read is * "subscriptionWithCreditLimitUpdateDto". * * @param reader The XML reader. * @return The NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto *_subscriptionWithCreditLimitUpdateDto = 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 subscriptionWithCreditLimitUpdateDto."]; } } if (xmlStrcmp(BAD_CAST "subscriptionWithCreditLimitUpdateDto", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {}subscriptionWithCreditLimitUpdateDto."); #endif _subscriptionWithCreditLimitUpdateDto = (NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto *)[NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {}subscriptionWithCreditLimitUpdateDto."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto. Expected element subscriptionWithCreditLimitUpdateDto. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto. Expected element subscriptionWithCreditLimitUpdateDto. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _subscriptionWithCreditLimitUpdateDto; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto to XML under element name "subscriptionWithCreditLimitUpdateDto". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _subscriptionWithCreditLimitUpdateDto The SubscriptionWithCreditLimitUpdateDto to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto 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 "subscriptionWithCreditLimitUpdateDto", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {}subscriptionWithCreditLimitUpdateDto. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {}subscriptionWithCreditLimitUpdateDto for root element {}subscriptionWithCreditLimitUpdateDto..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {}subscriptionWithCreditLimitUpdateDto for root element {}subscriptionWithCreditLimitUpdateDto..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {}subscriptionWithCreditLimitUpdateDto. 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 "servicesToTerminate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}servicesToTerminate of type {}serviceToTerminateDto."); #endif __child = [NOVAGLOBALAPINS0ServiceToTerminateDto readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}servicesToTerminate of type {}serviceToTerminateDto."); #endif if ([self servicesToTerminate]) { [self setServicesToTerminate: [[self servicesToTerminate] arrayByAddingObject: __child]]; } else { [self setServicesToTerminate: [NSArray arrayWithObject: __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; id __item_copy; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self servicesToTerminate]) { __enumerator = [[self servicesToTerminate] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "servicesToTerminate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}servicesToTerminate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}servicesToTerminate..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}servicesToTerminate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}servicesToTerminate."]; } } //end item iterator. } } @end /* implementation NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto (JAXB) */ #endif /* DEF_NOVAGLOBALAPINS0SubscriptionWithCreditLimitUpdateDto_M */