) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCBillingReport *_billingReport = 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 {http://eurotech.com/edc/2.0}billingReport."];
}
}
if (xmlStrcmp(BAD_CAST "billingReport", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}billingReport.");
#endif
_billingReport = (EDC_APIS_CLIENTEDCBillingReport *)[EDC_APIS_CLIENTEDCBillingReport readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}billingReport.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCBillingReport. Expected element {http://eurotech.com/edc/2.0}billingReport. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCBillingReport. Expected element {http://eurotech.com/edc/2.0}billingReport. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _billingReport;
}
/**
* Writes this EDC_APIS_CLIENTEDCBillingReport to XML under element name "{http://eurotech.com/edc/2.0}billingReport".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _billingReport The BillingReport to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCBillingReport 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, BAD_CAST "edc", BAD_CAST "billingReport", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}billingReport. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}billingReport...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}billingReport'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}billingReport...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}billingReport for root element {http://eurotech.com/edc/2.0}billingReport...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}billingReport for root element {http://eurotech.com/edc/2.0}billingReport...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}billingReport. 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 "BillingReportItems", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/edc/2.0}BillingReportItems...");
#endif
//start wrapper element "{http://eurotech.com/edc/2.0}BillingReportItems"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "BillingReportItem", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}BillingReportItem of type {http://eurotech.com/edc/2.0}billingReportItem.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[EDC_APIS_CLIENTEDCBillingReportItem alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [EDC_APIS_CLIENTEDCBillingReportItem readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}BillingReportItem of type {http://eurotech.com/edc/2.0}billingReportItem.");
#endif
if ([self reportItemList]) {
[self setReportItemList: [[self reportItemList] arrayByAddingObject: __child]];
}
else {
[self setReportItemList: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/edc/2.0}BillingReportItems...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setReportItemList: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 reportItemList]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "BillingReportItems", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/edc/2.0}BillingReportItems."];
}
__enumerator = [[self reportItemList] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "BillingReportItem", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}BillingReportItem."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}BillingReportItem...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}BillingReportItem...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}BillingReportItem."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/edc/2.0}BillingReportItems."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCBillingReport (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCBillingReport_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDevice_M
#define DEF_EDC_APIS_CLIENTEDCDevice_M
/**
* Device is an object representing a device or gateway connected to the Everyware platform.
* The Device object contains several useful information on the connected object including its
* connection status and its profile information.
* Each devices is defined in the context of an Everyware Account whose ID is specified in the Device accountId attribute.
*
* Upon connecting to the Everyware platform, each device will publish a birth certification announcing its characterinstics. The device profile attributes can be divided into few groups.
* The device identifiers are attributes which uniquely identify the device. Those include: id, clientId, displayName, serialNumber, IMEI, IMSU, ICCID. The device displayName can be updated by the
* Account administrator.
* The device connection information are attributes related to the device connection. Those include: status, lastEventOn, lastEventType, connectionIp, gpsLatitude, gpsLongitude.
* The device version information are attributes related to the device model and version information. Those include: modelId, biosVersion, firmwareVersion, osVersion, jvmVersion, osgiFrameworkVersion,
* esfVersion, applicationIdentifiers.
* The value of the device custom attributes 1-5 are set by the system administrator as additional string attributes that can be associated to the device.
* All other device attributes are defined as device extended properties.
* When loading or searching a device using the Everyware REST APIs, a fetch parameter can be used to control whether the device extended attributes should be loaded and returned.
*/
@implementation EDC_APIS_CLIENTEDCDevice
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSString *) identifier
{
return _identifier;
}
/**
* (no documentation provided)
*/
- (void) setIdentifier: (NSString *) newIdentifier
{
[newIdentifier retain];
[_identifier release];
_identifier = newIdentifier;
}
/**
* (no documentation provided)
*/
- (NSString *) clientId
{
return _clientId;
}
/**
* (no documentation provided)
*/
- (void) setClientId: (NSString *) newClientId
{
[newClientId retain];
[_clientId release];
_clientId = newClientId;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceStatus *) status
{
return _status;
}
/**
* (no documentation provided)
*/
- (void) setStatus: (enum EDC_APIS_CLIENTEDCDeviceStatus *) newStatus
{
if (_status != NULL) {
free(_status);
}
_status = newStatus;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceConnectionStatus *) connectionStatus
{
return _connectionStatus;
}
/**
* (no documentation provided)
*/
- (void) setConnectionStatus: (enum EDC_APIS_CLIENTEDCDeviceConnectionStatus *) newConnectionStatus
{
if (_connectionStatus != NULL) {
free(_connectionStatus);
}
_connectionStatus = newConnectionStatus;
}
/**
* (no documentation provided)
*/
- (NSDate *) createdOn
{
return _createdOn;
}
/**
* (no documentation provided)
*/
- (void) setCreatedOn: (NSDate *) newCreatedOn
{
[newCreatedOn retain];
[_createdOn release];
_createdOn = newCreatedOn;
}
/**
* (no documentation provided)
*/
- (long long) createdBy
{
return _createdBy;
}
/**
* (no documentation provided)
*/
- (void) setCreatedBy: (long long) newCreatedBy
{
_createdBy = newCreatedBy;
}
/**
* (no documentation provided)
*/
- (NSDate *) lastEventOn
{
return _lastEventOn;
}
/**
* (no documentation provided)
*/
- (void) setLastEventOn: (NSDate *) newLastEventOn
{
[newLastEventOn retain];
[_lastEventOn release];
_lastEventOn = newLastEventOn;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceEventType *) lastEventType
{
return _lastEventType;
}
/**
* (no documentation provided)
*/
- (void) setLastEventType: (enum EDC_APIS_CLIENTEDCDeviceEventType *) newLastEventType
{
if (_lastEventType != NULL) {
free(_lastEventType);
}
_lastEventType = newLastEventType;
}
/**
* (no documentation provided)
*/
- (NSString *) displayName
{
return _displayName;
}
/**
* (no documentation provided)
*/
- (void) setDisplayName: (NSString *) newDisplayName
{
[newDisplayName retain];
[_displayName release];
_displayName = newDisplayName;
}
/**
* (no documentation provided)
*/
- (NSString *) serialNumber
{
return _serialNumber;
}
/**
* (no documentation provided)
*/
- (void) setSerialNumber: (NSString *) newSerialNumber
{
[newSerialNumber retain];
[_serialNumber release];
_serialNumber = newSerialNumber;
}
/**
* (no documentation provided)
*/
- (NSString *) imei
{
return _imei;
}
/**
* (no documentation provided)
*/
- (void) setImei: (NSString *) newImei
{
[newImei retain];
[_imei release];
_imei = newImei;
}
/**
* (no documentation provided)
*/
- (NSString *) imsi
{
return _imsi;
}
/**
* (no documentation provided)
*/
- (void) setImsi: (NSString *) newImsi
{
[newImsi retain];
[_imsi release];
_imsi = newImsi;
}
/**
* (no documentation provided)
*/
- (NSString *) iccid
{
return _iccid;
}
/**
* (no documentation provided)
*/
- (void) setIccid: (NSString *) newIccid
{
[newIccid retain];
[_iccid release];
_iccid = newIccid;
}
/**
* (no documentation provided)
*/
- (NSString *) modelId
{
return _modelId;
}
/**
* (no documentation provided)
*/
- (void) setModelId: (NSString *) newModelId
{
[newModelId retain];
[_modelId release];
_modelId = newModelId;
}
/**
* (no documentation provided)
*/
- (NSString *) connectionIp
{
return _connectionIp;
}
/**
* (no documentation provided)
*/
- (void) setConnectionIp: (NSString *) newConnectionIp
{
[newConnectionIp retain];
[_connectionIp release];
_connectionIp = newConnectionIp;
}
/**
* (no documentation provided)
*/
- (NSString *) biosVersion
{
return _biosVersion;
}
/**
* (no documentation provided)
*/
- (void) setBiosVersion: (NSString *) newBiosVersion
{
[newBiosVersion retain];
[_biosVersion release];
_biosVersion = newBiosVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) firmwareVersion
{
return _firmwareVersion;
}
/**
* (no documentation provided)
*/
- (void) setFirmwareVersion: (NSString *) newFirmwareVersion
{
[newFirmwareVersion retain];
[_firmwareVersion release];
_firmwareVersion = newFirmwareVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) osVersion
{
return _osVersion;
}
/**
* (no documentation provided)
*/
- (void) setOsVersion: (NSString *) newOsVersion
{
[newOsVersion retain];
[_osVersion release];
_osVersion = newOsVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) jvmVersion
{
return _jvmVersion;
}
/**
* (no documentation provided)
*/
- (void) setJvmVersion: (NSString *) newJvmVersion
{
[newJvmVersion retain];
[_jvmVersion release];
_jvmVersion = newJvmVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) osgiFrameworkVersion
{
return _osgiFrameworkVersion;
}
/**
* (no documentation provided)
*/
- (void) setOsgiFrameworkVersion: (NSString *) newOsgiFrameworkVersion
{
[newOsgiFrameworkVersion retain];
[_osgiFrameworkVersion release];
_osgiFrameworkVersion = newOsgiFrameworkVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) esfVersion
{
return _esfVersion;
}
/**
* (no documentation provided)
*/
- (void) setEsfVersion: (NSString *) newEsfVersion
{
[newEsfVersion retain];
[_esfVersion release];
_esfVersion = newEsfVersion;
}
/**
* (no documentation provided)
*/
- (NSString *) applicationIdentifiers
{
return _applicationIdentifiers;
}
/**
* (no documentation provided)
*/
- (void) setApplicationIdentifiers: (NSString *) newApplicationIdentifiers
{
[newApplicationIdentifiers retain];
[_applicationIdentifiers release];
_applicationIdentifiers = newApplicationIdentifiers;
}
/**
* (no documentation provided)
*/
- (NSString *) acceptEncoding
{
return _acceptEncoding;
}
/**
* (no documentation provided)
*/
- (void) setAcceptEncoding: (NSString *) newAcceptEncoding
{
[newAcceptEncoding retain];
[_acceptEncoding release];
_acceptEncoding = newAcceptEncoding;
}
/**
* (no documentation provided)
*/
- (double *) gpsLatitude
{
return _gpsLatitude;
}
/**
* (no documentation provided)
*/
- (void) setGpsLatitude: (double *) newGpsLatitude
{
if (_gpsLatitude != NULL) {
free(_gpsLatitude);
}
_gpsLatitude = newGpsLatitude;
}
/**
* (no documentation provided)
*/
- (double *) gpsLongitude
{
return _gpsLongitude;
}
/**
* (no documentation provided)
*/
- (void) setGpsLongitude: (double *) newGpsLongitude
{
if (_gpsLongitude != NULL) {
free(_gpsLongitude);
}
_gpsLongitude = newGpsLongitude;
}
/**
* (no documentation provided)
*/
- (NSString *) customAttribute1
{
return _customAttribute1;
}
/**
* (no documentation provided)
*/
- (void) setCustomAttribute1: (NSString *) newCustomAttribute1
{
[newCustomAttribute1 retain];
[_customAttribute1 release];
_customAttribute1 = newCustomAttribute1;
}
/**
* (no documentation provided)
*/
- (NSString *) customAttribute2
{
return _customAttribute2;
}
/**
* (no documentation provided)
*/
- (void) setCustomAttribute2: (NSString *) newCustomAttribute2
{
[newCustomAttribute2 retain];
[_customAttribute2 release];
_customAttribute2 = newCustomAttribute2;
}
/**
* (no documentation provided)
*/
- (NSString *) customAttribute3
{
return _customAttribute3;
}
/**
* (no documentation provided)
*/
- (void) setCustomAttribute3: (NSString *) newCustomAttribute3
{
[newCustomAttribute3 retain];
[_customAttribute3 release];
_customAttribute3 = newCustomAttribute3;
}
/**
* (no documentation provided)
*/
- (NSString *) customAttribute4
{
return _customAttribute4;
}
/**
* (no documentation provided)
*/
- (void) setCustomAttribute4: (NSString *) newCustomAttribute4
{
[newCustomAttribute4 retain];
[_customAttribute4 release];
_customAttribute4 = newCustomAttribute4;
}
/**
* (no documentation provided)
*/
- (NSString *) customAttribute5
{
return _customAttribute5;
}
/**
* (no documentation provided)
*/
- (void) setCustomAttribute5: (NSString *) newCustomAttribute5
{
[newCustomAttribute5 retain];
[_customAttribute5 release];
_customAttribute5 = newCustomAttribute5;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (int) optlock
{
return _optlock;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (void) setOptlock: (int) newOptlock
{
_optlock = newOptlock;
}
/**
* (no documentation provided)
*/
- (long long *) uptime
{
return _uptime;
}
/**
* (no documentation provided)
*/
- (void) setUptime: (long long *) newUptime
{
if (_uptime != NULL) {
free(_uptime);
}
_uptime = newUptime;
}
/**
* (no documentation provided)
*/
- (NSString *) modelName
{
return _modelName;
}
/**
* (no documentation provided)
*/
- (void) setModelName: (NSString *) newModelName
{
[newModelName retain];
[_modelName release];
_modelName = newModelName;
}
/**
* (no documentation provided)
*/
- (NSString *) partNumber
{
return _partNumber;
}
/**
* (no documentation provided)
*/
- (void) setPartNumber: (NSString *) newPartNumber
{
[newPartNumber retain];
[_partNumber release];
_partNumber = newPartNumber;
}
/**
* (no documentation provided)
*/
- (NSString *) availableProcessors
{
return _availableProcessors;
}
/**
* (no documentation provided)
*/
- (void) setAvailableProcessors: (NSString *) newAvailableProcessors
{
[newAvailableProcessors retain];
[_availableProcessors release];
_availableProcessors = newAvailableProcessors;
}
/**
* (no documentation provided)
*/
- (NSString *) totalMemory
{
return _totalMemory;
}
/**
* (no documentation provided)
*/
- (void) setTotalMemory: (NSString *) newTotalMemory
{
[newTotalMemory retain];
[_totalMemory release];
_totalMemory = newTotalMemory;
}
/**
* (no documentation provided)
*/
- (NSString *) os
{
return _os;
}
/**
* (no documentation provided)
*/
- (void) setOs: (NSString *) newOs
{
[newOs retain];
[_os release];
_os = newOs;
}
/**
* (no documentation provided)
*/
- (NSString *) osArch
{
return _osArch;
}
/**
* (no documentation provided)
*/
- (void) setOsArch: (NSString *) newOsArch
{
[newOsArch retain];
[_osArch release];
_osArch = newOsArch;
}
/**
* (no documentation provided)
*/
- (NSString *) jvmName
{
return _jvmName;
}
/**
* (no documentation provided)
*/
- (void) setJvmName: (NSString *) newJvmName
{
[newJvmName retain];
[_jvmName release];
_jvmName = newJvmName;
}
/**
* (no documentation provided)
*/
- (NSString *) jvmProfile
{
return _jvmProfile;
}
/**
* (no documentation provided)
*/
- (void) setJvmProfile: (NSString *) newJvmProfile
{
[newJvmProfile retain];
[_jvmProfile release];
_jvmProfile = newJvmProfile;
}
/**
* (no documentation provided)
*/
- (NSString *) osgiFramework
{
return _osgiFramework;
}
/**
* (no documentation provided)
*/
- (void) setOsgiFramework: (NSString *) newOsgiFramework
{
[newOsgiFramework retain];
[_osgiFramework release];
_osgiFramework = newOsgiFramework;
}
/**
* (no documentation provided)
*/
- (NSString *) connectionInterface
{
return _connectionInterface;
}
/**
* (no documentation provided)
*/
- (void) setConnectionInterface: (NSString *) newConnectionInterface
{
[newConnectionInterface retain];
[_connectionInterface release];
_connectionInterface = newConnectionInterface;
}
/**
* (no documentation provided)
*/
- (double *) gpsAltitude
{
return _gpsAltitude;
}
/**
* (no documentation provided)
*/
- (void) setGpsAltitude: (double *) newGpsAltitude
{
if (_gpsAltitude != NULL) {
free(_gpsAltitude);
}
_gpsAltitude = newGpsAltitude;
}
/**
* (no documentation provided)
*/
- (long long) deviceUserId
{
return _deviceUserId;
}
/**
* (no documentation provided)
*/
- (void) setDeviceUserId: (long long) newDeviceUserId
{
_deviceUserId = newDeviceUserId;
}
/**
* (no documentation provided)
*/
- (NSString *) accountName
{
return _accountName;
}
/**
* (no documentation provided)
*/
- (void) setAccountName: (NSString *) newAccountName
{
[newAccountName retain];
[_accountName release];
_accountName = newAccountName;
}
/**
* (no documentation provided)
*/
- (long long *) signedCertificateId
{
return _signedCertificateId;
}
/**
* (no documentation provided)
*/
- (void) setSignedCertificateId: (long long *) newSignedCertificateId
{
if (_signedCertificateId != NULL) {
free(_signedCertificateId);
}
_signedCertificateId = newSignedCertificateId;
}
/**
* (no documentation provided)
*/
- (NSString *) mqttConnectionIp
{
return _mqttConnectionIp;
}
/**
* (no documentation provided)
*/
- (void) setMqttConnectionIp: (NSString *) newMqttConnectionIp
{
[newMqttConnectionIp retain];
[_mqttConnectionIp release];
_mqttConnectionIp = newMqttConnectionIp;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *) credentialsTight
{
return _credentialsTight;
}
/**
* (no documentation provided)
*/
- (void) setCredentialsTight: (enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *) newCredentialsTight
{
if (_credentialsTight != NULL) {
free(_credentialsTight);
}
_credentialsTight = newCredentialsTight;
}
/**
* (no documentation provided)
*/
- (BOOL) credentialsAllowChange
{
return _credentialsAllowChange;
}
/**
* (no documentation provided)
*/
- (void) setCredentialsAllowChange: (BOOL) newCredentialsAllowChange
{
_credentialsAllowChange = newCredentialsAllowChange;
}
/**
* (no documentation provided)
*/
- (NSString *) certificateCommonName
{
return _certificateCommonName;
}
/**
* (no documentation provided)
*/
- (void) setCertificateCommonName: (NSString *) newCertificateCommonName
{
[newCertificateCommonName retain];
[_certificateCommonName release];
_certificateCommonName = newCertificateCommonName;
}
/**
* (no documentation provided)
*/
- (long long *) brokerClusterId
{
return _brokerClusterId;
}
/**
* (no documentation provided)
*/
- (void) setBrokerClusterId: (long long *) newBrokerClusterId
{
if (_brokerClusterId != NULL) {
free(_brokerClusterId);
}
_brokerClusterId = newBrokerClusterId;
}
- (void) dealloc
{
[self setIdentifier: nil];
[self setClientId: nil];
[self setStatus: NULL];
[self setConnectionStatus: NULL];
[self setCreatedOn: nil];
[self setLastEventOn: nil];
[self setLastEventType: NULL];
[self setDisplayName: nil];
[self setSerialNumber: nil];
[self setImei: nil];
[self setImsi: nil];
[self setIccid: nil];
[self setModelId: nil];
[self setConnectionIp: nil];
[self setBiosVersion: nil];
[self setFirmwareVersion: nil];
[self setOsVersion: nil];
[self setJvmVersion: nil];
[self setOsgiFrameworkVersion: nil];
[self setEsfVersion: nil];
[self setApplicationIdentifiers: nil];
[self setAcceptEncoding: nil];
[self setGpsLatitude: NULL];
[self setGpsLongitude: NULL];
[self setCustomAttribute1: nil];
[self setCustomAttribute2: nil];
[self setCustomAttribute3: nil];
[self setCustomAttribute4: nil];
[self setCustomAttribute5: nil];
[self setUptime: NULL];
[self setModelName: nil];
[self setPartNumber: nil];
[self setAvailableProcessors: nil];
[self setTotalMemory: nil];
[self setOs: nil];
[self setOsArch: nil];
[self setJvmName: nil];
[self setJvmProfile: nil];
[self setOsgiFramework: nil];
[self setConnectionInterface: nil];
[self setGpsAltitude: NULL];
[self setAccountName: nil];
[self setSignedCertificateId: NULL];
[self setMqttConnectionIp: nil];
[self setCredentialsTight: NULL];
[self setCertificateCommonName: nil];
[self setBrokerClusterId: NULL];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCDevice *_eDC_APIS_CLIENTEDCDevice;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCDevice = (EDC_APIS_CLIENTEDCDevice *) [EDC_APIS_CLIENTEDCDevice readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCDevice;
}
//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 EDC_APIS_CLIENTEDCDevice */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCDevice (JAXB)
@end /*interface EDC_APIS_CLIENTEDCDevice (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCDevice (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCDevice from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCDevice defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCDevice *_eDC_APIS_CLIENTEDCDevice = [[EDC_APIS_CLIENTEDCDevice alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCDevice initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCDevice = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCDevice autorelease];
return _eDC_APIS_CLIENTEDCDevice;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCDevice 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 EDC_APIS_CLIENTEDCDevice 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 EDC_APIS_CLIENTEDCDevice from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}device".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCDevice.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCDevice *_device = 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 {http://eurotech.com/edc/2.0}device."];
}
}
if (xmlStrcmp(BAD_CAST "device", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}device.");
#endif
_device = (EDC_APIS_CLIENTEDCDevice *)[EDC_APIS_CLIENTEDCDevice readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}device.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDevice. Expected element {http://eurotech.com/edc/2.0}device. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDevice. Expected element {http://eurotech.com/edc/2.0}device. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _device;
}
/**
* Writes this EDC_APIS_CLIENTEDCDevice to XML under element name "{http://eurotech.com/edc/2.0}device".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _device The Device to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCDevice 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, BAD_CAST "edc", BAD_CAST "device", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}device. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}device...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}device'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}device...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}device for root element {http://eurotech.com/edc/2.0}device...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}device for root element {http://eurotech.com/edc/2.0}device...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}device. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}id of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}id of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setIdentifier: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "clientId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setClientId: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceStatusType(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 EDC_APIS_CLIENTEDCDeviceStatus*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "connectionStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceConnectionStatusType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setConnectionStatus: ((enum EDC_APIS_CLIENTEDCDeviceConnectionStatus*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "createdOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}createdOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}createdOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setCreatedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "createdBy", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setCreatedBy: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "lastEventOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}lastEventOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}lastEventOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setLastEventOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "lastEventType", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceEventTypeType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setLastEventType: ((enum EDC_APIS_CLIENTEDCDeviceEventType*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "displayName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}displayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}displayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setDisplayName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "serialNumber", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}serialNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}serialNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setSerialNumber: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "imei", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}imei of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}imei of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setImei: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "imsi", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}imsi of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}imsi of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setImsi: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "iccid", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}iccid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}iccid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setIccid: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "modelId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}modelId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}modelId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setModelId: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "connectionIp", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}connectionIp of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}connectionIp of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setConnectionIp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "biosVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}biosVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}biosVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setBiosVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "firmwareVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}firmwareVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}firmwareVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setFirmwareVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "osVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}osVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}osVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setOsVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jvmVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jvmVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jvmVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setJvmVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "osgiFrameworkVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}osgiFrameworkVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}osgiFrameworkVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setOsgiFrameworkVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "esfVersion", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}esfVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}esfVersion of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setEsfVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "applicationIdentifiers", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}applicationIdentifiers of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}applicationIdentifiers of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setApplicationIdentifiers: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "acceptEncoding", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}acceptEncoding of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}acceptEncoding of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAcceptEncoding: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "gpsLatitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setGpsLatitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "gpsLongitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setGpsLongitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "customAttribute1", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}customAttribute1 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}customAttribute1 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCustomAttribute1: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "customAttribute2", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}customAttribute2 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}customAttribute2 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCustomAttribute2: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "customAttribute3", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}customAttribute3 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}customAttribute3 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCustomAttribute3: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "customAttribute4", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}customAttribute4 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}customAttribute4 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCustomAttribute4: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "customAttribute5", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}customAttribute5 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}customAttribute5 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCustomAttribute5: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "optlock", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setOptlock: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "uptime", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setUptime: ((long long*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "modelName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}modelName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}modelName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setModelName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "partNumber", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}partNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}partNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPartNumber: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "availableProcessors", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}availableProcessors of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}availableProcessors of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAvailableProcessors: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "totalMemory", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}totalMemory of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}totalMemory of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setTotalMemory: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "os", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}os of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}os of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setOs: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "osArch", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}osArch of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}osArch of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setOsArch: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jvmName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jvmName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jvmName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setJvmName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jvmProfile", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jvmProfile of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jvmProfile of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setJvmProfile: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "osgiFramework", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}osgiFramework of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}osgiFramework of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setOsgiFramework: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "connectionInterface", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}connectionInterface of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}connectionInterface of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setConnectionInterface: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "gpsAltitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setGpsAltitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "deviceUserId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setDeviceUserId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "accountName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}accountName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}accountName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAccountName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "signedCertificateId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setSignedCertificateId: ((long long*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "mqttConnectionIp", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}mqttConnectionIp of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}mqttConnectionIp of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setMqttConnectionIp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "credentialsTight", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceCredentialsTightType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setCredentialsTight: ((enum EDC_APIS_CLIENTEDCDeviceCredentialsTight*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "credentialsAllowChange", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setCredentialsAllowChange: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "certificateCommonName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}certificateCommonName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}certificateCommonName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCertificateCommonName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "brokerClusterId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setBrokerClusterId: ((long long*) _child_accessor)];
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self identifier]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "id", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}id."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}id...");
#endif
[[self identifier] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}id...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}id."];
}
}
if ([self clientId]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "clientId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}clientId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}clientId...");
#endif
[[self clientId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}clientId...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}clientId."];
}
}
if ([self status] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "status", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}status."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}status...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceStatusType(writer, [self status]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}status...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}status."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}status."];
}
}
if ([self connectionStatus] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "connectionStatus", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}connectionStatus."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}connectionStatus...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceConnectionStatusType(writer, [self connectionStatus]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}connectionStatus...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}connectionStatus."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}connectionStatus."];
}
}
if ([self createdOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "createdOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}createdOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}createdOn...");
#endif
[[self createdOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}createdOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}createdOn."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "createdBy", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}createdBy."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}createdBy...");
#endif
status = xmlTextWriterWriteLongType(writer, &_createdBy);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}createdBy...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}createdBy."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}createdBy."];
}
}
if ([self lastEventOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "lastEventOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}lastEventOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}lastEventOn...");
#endif
[[self lastEventOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}lastEventOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}lastEventOn."];
}
}
if ([self lastEventType] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "lastEventType", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}lastEventType."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}lastEventType...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceEventTypeType(writer, [self lastEventType]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}lastEventType...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}lastEventType."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}lastEventType."];
}
}
if ([self displayName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "displayName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}displayName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}displayName...");
#endif
[[self displayName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}displayName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}displayName."];
}
}
if ([self serialNumber]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "serialNumber", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}serialNumber."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}serialNumber...");
#endif
[[self serialNumber] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}serialNumber...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}serialNumber."];
}
}
if ([self imei]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "imei", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}imei."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}imei...");
#endif
[[self imei] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}imei...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}imei."];
}
}
if ([self imsi]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "imsi", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}imsi."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}imsi...");
#endif
[[self imsi] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}imsi...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}imsi."];
}
}
if ([self iccid]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "iccid", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}iccid."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}iccid...");
#endif
[[self iccid] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}iccid...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}iccid."];
}
}
if ([self modelId]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "modelId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}modelId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}modelId...");
#endif
[[self modelId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}modelId...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}modelId."];
}
}
if ([self connectionIp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "connectionIp", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}connectionIp."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}connectionIp...");
#endif
[[self connectionIp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}connectionIp...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}connectionIp."];
}
}
if ([self biosVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "biosVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}biosVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}biosVersion...");
#endif
[[self biosVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}biosVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}biosVersion."];
}
}
if ([self firmwareVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "firmwareVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}firmwareVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}firmwareVersion...");
#endif
[[self firmwareVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}firmwareVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}firmwareVersion."];
}
}
if ([self osVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "osVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}osVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}osVersion...");
#endif
[[self osVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}osVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}osVersion."];
}
}
if ([self jvmVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jvmVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jvmVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jvmVersion...");
#endif
[[self jvmVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jvmVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jvmVersion."];
}
}
if ([self osgiFrameworkVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "osgiFrameworkVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}osgiFrameworkVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}osgiFrameworkVersion...");
#endif
[[self osgiFrameworkVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}osgiFrameworkVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}osgiFrameworkVersion."];
}
}
if ([self esfVersion]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "esfVersion", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}esfVersion."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}esfVersion...");
#endif
[[self esfVersion] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}esfVersion...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}esfVersion."];
}
}
if ([self applicationIdentifiers]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "applicationIdentifiers", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}applicationIdentifiers."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}applicationIdentifiers...");
#endif
[[self applicationIdentifiers] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}applicationIdentifiers...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}applicationIdentifiers."];
}
}
if ([self acceptEncoding]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "acceptEncoding", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}acceptEncoding."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}acceptEncoding...");
#endif
[[self acceptEncoding] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}acceptEncoding...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}acceptEncoding."];
}
}
if ([self gpsLatitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "gpsLatitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}gpsLatitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}gpsLatitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self gpsLatitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}gpsLatitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}gpsLatitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}gpsLatitude."];
}
}
if ([self gpsLongitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "gpsLongitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}gpsLongitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}gpsLongitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self gpsLongitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}gpsLongitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}gpsLongitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}gpsLongitude."];
}
}
if ([self customAttribute1]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "customAttribute1", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}customAttribute1."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}customAttribute1...");
#endif
[[self customAttribute1] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}customAttribute1...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}customAttribute1."];
}
}
if ([self customAttribute2]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "customAttribute2", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}customAttribute2."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}customAttribute2...");
#endif
[[self customAttribute2] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}customAttribute2...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}customAttribute2."];
}
}
if ([self customAttribute3]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "customAttribute3", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}customAttribute3."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}customAttribute3...");
#endif
[[self customAttribute3] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}customAttribute3...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}customAttribute3."];
}
}
if ([self customAttribute4]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "customAttribute4", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}customAttribute4."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}customAttribute4...");
#endif
[[self customAttribute4] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}customAttribute4...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}customAttribute4."];
}
}
if ([self customAttribute5]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "customAttribute5", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}customAttribute5."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}customAttribute5...");
#endif
[[self customAttribute5] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}customAttribute5...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}customAttribute5."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "optlock", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}optlock."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}optlock...");
#endif
status = xmlTextWriterWriteIntType(writer, &_optlock);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}optlock...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}optlock."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}optlock."];
}
}
if ([self uptime] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "uptime", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}uptime."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}uptime...");
#endif
status = xmlTextWriterWriteLongType(writer, [self uptime]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}uptime...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}uptime."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}uptime."];
}
}
if ([self modelName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "modelName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}modelName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}modelName...");
#endif
[[self modelName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}modelName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}modelName."];
}
}
if ([self partNumber]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "partNumber", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}partNumber."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}partNumber...");
#endif
[[self partNumber] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}partNumber...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}partNumber."];
}
}
if ([self availableProcessors]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "availableProcessors", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}availableProcessors."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}availableProcessors...");
#endif
[[self availableProcessors] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}availableProcessors...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}availableProcessors."];
}
}
if ([self totalMemory]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "totalMemory", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}totalMemory."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}totalMemory...");
#endif
[[self totalMemory] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}totalMemory...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}totalMemory."];
}
}
if ([self os]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "os", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}os."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}os...");
#endif
[[self os] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}os...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}os."];
}
}
if ([self osArch]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "osArch", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}osArch."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}osArch...");
#endif
[[self osArch] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}osArch...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}osArch."];
}
}
if ([self jvmName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jvmName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jvmName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jvmName...");
#endif
[[self jvmName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jvmName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jvmName."];
}
}
if ([self jvmProfile]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jvmProfile", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jvmProfile."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jvmProfile...");
#endif
[[self jvmProfile] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jvmProfile...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jvmProfile."];
}
}
if ([self osgiFramework]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "osgiFramework", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}osgiFramework."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}osgiFramework...");
#endif
[[self osgiFramework] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}osgiFramework...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}osgiFramework."];
}
}
if ([self connectionInterface]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "connectionInterface", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}connectionInterface."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}connectionInterface...");
#endif
[[self connectionInterface] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}connectionInterface...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}connectionInterface."];
}
}
if ([self gpsAltitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "gpsAltitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}gpsAltitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}gpsAltitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self gpsAltitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}gpsAltitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}gpsAltitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}gpsAltitude."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "deviceUserId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}deviceUserId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}deviceUserId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_deviceUserId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}deviceUserId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}deviceUserId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}deviceUserId."];
}
}
if ([self accountName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountName...");
#endif
[[self accountName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountName."];
}
}
if ([self signedCertificateId] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "signedCertificateId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}signedCertificateId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}signedCertificateId...");
#endif
status = xmlTextWriterWriteLongType(writer, [self signedCertificateId]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}signedCertificateId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}signedCertificateId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}signedCertificateId."];
}
}
if ([self mqttConnectionIp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "mqttConnectionIp", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}mqttConnectionIp."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}mqttConnectionIp...");
#endif
[[self mqttConnectionIp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}mqttConnectionIp...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}mqttConnectionIp."];
}
}
if ([self credentialsTight] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "credentialsTight", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}credentialsTight."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}credentialsTight...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceCredentialsTightType(writer, [self credentialsTight]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}credentialsTight...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}credentialsTight."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}credentialsTight."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "credentialsAllowChange", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}credentialsAllowChange."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}credentialsAllowChange...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_credentialsAllowChange);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}credentialsAllowChange...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}credentialsAllowChange."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}credentialsAllowChange."];
}
}
if ([self certificateCommonName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "certificateCommonName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}certificateCommonName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}certificateCommonName...");
#endif
[[self certificateCommonName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}certificateCommonName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}certificateCommonName."];
}
}
if ([self brokerClusterId] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "brokerClusterId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}brokerClusterId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}brokerClusterId...");
#endif
status = xmlTextWriterWriteLongType(writer, [self brokerClusterId]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}brokerClusterId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}brokerClusterId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}brokerClusterId."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCDevice (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCDevice_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceConnectionSummary_M
#define DEF_EDC_APIS_CLIENTEDCDeviceConnectionSummary_M
/**
* DeviceConnectionSummary represents an aggregated summary of the connection status of a group of devices at a point in time.
* It returns the number of devices currently connected, the number of devices which disconnect cleanly,
* the number of devices which disconnected abruptly, and the number of devices which have been disabled.
*/
@implementation EDC_APIS_CLIENTEDCDeviceConnectionSummary
/**
* (no documentation provided)
*/
- (int) numConnected
{
return _numConnected;
}
/**
* (no documentation provided)
*/
- (void) setNumConnected: (int) newNumConnected
{
_numConnected = newNumConnected;
}
/**
* (no documentation provided)
*/
- (int) numDisconnected
{
return _numDisconnected;
}
/**
* (no documentation provided)
*/
- (void) setNumDisconnected: (int) newNumDisconnected
{
_numDisconnected = newNumDisconnected;
}
/**
* (no documentation provided)
*/
- (int) numMissing
{
return _numMissing;
}
/**
* (no documentation provided)
*/
- (void) setNumMissing: (int) newNumMissing
{
_numMissing = newNumMissing;
}
/**
* (no documentation provided)
*/
- (int) numEnabled
{
return _numEnabled;
}
/**
* (no documentation provided)
*/
- (void) setNumEnabled: (int) newNumEnabled
{
_numEnabled = newNumEnabled;
}
/**
* (no documentation provided)
*/
- (int) numDisabled
{
return _numDisabled;
}
/**
* (no documentation provided)
*/
- (void) setNumDisabled: (int) newNumDisabled
{
_numDisabled = newNumDisabled;
}
- (void) dealloc
{
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCDeviceConnectionSummary *_eDC_APIS_CLIENTEDCDeviceConnectionSummary;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCDeviceConnectionSummary = (EDC_APIS_CLIENTEDCDeviceConnectionSummary *) [EDC_APIS_CLIENTEDCDeviceConnectionSummary readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCDeviceConnectionSummary;
}
//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 EDC_APIS_CLIENTEDCDeviceConnectionSummary */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCDeviceConnectionSummary (JAXB)
@end /*interface EDC_APIS_CLIENTEDCDeviceConnectionSummary (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCDeviceConnectionSummary (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCDeviceConnectionSummary from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCDeviceConnectionSummary defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCDeviceConnectionSummary *_eDC_APIS_CLIENTEDCDeviceConnectionSummary = [[EDC_APIS_CLIENTEDCDeviceConnectionSummary alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCDeviceConnectionSummary initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCDeviceConnectionSummary = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCDeviceConnectionSummary autorelease];
return _eDC_APIS_CLIENTEDCDeviceConnectionSummary;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCDeviceConnectionSummary 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 EDC_APIS_CLIENTEDCDeviceConnectionSummary 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 EDC_APIS_CLIENTEDCDeviceConnectionSummary from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}deviceConnectionSummary".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCDeviceConnectionSummary.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCDeviceConnectionSummary *_deviceConnectionSummary = 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 {http://eurotech.com/edc/2.0}deviceConnectionSummary."];
}
}
if (xmlStrcmp(BAD_CAST "deviceConnectionSummary", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}deviceConnectionSummary.");
#endif
_deviceConnectionSummary = (EDC_APIS_CLIENTEDCDeviceConnectionSummary *)[EDC_APIS_CLIENTEDCDeviceConnectionSummary readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}deviceConnectionSummary.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceConnectionSummary. Expected element {http://eurotech.com/edc/2.0}deviceConnectionSummary. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceConnectionSummary. Expected element {http://eurotech.com/edc/2.0}deviceConnectionSummary. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceConnectionSummary;
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceConnectionSummary to XML under element name "{http://eurotech.com/edc/2.0}deviceConnectionSummary".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceConnectionSummary The DeviceConnectionSummary to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceConnectionSummary 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, BAD_CAST "edc", BAD_CAST "deviceConnectionSummary", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}deviceConnectionSummary. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}deviceConnectionSummary...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}deviceConnectionSummary'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}deviceConnectionSummary...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}deviceConnectionSummary for root element {http://eurotech.com/edc/2.0}deviceConnectionSummary...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}deviceConnectionSummary for root element {http://eurotech.com/edc/2.0}deviceConnectionSummary...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}deviceConnectionSummary. 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 "connected", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setNumConnected: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "disconnected", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setNumDisconnected: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "missing", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setNumMissing: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "enabled", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setNumEnabled: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "disabled", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setNumDisabled: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "connected", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}connected."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}connected...");
#endif
status = xmlTextWriterWriteIntType(writer, &_numConnected);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}connected...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}connected."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}connected."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "disconnected", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}disconnected."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}disconnected...");
#endif
status = xmlTextWriterWriteIntType(writer, &_numDisconnected);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}disconnected...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}disconnected."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}disconnected."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "missing", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}missing."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}missing...");
#endif
status = xmlTextWriterWriteIntType(writer, &_numMissing);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}missing...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}missing."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}missing."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "enabled", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}enabled."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}enabled...");
#endif
status = xmlTextWriterWriteIntType(writer, &_numEnabled);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}enabled...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}enabled."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}enabled."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "disabled", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}disabled."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}disabled...");
#endif
status = xmlTextWriterWriteIntType(writer, &_numDisabled);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}disabled...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}disabled."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}disabled."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCDeviceConnectionSummary (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceConnectionSummary_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceCredentialsTight_M
#define DEF_EDC_APIS_CLIENTEDCDeviceCredentialsTight_M
/**
* Reads a DeviceCredentialsTight from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The DeviceCredentialsTight, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceCredentialsTightType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceCredentialsTight));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "INHERITED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_INHERITED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "LOOSE") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_LOOSE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STRICT") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_STRICT;
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 _deviceCredentialsTight The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *formatStringToEDC_APIS_CLIENTEDCDeviceCredentialsTightType(NSString *_deviceCredentialsTight)
{
enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceCredentialsTight));
if ([@"INHERITED" isEqualToString:_deviceCredentialsTight]) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_INHERITED;
}
else if ([@"LOOSE" isEqualToString:_deviceCredentialsTight]) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_LOOSE;
}
else if ([@"STRICT" isEqualToString:_deviceCredentialsTight]) {
*value = EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_STRICT;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_deviceCredentialsTight UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a DeviceCredentialsTight to XML.
*
* @param writer The XML writer.
* @param _deviceCredentialsTight The DeviceCredentialsTight to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceCredentialsTightType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *_deviceCredentialsTight)
{
switch (*_deviceCredentialsTight) {
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_INHERITED:
return xmlTextWriterWriteString(writer, BAD_CAST "INHERITED");
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_LOOSE:
return xmlTextWriterWriteString(writer, BAD_CAST "LOOSE");
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_STRICT:
return xmlTextWriterWriteString(writer, BAD_CAST "STRICT");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of DeviceCredentialsTight.
*
* @param _deviceCredentialsTight The DeviceCredentialsTight to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCDeviceCredentialsTightTypeToString(enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *_deviceCredentialsTight)
{
switch (*_deviceCredentialsTight) {
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_INHERITED:
return @"INHERITED";
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_LOOSE:
return @"LOOSE";
case EDC_APIS_CLIENT_EDC_DEVICECREDENTIALSTIGHT_STRICT:
return @"STRICT";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceCredentialsTight_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceEventType_M
#define DEF_EDC_APIS_CLIENTEDCDeviceEventType_M
/**
* Reads a DeviceEventType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The DeviceEventType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCDeviceEventType *xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceEventTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCDeviceEventType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceEventType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "CONNECTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONNECTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "BIRTH") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BIRTH;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DC") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DC;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DISCONNECTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DISCONNECTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "MISSING") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_MISSING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONF_COMP_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_COMP_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONF_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONF_ROLLEDBACK") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_ROLLEDBACK;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DEPLOY_DOWNLOADED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_DOWNLOADED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DEPLOY_INSTALLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_INSTALLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DEPLOY_UNINSTALLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_UNINSTALLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CMD_EXECUTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CMD_EXECUTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "APPS_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_APPS_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "BUNDLE_STARTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STARTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "BUNDLE_STOPPED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STOPPED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "UNDER_PROVISIONING") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_UNDER_PROVISIONING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "PROVISIONING_FAILED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONING_FAILED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "PROVISIONED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CERTIFICATE_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CERTIFICATE_REVOKED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_REVOKED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CERTIFICATE_UPDATE_ERROR") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATE_ERROR;
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 _deviceEventType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCDeviceEventType *formatStringToEDC_APIS_CLIENTEDCDeviceEventTypeType(NSString *_deviceEventType)
{
enum EDC_APIS_CLIENTEDCDeviceEventType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceEventType));
if ([@"CONNECTED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONNECTED;
}
else if ([@"BIRTH" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BIRTH;
}
else if ([@"DC" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DC;
}
else if ([@"DISCONNECTED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DISCONNECTED;
}
else if ([@"MISSING" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_MISSING;
}
else if ([@"CONF_COMP_UPDATED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_COMP_UPDATED;
}
else if ([@"CONF_UPDATED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_UPDATED;
}
else if ([@"CONF_ROLLEDBACK" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_ROLLEDBACK;
}
else if ([@"DEPLOY_DOWNLOADED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_DOWNLOADED;
}
else if ([@"DEPLOY_INSTALLED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_INSTALLED;
}
else if ([@"DEPLOY_UNINSTALLED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_UNINSTALLED;
}
else if ([@"CMD_EXECUTED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CMD_EXECUTED;
}
else if ([@"APPS_UPDATED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_APPS_UPDATED;
}
else if ([@"BUNDLE_STARTED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STARTED;
}
else if ([@"BUNDLE_STOPPED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STOPPED;
}
else if ([@"UNDER_PROVISIONING" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_UNDER_PROVISIONING;
}
else if ([@"PROVISIONING_FAILED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONING_FAILED;
}
else if ([@"PROVISIONED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONED;
}
else if ([@"CERTIFICATE_UPDATED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATED;
}
else if ([@"CERTIFICATE_REVOKED" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_REVOKED;
}
else if ([@"CERTIFICATE_UPDATE_ERROR" isEqualToString:_deviceEventType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATE_ERROR;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_deviceEventType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a DeviceEventType to XML.
*
* @param writer The XML writer.
* @param _deviceEventType The DeviceEventType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceEventTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCDeviceEventType *_deviceEventType)
{
switch (*_deviceEventType) {
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONNECTED:
return xmlTextWriterWriteString(writer, BAD_CAST "CONNECTED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BIRTH:
return xmlTextWriterWriteString(writer, BAD_CAST "BIRTH");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DC:
return xmlTextWriterWriteString(writer, BAD_CAST "DC");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DISCONNECTED:
return xmlTextWriterWriteString(writer, BAD_CAST "DISCONNECTED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_MISSING:
return xmlTextWriterWriteString(writer, BAD_CAST "MISSING");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_COMP_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CONF_COMP_UPDATED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CONF_UPDATED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_ROLLEDBACK:
return xmlTextWriterWriteString(writer, BAD_CAST "CONF_ROLLEDBACK");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_DOWNLOADED:
return xmlTextWriterWriteString(writer, BAD_CAST "DEPLOY_DOWNLOADED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_INSTALLED:
return xmlTextWriterWriteString(writer, BAD_CAST "DEPLOY_INSTALLED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_UNINSTALLED:
return xmlTextWriterWriteString(writer, BAD_CAST "DEPLOY_UNINSTALLED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CMD_EXECUTED:
return xmlTextWriterWriteString(writer, BAD_CAST "CMD_EXECUTED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_APPS_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "APPS_UPDATED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STARTED:
return xmlTextWriterWriteString(writer, BAD_CAST "BUNDLE_STARTED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STOPPED:
return xmlTextWriterWriteString(writer, BAD_CAST "BUNDLE_STOPPED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_UNDER_PROVISIONING:
return xmlTextWriterWriteString(writer, BAD_CAST "UNDER_PROVISIONING");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONING_FAILED:
return xmlTextWriterWriteString(writer, BAD_CAST "PROVISIONING_FAILED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONED:
return xmlTextWriterWriteString(writer, BAD_CAST "PROVISIONED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CERTIFICATE_UPDATED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_REVOKED:
return xmlTextWriterWriteString(writer, BAD_CAST "CERTIFICATE_REVOKED");
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATE_ERROR:
return xmlTextWriterWriteString(writer, BAD_CAST "CERTIFICATE_UPDATE_ERROR");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of DeviceEventType.
*
* @param _deviceEventType The DeviceEventType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCDeviceEventTypeTypeToString(enum EDC_APIS_CLIENTEDCDeviceEventType *_deviceEventType)
{
switch (*_deviceEventType) {
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONNECTED:
return @"CONNECTED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BIRTH:
return @"BIRTH";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DC:
return @"DC";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DISCONNECTED:
return @"DISCONNECTED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_MISSING:
return @"MISSING";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_COMP_UPDATED:
return @"CONF_COMP_UPDATED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_UPDATED:
return @"CONF_UPDATED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CONF_ROLLEDBACK:
return @"CONF_ROLLEDBACK";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_DOWNLOADED:
return @"DEPLOY_DOWNLOADED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_INSTALLED:
return @"DEPLOY_INSTALLED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_DEPLOY_UNINSTALLED:
return @"DEPLOY_UNINSTALLED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CMD_EXECUTED:
return @"CMD_EXECUTED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_APPS_UPDATED:
return @"APPS_UPDATED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STARTED:
return @"BUNDLE_STARTED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_BUNDLE_STOPPED:
return @"BUNDLE_STOPPED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_UNDER_PROVISIONING:
return @"UNDER_PROVISIONING";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONING_FAILED:
return @"PROVISIONING_FAILED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_PROVISIONED:
return @"PROVISIONED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATED:
return @"CERTIFICATE_UPDATED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_REVOKED:
return @"CERTIFICATE_REVOKED";
case EDC_APIS_CLIENT_EDC_DEVICEEVENTTYPE_CERTIFICATE_UPDATE_ERROR:
return @"CERTIFICATE_UPDATE_ERROR";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceEventType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcEntity_M
#define DEF_EDC_APIS_CLIENTEDCEdcEntity_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCEdcEntity
- (void) dealloc
{
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTEDCEdcEntity */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcEntity (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcEntity (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcEntity (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcEntity from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcEntity defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcEntity *_eDC_APIS_CLIENTEDCEdcEntity = [[EDC_APIS_CLIENTEDCEdcEntity alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcEntity initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcEntity = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcEntity autorelease];
return _eDC_APIS_CLIENTEDCEdcEntity;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcEntity 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 EDC_APIS_CLIENTEDCEdcEntity 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;
}
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];
}
@end /* implementation EDC_APIS_CLIENTEDCEdcEntity (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcEntity_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEtype_M
#define DEF_EDC_APIS_CLIENTEDCEtype_M
/**
* Reads a Etype from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The Etype, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCEtype *xmlTextReaderReadEDC_APIS_CLIENTEDCEtypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCEtype *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCEtype));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "DEVI") == 0) {
*value = EDC_APIS_CLIENT_EDC_ETYPE_DEVI;
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 _etype The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCEtype *formatStringToEDC_APIS_CLIENTEDCEtypeType(NSString *_etype)
{
enum EDC_APIS_CLIENTEDCEtype *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCEtype));
if ([@"DEVI" isEqualToString:_etype]) {
*value = EDC_APIS_CLIENT_EDC_ETYPE_DEVI;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_etype UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a Etype to XML.
*
* @param writer The XML writer.
* @param _etype The Etype to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCEtypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCEtype *_etype)
{
switch (*_etype) {
case EDC_APIS_CLIENT_EDC_ETYPE_DEVI:
return xmlTextWriterWriteString(writer, BAD_CAST "DEVI");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of Etype.
*
* @param _etype The Etype to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCEtypeTypeToString(enum EDC_APIS_CLIENTEDCEtype *_etype)
{
switch (*_etype) {
case EDC_APIS_CLIENT_EDC_ETYPE_DEVI:
return @"DEVI";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCEtype_M */
#ifndef DEF_EDC_APIS_CLIENTEDCHealthCheckPeriodReport_M
#define DEF_EDC_APIS_CLIENTEDCHealthCheckPeriodReport_M
/**
* HealthCheckPeriodReport
*
* An object that describe a derived statistic informations based on the health check monitor logs.
*/
@implementation EDC_APIS_CLIENTEDCHealthCheckPeriodReport
/**
* (no documentation provided)
*/
- (long long) totalRows
{
return _totalRows;
}
/**
* (no documentation provided)
*/
- (void) setTotalRows: (long long) newTotalRows
{
_totalRows = newTotalRows;
}
/**
* (no documentation provided)
*/
- (int) mqttStatus
{
return _mqttStatus;
}
/**
* (no documentation provided)
*/
- (void) setMqttStatus: (int) newMqttStatus
{
_mqttStatus = newMqttStatus;
}
/**
* (no documentation provided)
*/
- (int) restApiStatus
{
return _restApiStatus;
}
/**
* (no documentation provided)
*/
- (void) setRestApiStatus: (int) newRestApiStatus
{
_restApiStatus = newRestApiStatus;
}
/**
* (no documentation provided)
*/
- (int) dataStoreStatus
{
return _dataStoreStatus;
}
/**
* (no documentation provided)
*/
- (void) setDataStoreStatus: (int) newDataStoreStatus
{
_dataStoreStatus = newDataStoreStatus;
}
/**
* (no documentation provided)
*/
- (int) rulesEngineStatus
{
return _rulesEngineStatus;
}
/**
* (no documentation provided)
*/
- (void) setRulesEngineStatus: (int) newRulesEngineStatus
{
_rulesEngineStatus = newRulesEngineStatus;
}
/**
* (no documentation provided)
*/
- (float) slaPercent
{
return _slaPercent;
}
/**
* (no documentation provided)
*/
- (void) setSlaPercent: (float) newSlaPercent
{
_slaPercent = newSlaPercent;
}
/**
* (no documentation provided)
*/
- (int) mqttResponseTime
{
return _mqttResponseTime;
}
/**
* (no documentation provided)
*/
- (void) setMqttResponseTime: (int) newMqttResponseTime
{
_mqttResponseTime = newMqttResponseTime;
}
/**
* (no documentation provided)
*/
- (int) restResponseTime
{
return _restResponseTime;
}
/**
* (no documentation provided)
*/
- (void) setRestResponseTime: (int) newRestResponseTime
{
_restResponseTime = newRestResponseTime;
}
/**
* (no documentation provided)
*/
- (int) restComResponseTime
{
return _restComResponseTime;
}
/**
* (no documentation provided)
*/
- (void) setRestComResponseTime: (int) newRestComResponseTime
{
_restComResponseTime = newRestComResponseTime;
}
- (void) dealloc
{
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCHealthCheckPeriodReport *_eDC_APIS_CLIENTEDCHealthCheckPeriodReport;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCHealthCheckPeriodReport = (EDC_APIS_CLIENTEDCHealthCheckPeriodReport *) [EDC_APIS_CLIENTEDCHealthCheckPeriodReport readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCHealthCheckPeriodReport;
}
//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 EDC_APIS_CLIENTEDCHealthCheckPeriodReport */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCHealthCheckPeriodReport (JAXB)
@end /*interface EDC_APIS_CLIENTEDCHealthCheckPeriodReport (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCHealthCheckPeriodReport (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCHealthCheckPeriodReport from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCHealthCheckPeriodReport defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCHealthCheckPeriodReport *_eDC_APIS_CLIENTEDCHealthCheckPeriodReport = [[EDC_APIS_CLIENTEDCHealthCheckPeriodReport alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCHealthCheckPeriodReport initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCHealthCheckPeriodReport = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCHealthCheckPeriodReport autorelease];
return _eDC_APIS_CLIENTEDCHealthCheckPeriodReport;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCHealthCheckPeriodReport 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 EDC_APIS_CLIENTEDCHealthCheckPeriodReport 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 EDC_APIS_CLIENTEDCHealthCheckPeriodReport from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCHealthCheckPeriodReport.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCHealthCheckPeriodReport *_healthCheckPeriodReport = 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 {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult."];
}
}
if (xmlStrcmp(BAD_CAST "HealthCheckPeriodReportResult", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult.");
#endif
_healthCheckPeriodReport = (EDC_APIS_CLIENTEDCHealthCheckPeriodReport *)[EDC_APIS_CLIENTEDCHealthCheckPeriodReport readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCHealthCheckPeriodReport. Expected element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCHealthCheckPeriodReport. Expected element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _healthCheckPeriodReport;
}
/**
* Writes this EDC_APIS_CLIENTEDCHealthCheckPeriodReport to XML under element name "{http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _healthCheckPeriodReport The HealthCheckPeriodReport to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCHealthCheckPeriodReport 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, BAD_CAST "edc", BAD_CAST "HealthCheckPeriodReportResult", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}healthCheckPeriodReport for root element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}healthCheckPeriodReport for root element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}HealthCheckPeriodReportResult. 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 "totalRows", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTotalRows: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "mqttStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setMqttStatus: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "restApiStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRestApiStatus: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "dataStoreStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setDataStoreStatus: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "rulesEngineStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRulesEngineStatus: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "slaPercent", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadFloatType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setSlaPercent: *((float*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "mqttResponseTime", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setMqttResponseTime: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "restResponseTime", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRestResponseTime: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "restComResponseTime", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRestComResponseTime: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "totalRows", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}totalRows."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}totalRows...");
#endif
status = xmlTextWriterWriteLongType(writer, &_totalRows);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}totalRows...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}totalRows."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}totalRows."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "mqttStatus", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}mqttStatus."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}mqttStatus...");
#endif
status = xmlTextWriterWriteIntType(writer, &_mqttStatus);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}mqttStatus...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}mqttStatus."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}mqttStatus."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "restApiStatus", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}restApiStatus."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}restApiStatus...");
#endif
status = xmlTextWriterWriteIntType(writer, &_restApiStatus);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}restApiStatus...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}restApiStatus."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}restApiStatus."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "dataStoreStatus", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}dataStoreStatus."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}dataStoreStatus...");
#endif
status = xmlTextWriterWriteIntType(writer, &_dataStoreStatus);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}dataStoreStatus...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}dataStoreStatus."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}dataStoreStatus."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "rulesEngineStatus", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}rulesEngineStatus."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}rulesEngineStatus...");
#endif
status = xmlTextWriterWriteIntType(writer, &_rulesEngineStatus);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}rulesEngineStatus...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}rulesEngineStatus."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}rulesEngineStatus."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "slaPercent", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}slaPercent."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}slaPercent...");
#endif
status = xmlTextWriterWriteFloatType(writer, &_slaPercent);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}slaPercent...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}slaPercent."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}slaPercent."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "mqttResponseTime", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}mqttResponseTime."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}mqttResponseTime...");
#endif
status = xmlTextWriterWriteIntType(writer, &_mqttResponseTime);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}mqttResponseTime...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}mqttResponseTime."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}mqttResponseTime."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "restResponseTime", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}restResponseTime."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}restResponseTime...");
#endif
status = xmlTextWriterWriteIntType(writer, &_restResponseTime);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}restResponseTime...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}restResponseTime."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}restResponseTime."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "restComResponseTime", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}restComResponseTime."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}restComResponseTime...");
#endif
status = xmlTextWriterWriteIntType(writer, &_restComResponseTime);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}restComResponseTime...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}restComResponseTime."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}restComResponseTime."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCHealthCheckPeriodReport (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCHealthCheckPeriodReport_M */
#ifndef DEF_EDC_APIS_CLIENTEDCOrganization_M
#define DEF_EDC_APIS_CLIENTEDCOrganization_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCOrganization
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) personName
{
return _personName;
}
/**
* (no documentation provided)
*/
- (void) setPersonName: (NSString *) newPersonName
{
[newPersonName retain];
[_personName release];
_personName = newPersonName;
}
/**
* (no documentation provided)
*/
- (NSString *) email
{
return _email;
}
/**
* (no documentation provided)
*/
- (void) setEmail: (NSString *) newEmail
{
[newEmail retain];
[_email release];
_email = newEmail;
}
/**
* (no documentation provided)
*/
- (NSString *) phoneNumber
{
return _phoneNumber;
}
/**
* (no documentation provided)
*/
- (void) setPhoneNumber: (NSString *) newPhoneNumber
{
[newPhoneNumber retain];
[_phoneNumber release];
_phoneNumber = newPhoneNumber;
}
/**
* (no documentation provided)
*/
- (NSString *) addressLine1
{
return _addressLine1;
}
/**
* (no documentation provided)
*/
- (void) setAddressLine1: (NSString *) newAddressLine1
{
[newAddressLine1 retain];
[_addressLine1 release];
_addressLine1 = newAddressLine1;
}
/**
* (no documentation provided)
*/
- (NSString *) addressLine2
{
return _addressLine2;
}
/**
* (no documentation provided)
*/
- (void) setAddressLine2: (NSString *) newAddressLine2
{
[newAddressLine2 retain];
[_addressLine2 release];
_addressLine2 = newAddressLine2;
}
/**
* (no documentation provided)
*/
- (NSString *) addressLine3
{
return _addressLine3;
}
/**
* (no documentation provided)
*/
- (void) setAddressLine3: (NSString *) newAddressLine3
{
[newAddressLine3 retain];
[_addressLine3 release];
_addressLine3 = newAddressLine3;
}
/**
* (no documentation provided)
*/
- (NSString *) zipPostCode
{
return _zipPostCode;
}
/**
* (no documentation provided)
*/
- (void) setZipPostCode: (NSString *) newZipPostCode
{
[newZipPostCode retain];
[_zipPostCode release];
_zipPostCode = newZipPostCode;
}
/**
* (no documentation provided)
*/
- (NSString *) city
{
return _city;
}
/**
* (no documentation provided)
*/
- (void) setCity: (NSString *) newCity
{
[newCity retain];
[_city release];
_city = newCity;
}
/**
* (no documentation provided)
*/
- (NSString *) stateProvinceCounty
{
return _stateProvinceCounty;
}
/**
* (no documentation provided)
*/
- (void) setStateProvinceCounty: (NSString *) newStateProvinceCounty
{
[newStateProvinceCounty retain];
[_stateProvinceCounty release];
_stateProvinceCounty = newStateProvinceCounty;
}
/**
* (no documentation provided)
*/
- (NSString *) country
{
return _country;
}
/**
* (no documentation provided)
*/
- (void) setCountry: (NSString *) newCountry
{
[newCountry retain];
[_country release];
_country = newCountry;
}
- (void) dealloc
{
[self setName: nil];
[self setPersonName: nil];
[self setEmail: nil];
[self setPhoneNumber: nil];
[self setAddressLine1: nil];
[self setAddressLine2: nil];
[self setAddressLine3: nil];
[self setZipPostCode: nil];
[self setCity: nil];
[self setStateProvinceCounty: nil];
[self setCountry: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCOrganization *_eDC_APIS_CLIENTEDCOrganization;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCOrganization = (EDC_APIS_CLIENTEDCOrganization *) [EDC_APIS_CLIENTEDCOrganization readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCOrganization;
}
//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 EDC_APIS_CLIENTEDCOrganization */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCOrganization (JAXB)
@end /*interface EDC_APIS_CLIENTEDCOrganization (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCOrganization (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCOrganization from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCOrganization defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCOrganization *_eDC_APIS_CLIENTEDCOrganization = [[EDC_APIS_CLIENTEDCOrganization alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCOrganization initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCOrganization = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCOrganization autorelease];
return _eDC_APIS_CLIENTEDCOrganization;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCOrganization 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 EDC_APIS_CLIENTEDCOrganization 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 EDC_APIS_CLIENTEDCOrganization from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}organization".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCOrganization.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCOrganization *_organization = 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 {http://eurotech.com/edc/2.0}organization."];
}
}
if (xmlStrcmp(BAD_CAST "organization", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}organization.");
#endif
_organization = (EDC_APIS_CLIENTEDCOrganization *)[EDC_APIS_CLIENTEDCOrganization readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}organization.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCOrganization. Expected element {http://eurotech.com/edc/2.0}organization. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCOrganization. Expected element {http://eurotech.com/edc/2.0}organization. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _organization;
}
/**
* Writes this EDC_APIS_CLIENTEDCOrganization to XML under element name "{http://eurotech.com/edc/2.0}organization".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _organization The Organization to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCOrganization 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, BAD_CAST "edc", BAD_CAST "organization", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}organization. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}organization...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}organization'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}organization...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}organization for root element {http://eurotech.com/edc/2.0}organization...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}organization for root element {http://eurotech.com/edc/2.0}organization...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}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 "personName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}personName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}personName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPersonName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "email", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}email of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}email of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setEmail: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "phoneNumber", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}phoneNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}phoneNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPhoneNumber: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "addressLine1", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}addressLine1 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}addressLine1 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAddressLine1: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "addressLine2", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}addressLine2 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}addressLine2 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAddressLine2: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "addressLine3", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}addressLine3 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}addressLine3 of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAddressLine3: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "zipPostCode", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}zipPostCode of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}zipPostCode of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setZipPostCode: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "city", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}city of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}city of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCity: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "stateProvinceCounty", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}stateProvinceCounty of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}stateProvinceCounty of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setStateProvinceCounty: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "country", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}country of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}country of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCountry: __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 name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self personName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "personName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}personName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}personName...");
#endif
[[self personName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}personName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}personName."];
}
}
if ([self email]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "email", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}email."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}email...");
#endif
[[self email] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}email...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}email."];
}
}
if ([self phoneNumber]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "phoneNumber", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}phoneNumber."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}phoneNumber...");
#endif
[[self phoneNumber] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}phoneNumber...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}phoneNumber."];
}
}
if ([self addressLine1]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "addressLine1", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}addressLine1."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}addressLine1...");
#endif
[[self addressLine1] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}addressLine1...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}addressLine1."];
}
}
if ([self addressLine2]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "addressLine2", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}addressLine2."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}addressLine2...");
#endif
[[self addressLine2] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}addressLine2...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}addressLine2."];
}
}
if ([self addressLine3]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "addressLine3", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}addressLine3."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}addressLine3...");
#endif
[[self addressLine3] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}addressLine3...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}addressLine3."];
}
}
if ([self zipPostCode]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "zipPostCode", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}zipPostCode."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}zipPostCode...");
#endif
[[self zipPostCode] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}zipPostCode...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}zipPostCode."];
}
}
if ([self city]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "city", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}city."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}city...");
#endif
[[self city] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}city...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}city."];
}
}
if ([self stateProvinceCounty]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "stateProvinceCounty", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}stateProvinceCounty."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}stateProvinceCounty...");
#endif
[[self stateProvinceCounty] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}stateProvinceCounty...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}stateProvinceCounty."];
}
}
if ([self country]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "country", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}country."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}country...");
#endif
[[self country] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}country...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}country."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCOrganization (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCOrganization_M */
#ifndef DEF_EDC_APIS_CLIENTEDCProvisionRequestCreator_M
#define DEF_EDC_APIS_CLIENTEDCProvisionRequestCreator_M
/**
* ProvisionRequestCreator is a object used to create a provision request for a target device into the Everyware platform.
*
*
* Mandatory fields are: accountId, retryMaxAttempts, provisionUserUsername, provisionUserPassword. Other field that are not set in the ProvisionRequestCreator will be set to the default value of their
* type.
*
*
* ClientId, provisionUserUsername, provisionUserPassword must match exactly the values that the device will use to connect the first time to the provision broker.
* ClientId is unique within an account, that means that must not exist more the one request for the same ClientId for an account.
* ActivatesOn must be after the Expiration date, otherwise the creation will fail.
* GenerateActivation key is optional. If set to true a 32 char random string will be generated and associated with the provision request.
* A device must provide that activation key upon ask to be provisioned to the provision broker.
* ProvisionProperties are not used at the moment.
* ProvisionAttachment are optional. It can be specified only one configuration update, while bundle have a limit of 9 for a total of 10 max attachments.
* If no configuration attachment is passed the system will generate a configuration using values retrieved from the target account and from the device.
* By set OverwriteIfDuplicate flag to true any existing provision request for the specified ClientId will be overwritten by this provision request. If set to false and a duplicate exist the creation will return an error.
*
*/
@implementation EDC_APIS_CLIENTEDCProvisionRequestCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSDate *) activatesOn
{
return _activatesOn;
}
/**
* (no documentation provided)
*/
- (void) setActivatesOn: (NSDate *) newActivatesOn
{
[newActivatesOn retain];
[_activatesOn release];
_activatesOn = newActivatesOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) expiresOn
{
return _expiresOn;
}
/**
* (no documentation provided)
*/
- (void) setExpiresOn: (NSDate *) newExpiresOn
{
[newExpiresOn retain];
[_expiresOn release];
_expiresOn = newExpiresOn;
}
/**
* (no documentation provided)
*/
- (NSString *) clientId
{
return _clientId;
}
/**
* (no documentation provided)
*/
- (void) setClientId: (NSString *) newClientId
{
[newClientId retain];
[_clientId release];
_clientId = newClientId;
}
/**
* (no documentation provided)
*/
- (BOOL) generateActivationKey
{
return _generateActivationKey;
}
/**
* (no documentation provided)
*/
- (void) setGenerateActivationKey: (BOOL) newGenerateActivationKey
{
_generateActivationKey = newGenerateActivationKey;
}
/**
* (no documentation provided)
*/
- (NSString *) provisionUserUsername
{
return _provisionUserUsername;
}
/**
* (no documentation provided)
*/
- (void) setProvisionUserUsername: (NSString *) newProvisionUserUsername
{
[newProvisionUserUsername retain];
[_provisionUserUsername release];
_provisionUserUsername = newProvisionUserUsername;
}
/**
* (no documentation provided)
*/
- (NSString *) provisionUserPassword
{
return _provisionUserPassword;
}
/**
* (no documentation provided)
*/
- (void) setProvisionUserPassword: (NSString *) newProvisionUserPassword
{
[newProvisionUserPassword retain];
[_provisionUserPassword release];
_provisionUserPassword = newProvisionUserPassword;
}
/**
* (no documentation provided)
*/
- (int) retryMaxAttempts
{
return _retryMaxAttempts;
}
/**
* (no documentation provided)
*/
- (void) setRetryMaxAttempts: (int) newRetryMaxAttempts
{
_retryMaxAttempts = newRetryMaxAttempts;
}
/**
* (no documentation provided)
*/
- (NSArray *) provisionAttachments
{
return _provisionAttachments;
}
/**
* (no documentation provided)
*/
- (void) setProvisionAttachments: (NSArray *) newProvisionAttachments
{
[newProvisionAttachments retain];
[_provisionAttachments release];
_provisionAttachments = newProvisionAttachments;
}
/**
* (no documentation provided)
*/
- (BOOL) overwriteIfDuplicate
{
return _overwriteIfDuplicate;
}
/**
* (no documentation provided)
*/
- (void) setOverwriteIfDuplicate: (BOOL) newOverwriteIfDuplicate
{
_overwriteIfDuplicate = newOverwriteIfDuplicate;
}
/**
* (no documentation provided)
*/
- (BOOL) provisionSecureURL
{
return _provisionSecureURL;
}
/**
* (no documentation provided)
*/
- (void) setProvisionSecureURL: (BOOL) newProvisionSecureURL
{
_provisionSecureURL = newProvisionSecureURL;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *) deviceCredentialsTight
{
return _deviceCredentialsTight;
}
/**
* (no documentation provided)
*/
- (void) setDeviceCredentialsTight: (enum EDC_APIS_CLIENTEDCDeviceCredentialsTight *) newDeviceCredentialsTight
{
if (_deviceCredentialsTight != NULL) {
free(_deviceCredentialsTight);
}
_deviceCredentialsTight = newDeviceCredentialsTight;
}
- (void) dealloc
{
[self setActivatesOn: nil];
[self setExpiresOn: nil];
[self setClientId: nil];
[self setProvisionUserUsername: nil];
[self setProvisionUserPassword: nil];
[self setProvisionAttachments: nil];
[self setDeviceCredentialsTight: NULL];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCProvisionRequestCreator *_eDC_APIS_CLIENTEDCProvisionRequestCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCProvisionRequestCreator = (EDC_APIS_CLIENTEDCProvisionRequestCreator *) [EDC_APIS_CLIENTEDCProvisionRequestCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCProvisionRequestCreator;
}
//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 EDC_APIS_CLIENTEDCProvisionRequestCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCProvisionRequestCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCProvisionRequestCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCProvisionRequestCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCProvisionRequestCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCProvisionRequestCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCProvisionRequestCreator *_eDC_APIS_CLIENTEDCProvisionRequestCreator = [[EDC_APIS_CLIENTEDCProvisionRequestCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCProvisionRequestCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCProvisionRequestCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCProvisionRequestCreator autorelease];
return _eDC_APIS_CLIENTEDCProvisionRequestCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCProvisionRequestCreator 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 EDC_APIS_CLIENTEDCProvisionRequestCreator 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 EDC_APIS_CLIENTEDCProvisionRequestCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}provisionRequestCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCProvisionRequestCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCProvisionRequestCreator *_provisionRequestCreator = 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 {http://eurotech.com/edc/2.0}provisionRequestCreator."];
}
}
if (xmlStrcmp(BAD_CAST "provisionRequestCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}provisionRequestCreator.");
#endif
_provisionRequestCreator = (EDC_APIS_CLIENTEDCProvisionRequestCreator *)[EDC_APIS_CLIENTEDCProvisionRequestCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}provisionRequestCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCProvisionRequestCreator. Expected element {http://eurotech.com/edc/2.0}provisionRequestCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCProvisionRequestCreator. Expected element {http://eurotech.com/edc/2.0}provisionRequestCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _provisionRequestCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCProvisionRequestCreator to XML under element name "{http://eurotech.com/edc/2.0}provisionRequestCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _provisionRequestCreator The ProvisionRequestCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCProvisionRequestCreator 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, BAD_CAST "edc", BAD_CAST "provisionRequestCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}provisionRequestCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}provisionRequestCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}provisionRequestCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}provisionRequestCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}provisionRequestCreator for root element {http://eurotech.com/edc/2.0}provisionRequestCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}provisionRequestCreator for root element {http://eurotech.com/edc/2.0}provisionRequestCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}provisionRequestCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "activatesOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}activatesOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}activatesOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setActivatesOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "expiresOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}expiresOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}expiresOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setExpiresOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "clientId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setClientId: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "generateActivationKey", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setGenerateActivationKey: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "provisionUserUsername", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}provisionUserUsername of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}provisionUserUsername of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setProvisionUserUsername: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "provisionUserPassword", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}provisionUserPassword of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}provisionUserPassword of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setProvisionUserPassword: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "retryMaxAttempts", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRetryMaxAttempts: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "provisionAttachments", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}provisionAttachments of type {http://eurotech.com/edc/2.0}jobAttachmentCreator.");
#endif
__child = [EDC_APIS_CLIENTEDCJobAttachmentCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}provisionAttachments of type {http://eurotech.com/edc/2.0}jobAttachmentCreator.");
#endif
if ([self provisionAttachments]) {
[self setProvisionAttachments: [[self provisionAttachments] arrayByAddingObject: __child]];
}
else {
[self setProvisionAttachments: [NSArray arrayWithObject: __child]];
}
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "overwriteIfDuplicate", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setOverwriteIfDuplicate: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "provisionSecureURL", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setProvisionSecureURL: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "deviceCredentialsTight", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceCredentialsTightType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setDeviceCredentialsTight: ((enum EDC_APIS_CLIENTEDCDeviceCredentialsTight*) _child_accessor)];
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self activatesOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "activatesOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}activatesOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}activatesOn...");
#endif
[[self activatesOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}activatesOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}activatesOn."];
}
}
if ([self expiresOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "expiresOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}expiresOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}expiresOn...");
#endif
[[self expiresOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}expiresOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}expiresOn."];
}
}
if ([self clientId]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "clientId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}clientId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}clientId...");
#endif
[[self clientId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}clientId...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}clientId."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "generateActivationKey", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}generateActivationKey."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}generateActivationKey...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_generateActivationKey);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}generateActivationKey...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}generateActivationKey."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}generateActivationKey."];
}
}
if ([self provisionUserUsername]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "provisionUserUsername", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}provisionUserUsername."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}provisionUserUsername...");
#endif
[[self provisionUserUsername] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}provisionUserUsername...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}provisionUserUsername."];
}
}
if ([self provisionUserPassword]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "provisionUserPassword", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}provisionUserPassword."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}provisionUserPassword...");
#endif
[[self provisionUserPassword] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}provisionUserPassword...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}provisionUserPassword."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "retryMaxAttempts", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}retryMaxAttempts...");
#endif
status = xmlTextWriterWriteIntType(writer, &_retryMaxAttempts);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}retryMaxAttempts...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
}
if ([self provisionAttachments]) {
__enumerator = [[self provisionAttachments] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "provisionAttachments", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}provisionAttachments."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}provisionAttachments...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}provisionAttachments...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}provisionAttachments."];
}
} //end item iterator.
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "overwriteIfDuplicate", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}overwriteIfDuplicate."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}overwriteIfDuplicate...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_overwriteIfDuplicate);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}overwriteIfDuplicate...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}overwriteIfDuplicate."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}overwriteIfDuplicate."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "provisionSecureURL", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}provisionSecureURL."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}provisionSecureURL...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_provisionSecureURL);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}provisionSecureURL...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}provisionSecureURL."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}provisionSecureURL."];
}
}
if ([self deviceCredentialsTight] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "deviceCredentialsTight", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}deviceCredentialsTight."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}deviceCredentialsTight...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceCredentialsTightType(writer, [self deviceCredentialsTight]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}deviceCredentialsTight...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}deviceCredentialsTight."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}deviceCredentialsTight."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCProvisionRequestCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCProvisionRequestCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCProvisionRequestStatus_M
#define DEF_EDC_APIS_CLIENTEDCProvisionRequestStatus_M
/**
* Reads a ProvisionRequestStatus from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The ProvisionRequestStatus, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCProvisionRequestStatus *xmlTextReaderReadEDC_APIS_CLIENTEDCProvisionRequestStatusType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCProvisionRequestStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCProvisionRequestStatus));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "ENABLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_ENABLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DISABLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_DISABLED;
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 _provisionRequestStatus The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCProvisionRequestStatus *formatStringToEDC_APIS_CLIENTEDCProvisionRequestStatusType(NSString *_provisionRequestStatus)
{
enum EDC_APIS_CLIENTEDCProvisionRequestStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCProvisionRequestStatus));
if ([@"ENABLED" isEqualToString:_provisionRequestStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_ENABLED;
}
else if ([@"DISABLED" isEqualToString:_provisionRequestStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_DISABLED;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_provisionRequestStatus UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a ProvisionRequestStatus to XML.
*
* @param writer The XML writer.
* @param _provisionRequestStatus The ProvisionRequestStatus to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCProvisionRequestStatusType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCProvisionRequestStatus *_provisionRequestStatus)
{
switch (*_provisionRequestStatus) {
case EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_ENABLED:
return xmlTextWriterWriteString(writer, BAD_CAST "ENABLED");
case EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_DISABLED:
return xmlTextWriterWriteString(writer, BAD_CAST "DISABLED");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of ProvisionRequestStatus.
*
* @param _provisionRequestStatus The ProvisionRequestStatus to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCProvisionRequestStatusTypeToString(enum EDC_APIS_CLIENTEDCProvisionRequestStatus *_provisionRequestStatus)
{
switch (*_provisionRequestStatus) {
case EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_ENABLED:
return @"ENABLED";
case EDC_APIS_CLIENT_EDC_PROVISIONREQUESTSTATUS_DISABLED:
return @"DISABLED";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCProvisionRequestStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCRoleCreator_M
#define DEF_EDC_APIS_CLIENTEDCRoleCreator_M
/**
* RoleCreator encapsulates all the information needed to create a new Role in the system.
* A Role is associated to an Account and a set of Permissions.
*/
@implementation EDC_APIS_CLIENTEDCRoleCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) tags
{
return _tags;
}
/**
* (no documentation provided)
*/
- (void) setTags: (NSString *) newTags
{
[newTags retain];
[_tags release];
_tags = newTags;
}
/**
* (no documentation provided)
*/
- (NSArray *) permissions
{
return _permissions;
}
/**
* (no documentation provided)
*/
- (void) setPermissions: (NSArray *) newPermissions
{
[newPermissions retain];
[_permissions release];
_permissions = newPermissions;
}
- (void) dealloc
{
[self setName: nil];
[self setTags: nil];
[self setPermissions: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCRoleCreator *_eDC_APIS_CLIENTEDCRoleCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCRoleCreator = (EDC_APIS_CLIENTEDCRoleCreator *) [EDC_APIS_CLIENTEDCRoleCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCRoleCreator;
}
//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 EDC_APIS_CLIENTEDCRoleCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCRoleCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCRoleCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCRoleCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCRoleCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCRoleCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCRoleCreator *_eDC_APIS_CLIENTEDCRoleCreator = [[EDC_APIS_CLIENTEDCRoleCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCRoleCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCRoleCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCRoleCreator autorelease];
return _eDC_APIS_CLIENTEDCRoleCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCRoleCreator 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 EDC_APIS_CLIENTEDCRoleCreator 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 EDC_APIS_CLIENTEDCRoleCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}roleCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCRoleCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCRoleCreator *_roleCreator = 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 {http://eurotech.com/edc/2.0}roleCreator."];
}
}
if (xmlStrcmp(BAD_CAST "roleCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}roleCreator.");
#endif
_roleCreator = (EDC_APIS_CLIENTEDCRoleCreator *)[EDC_APIS_CLIENTEDCRoleCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}roleCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRoleCreator. Expected element {http://eurotech.com/edc/2.0}roleCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRoleCreator. Expected element {http://eurotech.com/edc/2.0}roleCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _roleCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCRoleCreator to XML under element name "{http://eurotech.com/edc/2.0}roleCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _roleCreator The RoleCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCRoleCreator 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, BAD_CAST "edc", BAD_CAST "roleCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}roleCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}roleCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}roleCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}roleCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}roleCreator for root element {http://eurotech.com/edc/2.0}roleCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}roleCreator for root element {http://eurotech.com/edc/2.0}roleCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}roleCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}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 "tags", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}tags of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}tags of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setTags: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "permissions", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/edc/2.0}permissions...");
#endif
//start wrapper element "{http://eurotech.com/edc/2.0}permissions"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "permission", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}permission of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[NSString alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [NSString readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}permission of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self permissions]) {
[self setPermissions: [[self permissions] arrayByAddingObject: __child]];
}
else {
[self setPermissions: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/edc/2.0}permissions...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setPermissions: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self tags]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "tags", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}tags."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}tags...");
#endif
[[self tags] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}tags...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}tags."];
}
}
if ([self permissions]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "permissions", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/edc/2.0}permissions."];
}
__enumerator = [[self permissions] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "permission", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}permission."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}permission...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}permission...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}permission."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/edc/2.0}permissions."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCRoleCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCRoleCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCRuleCreator_M
#define DEF_EDC_APIS_CLIENTEDCRuleCreator_M
/**
* RuleCreator encapsulates all the information needed to create a new Rule in the system.
* A Rule is associated to an Account.
*
*/
@implementation EDC_APIS_CLIENTEDCRuleCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) description
{
return _description;
}
/**
* (no documentation provided)
*/
- (void) setDescription: (NSString *) newDescription
{
[newDescription retain];
[_description release];
_description = newDescription;
}
/**
* (no documentation provided)
*/
- (BOOL) enabled
{
return _enabled;
}
/**
* (no documentation provided)
*/
- (void) setEnabled: (BOOL) newEnabled
{
_enabled = newEnabled;
}
/**
* Specifies the Esper query using the Event Processing Language (EPL). For more information about using
* EPL please refer to the example templates the
* Esper documentation.
*
* The properties for the EdcMessageEvent object are: isControlTopic, account, asset, semanticTopic, fullTopic,
* receivedOn, metrics, sentOn, position, payload, isForwarded, and UUID.
*/
- (NSString *) query
{
return _query;
}
/**
* Specifies the Esper query using the Event Processing Language (EPL). For more information about using
* EPL please refer to the example templates the
* Esper documentation.
*
* The properties for the EdcMessageEvent object are: isControlTopic, account, asset, semanticTopic, fullTopic,
* receivedOn, metrics, sentOn, position, payload, isForwarded, and UUID.
*/
- (void) setQuery: (NSString *) newQuery
{
[newQuery retain];
[_query release];
_query = newQuery;
}
/**
* (no documentation provided)
*/
- (NSArray *) ruleActionConfigurations
{
return _ruleActionConfigurations;
}
/**
* (no documentation provided)
*/
- (void) setRuleActionConfigurations: (NSArray *) newRuleActionConfigurations
{
[newRuleActionConfigurations retain];
[_ruleActionConfigurations release];
_ruleActionConfigurations = newRuleActionConfigurations;
}
- (void) dealloc
{
[self setName: nil];
[self setDescription: nil];
[self setQuery: nil];
[self setRuleActionConfigurations: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCRuleCreator *_eDC_APIS_CLIENTEDCRuleCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCRuleCreator = (EDC_APIS_CLIENTEDCRuleCreator *) [EDC_APIS_CLIENTEDCRuleCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCRuleCreator;
}
//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 EDC_APIS_CLIENTEDCRuleCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCRuleCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCRuleCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCRuleCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCRuleCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCRuleCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCRuleCreator *_eDC_APIS_CLIENTEDCRuleCreator = [[EDC_APIS_CLIENTEDCRuleCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCRuleCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCRuleCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCRuleCreator autorelease];
return _eDC_APIS_CLIENTEDCRuleCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCRuleCreator 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 EDC_APIS_CLIENTEDCRuleCreator 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 EDC_APIS_CLIENTEDCRuleCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}ruleCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCRuleCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCRuleCreator *_ruleCreator = 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 {http://eurotech.com/edc/2.0}ruleCreator."];
}
}
if (xmlStrcmp(BAD_CAST "ruleCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}ruleCreator.");
#endif
_ruleCreator = (EDC_APIS_CLIENTEDCRuleCreator *)[EDC_APIS_CLIENTEDCRuleCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}ruleCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRuleCreator. Expected element {http://eurotech.com/edc/2.0}ruleCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRuleCreator. Expected element {http://eurotech.com/edc/2.0}ruleCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _ruleCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCRuleCreator to XML under element name "{http://eurotech.com/edc/2.0}ruleCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _ruleCreator The RuleCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCRuleCreator 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, BAD_CAST "edc", BAD_CAST "ruleCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}ruleCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}ruleCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}ruleCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}ruleCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}ruleCreator for root element {http://eurotech.com/edc/2.0}ruleCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}ruleCreator for root element {http://eurotech.com/edc/2.0}ruleCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}ruleCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}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 "description", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}description of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}description of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setDescription: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "enabled", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setEnabled: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "query", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}query of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}query of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setQuery: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "ruleActionConfigurations", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/edc/2.0}ruleActionConfigurations...");
#endif
//start wrapper element "{http://eurotech.com/edc/2.0}ruleActionConfigurations"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "ruleActionConfiguration", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}ruleActionConfiguration of type {http://eurotech.com/edc/2.0}ruleActionConfiguration.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[EDC_APIS_CLIENTEDCRuleActionConfiguration alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [EDC_APIS_CLIENTEDCRuleActionConfiguration readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}ruleActionConfiguration of type {http://eurotech.com/edc/2.0}ruleActionConfiguration.");
#endif
if ([self ruleActionConfigurations]) {
[self setRuleActionConfigurations: [[self ruleActionConfigurations] arrayByAddingObject: __child]];
}
else {
[self setRuleActionConfigurations: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/edc/2.0}ruleActionConfigurations...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setRuleActionConfigurations: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self description]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "description", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}description."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}description...");
#endif
[[self description] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}description...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}description."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "enabled", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}enabled."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}enabled...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_enabled);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}enabled...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}enabled."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}enabled."];
}
}
if ([self query]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "query", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}query."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}query...");
#endif
[[self query] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}query...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}query."];
}
}
if ([self ruleActionConfigurations]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "ruleActionConfigurations", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/edc/2.0}ruleActionConfigurations."];
}
__enumerator = [[self ruleActionConfigurations] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "ruleActionConfiguration", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}ruleActionConfiguration."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}ruleActionConfiguration...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}ruleActionConfiguration...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}ruleActionConfiguration."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/edc/2.0}ruleActionConfigurations."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCRuleCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCRuleCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCTagApplication_M
#define DEF_EDC_APIS_CLIENTEDCTagApplication_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCTagApplication
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (long long) tagId
{
return _tagId;
}
/**
* (no documentation provided)
*/
- (void) setTagId: (long long) newTagId
{
_tagId = newTagId;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCEtype *) entityType
{
return _entityType;
}
/**
* (no documentation provided)
*/
- (void) setEntityType: (enum EDC_APIS_CLIENTEDCEtype *) newEntityType
{
if (_entityType != NULL) {
free(_entityType);
}
_entityType = newEntityType;
}
/**
* (no documentation provided)
*/
- (NSString *) entityId
{
return _entityId;
}
/**
* (no documentation provided)
*/
- (void) setEntityId: (NSString *) newEntityId
{
[newEntityId retain];
[_entityId release];
_entityId = newEntityId;
}
/**
* (no documentation provided)
*/
- (NSDate *) appliedOn
{
return _appliedOn;
}
/**
* (no documentation provided)
*/
- (void) setAppliedOn: (NSDate *) newAppliedOn
{
[newAppliedOn retain];
[_appliedOn release];
_appliedOn = newAppliedOn;
}
/**
* (no documentation provided)
*/
- (long long) appliedBy
{
return _appliedBy;
}
/**
* (no documentation provided)
*/
- (void) setAppliedBy: (long long) newAppliedBy
{
_appliedBy = newAppliedBy;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (int) optlock
{
return _optlock;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (void) setOptlock: (int) newOptlock
{
_optlock = newOptlock;
}
- (void) dealloc
{
[self setEntityType: NULL];
[self setEntityId: nil];
[self setAppliedOn: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCTagApplication *_eDC_APIS_CLIENTEDCTagApplication;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCTagApplication = (EDC_APIS_CLIENTEDCTagApplication *) [EDC_APIS_CLIENTEDCTagApplication readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCTagApplication;
}
//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 EDC_APIS_CLIENTEDCTagApplication */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCTagApplication (JAXB)
@end /*interface EDC_APIS_CLIENTEDCTagApplication (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCTagApplication (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCTagApplication from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCTagApplication defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCTagApplication *_eDC_APIS_CLIENTEDCTagApplication = [[EDC_APIS_CLIENTEDCTagApplication alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCTagApplication initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCTagApplication = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCTagApplication autorelease];
return _eDC_APIS_CLIENTEDCTagApplication;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCTagApplication 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 EDC_APIS_CLIENTEDCTagApplication 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 EDC_APIS_CLIENTEDCTagApplication from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}tagApplication".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCTagApplication.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCTagApplication *_tagApplication = 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 {http://eurotech.com/edc/2.0}tagApplication."];
}
}
if (xmlStrcmp(BAD_CAST "tagApplication", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}tagApplication.");
#endif
_tagApplication = (EDC_APIS_CLIENTEDCTagApplication *)[EDC_APIS_CLIENTEDCTagApplication readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}tagApplication.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagApplication. Expected element {http://eurotech.com/edc/2.0}tagApplication. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagApplication. Expected element {http://eurotech.com/edc/2.0}tagApplication. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _tagApplication;
}
/**
* Writes this EDC_APIS_CLIENTEDCTagApplication to XML under element name "{http://eurotech.com/edc/2.0}tagApplication".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _tagApplication The TagApplication to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCTagApplication 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, BAD_CAST "edc", BAD_CAST "tagApplication", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}tagApplication. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}tagApplication...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}tagApplication'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}tagApplication...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}tagApplication for root element {http://eurotech.com/edc/2.0}tagApplication...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}tagApplication for root element {http://eurotech.com/edc/2.0}tagApplication...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}tagApplication. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "tagId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTagId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "entityType", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCEtypeType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setEntityType: ((enum EDC_APIS_CLIENTEDCEtype*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "entityId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}entityId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}entityId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setEntityId: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "appliedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}appliedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}appliedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setAppliedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "appliedBy", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAppliedBy: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "optlock", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setOptlock: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "tagId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}tagId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}tagId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_tagId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}tagId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}tagId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}tagId."];
}
}
if ([self entityType] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "entityType", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}entityType."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}entityType...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCEtypeType(writer, [self entityType]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}entityType...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}entityType."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}entityType."];
}
}
if ([self entityId]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "entityId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}entityId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}entityId...");
#endif
[[self entityId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}entityId...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}entityId."];
}
}
if ([self appliedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "appliedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}appliedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}appliedOn...");
#endif
[[self appliedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}appliedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}appliedOn."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "appliedBy", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}appliedBy."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}appliedBy...");
#endif
status = xmlTextWriterWriteLongType(writer, &_appliedBy);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}appliedBy...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}appliedBy."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}appliedBy."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "optlock", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}optlock."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}optlock...");
#endif
status = xmlTextWriterWriteIntType(writer, &_optlock);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}optlock...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}optlock."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}optlock."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCTagApplication (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCTagApplication_M */
#ifndef DEF_EDC_APIS_CLIENTEDCTagCreator_M
#define DEF_EDC_APIS_CLIENTEDCTagCreator_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCTagCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
- (void) dealloc
{
[self setName: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCTagCreator *_eDC_APIS_CLIENTEDCTagCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCTagCreator = (EDC_APIS_CLIENTEDCTagCreator *) [EDC_APIS_CLIENTEDCTagCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCTagCreator;
}
//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 EDC_APIS_CLIENTEDCTagCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCTagCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCTagCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCTagCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCTagCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCTagCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCTagCreator *_eDC_APIS_CLIENTEDCTagCreator = [[EDC_APIS_CLIENTEDCTagCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCTagCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCTagCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCTagCreator autorelease];
return _eDC_APIS_CLIENTEDCTagCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCTagCreator 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 EDC_APIS_CLIENTEDCTagCreator 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 EDC_APIS_CLIENTEDCTagCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}tagCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCTagCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCTagCreator *_tagCreator = 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 {http://eurotech.com/edc/2.0}tagCreator."];
}
}
if (xmlStrcmp(BAD_CAST "tagCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}tagCreator.");
#endif
_tagCreator = (EDC_APIS_CLIENTEDCTagCreator *)[EDC_APIS_CLIENTEDCTagCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}tagCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagCreator. Expected element {http://eurotech.com/edc/2.0}tagCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagCreator. Expected element {http://eurotech.com/edc/2.0}tagCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _tagCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCTagCreator to XML under element name "{http://eurotech.com/edc/2.0}tagCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _tagCreator The TagCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCTagCreator 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, BAD_CAST "edc", BAD_CAST "tagCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}tagCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}tagCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}tagCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}tagCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}tagCreator for root element {http://eurotech.com/edc/2.0}tagCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}tagCreator for root element {http://eurotech.com/edc/2.0}tagCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}tagCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setName: __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 (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCTagCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCTagCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCTagDeviceSummary_M
#define DEF_EDC_APIS_CLIENTEDCTagDeviceSummary_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCTagDeviceSummary
/**
* (no documentation provided)
*/
- (EDC_APIS_CLIENTEDCXmlMapAdaptedMap *) tagSummary
{
return _tagSummary;
}
/**
* (no documentation provided)
*/
- (void) setTagSummary: (EDC_APIS_CLIENTEDCXmlMapAdaptedMap *) newTagSummary
{
[newTagSummary retain];
[_tagSummary release];
_tagSummary = newTagSummary;
}
- (void) dealloc
{
[self setTagSummary: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCTagDeviceSummary *_eDC_APIS_CLIENTEDCTagDeviceSummary;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCTagDeviceSummary = (EDC_APIS_CLIENTEDCTagDeviceSummary *) [EDC_APIS_CLIENTEDCTagDeviceSummary readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCTagDeviceSummary;
}
//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 EDC_APIS_CLIENTEDCTagDeviceSummary */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCTagDeviceSummary (JAXB)
@end /*interface EDC_APIS_CLIENTEDCTagDeviceSummary (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCTagDeviceSummary (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCTagDeviceSummary from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCTagDeviceSummary defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCTagDeviceSummary *_eDC_APIS_CLIENTEDCTagDeviceSummary = [[EDC_APIS_CLIENTEDCTagDeviceSummary alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCTagDeviceSummary initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCTagDeviceSummary = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCTagDeviceSummary autorelease];
return _eDC_APIS_CLIENTEDCTagDeviceSummary;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCTagDeviceSummary 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 EDC_APIS_CLIENTEDCTagDeviceSummary 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 EDC_APIS_CLIENTEDCTagDeviceSummary from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}tagDeviceSummary".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCTagDeviceSummary.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCTagDeviceSummary *_tagDeviceSummary = 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 {http://eurotech.com/edc/2.0}tagDeviceSummary."];
}
}
if (xmlStrcmp(BAD_CAST "tagDeviceSummary", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}tagDeviceSummary.");
#endif
_tagDeviceSummary = (EDC_APIS_CLIENTEDCTagDeviceSummary *)[EDC_APIS_CLIENTEDCTagDeviceSummary readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}tagDeviceSummary.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagDeviceSummary. Expected element {http://eurotech.com/edc/2.0}tagDeviceSummary. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCTagDeviceSummary. Expected element {http://eurotech.com/edc/2.0}tagDeviceSummary. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _tagDeviceSummary;
}
/**
* Writes this EDC_APIS_CLIENTEDCTagDeviceSummary to XML under element name "{http://eurotech.com/edc/2.0}tagDeviceSummary".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _tagDeviceSummary The TagDeviceSummary to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCTagDeviceSummary 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, BAD_CAST "edc", BAD_CAST "tagDeviceSummary", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}tagDeviceSummary. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}tagDeviceSummary...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}tagDeviceSummary'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}tagDeviceSummary...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}tagDeviceSummary for root element {http://eurotech.com/edc/2.0}tagDeviceSummary...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}tagDeviceSummary for root element {http://eurotech.com/edc/2.0}tagDeviceSummary...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}tagDeviceSummary. 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 "tagSummary", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}tagSummary of type {http://eurotech.com/edc/2.0}xmlMapAdaptedMap.");
#endif
__child = [EDC_APIS_CLIENTEDCXmlMapAdaptedMap readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}tagSummary of type {http://eurotech.com/edc/2.0}xmlMapAdaptedMap.");
#endif
[self setTagSummary: __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 tagSummary]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "tagSummary", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}tagSummary."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}tagSummary...");
#endif
[[self tagSummary] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}tagSummary...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}tagSummary."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCTagDeviceSummary (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCTagDeviceSummary_M */
#ifndef DEF_EDC_APIS_CLIENTEDCUserStatus_M
#define DEF_EDC_APIS_CLIENTEDCUserStatus_M
/**
* Reads a UserStatus from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The UserStatus, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCUserStatus *xmlTextReaderReadEDC_APIS_CLIENTEDCUserStatusType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCUserStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCUserStatus));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "ENABLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_ENABLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "DISABLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_DISABLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "SUSPENDED") == 0) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_SUSPENDED;
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 _userStatus The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCUserStatus *formatStringToEDC_APIS_CLIENTEDCUserStatusType(NSString *_userStatus)
{
enum EDC_APIS_CLIENTEDCUserStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCUserStatus));
if ([@"ENABLED" isEqualToString:_userStatus]) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_ENABLED;
}
else if ([@"DISABLED" isEqualToString:_userStatus]) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_DISABLED;
}
else if ([@"SUSPENDED" isEqualToString:_userStatus]) {
*value = EDC_APIS_CLIENT_EDC_USERSTATUS_SUSPENDED;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_userStatus UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a UserStatus to XML.
*
* @param writer The XML writer.
* @param _userStatus The UserStatus to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCUserStatusType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCUserStatus *_userStatus)
{
switch (*_userStatus) {
case EDC_APIS_CLIENT_EDC_USERSTATUS_ENABLED:
return xmlTextWriterWriteString(writer, BAD_CAST "ENABLED");
case EDC_APIS_CLIENT_EDC_USERSTATUS_DISABLED:
return xmlTextWriterWriteString(writer, BAD_CAST "DISABLED");
case EDC_APIS_CLIENT_EDC_USERSTATUS_SUSPENDED:
return xmlTextWriterWriteString(writer, BAD_CAST "SUSPENDED");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of UserStatus.
*
* @param _userStatus The UserStatus to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCUserStatusTypeToString(enum EDC_APIS_CLIENTEDCUserStatus *_userStatus)
{
switch (*_userStatus) {
case EDC_APIS_CLIENT_EDC_USERSTATUS_ENABLED:
return @"ENABLED";
case EDC_APIS_CLIENT_EDC_USERSTATUS_DISABLED:
return @"DISABLED";
case EDC_APIS_CLIENT_EDC_USERSTATUS_SUSPENDED:
return @"SUSPENDED";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCUserStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceJobCreator_M
#define DEF_EDC_APIS_CLIENTEDCDeviceJobCreator_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCDeviceJobCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceJobType *) jobType
{
return _jobType;
}
/**
* (no documentation provided)
*/
- (void) setJobType: (enum EDC_APIS_CLIENTEDCDeviceJobType *) newJobType
{
if (_jobType != NULL) {
free(_jobType);
}
_jobType = newJobType;
}
/**
* (no documentation provided)
*/
- (NSString *) jobDisplayName
{
return _jobDisplayName;
}
/**
* (no documentation provided)
*/
- (void) setJobDisplayName: (NSString *) newJobDisplayName
{
[newJobDisplayName retain];
[_jobDisplayName release];
_jobDisplayName = newJobDisplayName;
}
/**
* (no documentation provided)
*/
- (NSString *) jobProperties
{
return _jobProperties;
}
/**
* (no documentation provided)
*/
- (void) setJobProperties: (NSString *) newJobProperties
{
[newJobProperties retain];
[_jobProperties release];
_jobProperties = newJobProperties;
}
/**
* (no documentation provided)
*/
- (EDC_APIS_CLIENTEDCJobAttachmentCreator *) jobAttachment
{
return _jobAttachment;
}
/**
* (no documentation provided)
*/
- (void) setJobAttachment: (EDC_APIS_CLIENTEDCJobAttachmentCreator *) newJobAttachment
{
[newJobAttachment retain];
[_jobAttachment release];
_jobAttachment = newJobAttachment;
}
/**
* (no documentation provided)
*/
- (NSArray *) targetClientIds
{
return _targetClientIds;
}
/**
* (no documentation provided)
*/
- (void) setTargetClientIds: (NSArray *) newTargetClientIds
{
[newTargetClientIds retain];
[_targetClientIds release];
_targetClientIds = newTargetClientIds;
}
/**
* (no documentation provided)
*/
- (NSArray *) targetDeviceTags
{
return _targetDeviceTags;
}
/**
* (no documentation provided)
*/
- (void) setTargetDeviceTags: (NSArray *) newTargetDeviceTags
{
[newTargetDeviceTags retain];
[_targetDeviceTags release];
_targetDeviceTags = newTargetDeviceTags;
}
/**
* (no documentation provided)
*/
- (NSDate *) startOn
{
return _startOn;
}
/**
* (no documentation provided)
*/
- (void) setStartOn: (NSDate *) newStartOn
{
[newStartOn retain];
[_startOn release];
_startOn = newStartOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) endOn
{
return _endOn;
}
/**
* (no documentation provided)
*/
- (void) setEndOn: (NSDate *) newEndOn
{
[newEndOn retain];
[_endOn release];
_endOn = newEndOn;
}
/**
* (no documentation provided)
*/
- (int) timezoneInMins
{
return _timezoneInMins;
}
/**
* (no documentation provided)
*/
- (void) setTimezoneInMins: (int) newTimezoneInMins
{
_timezoneInMins = newTimezoneInMins;
}
/**
* (no documentation provided)
*/
- (NSString *) cronRetryExpression
{
return _cronRetryExpression;
}
/**
* (no documentation provided)
*/
- (void) setCronRetryExpression: (NSString *) newCronRetryExpression
{
[newCronRetryExpression retain];
[_cronRetryExpression release];
_cronRetryExpression = newCronRetryExpression;
}
/**
* (no documentation provided)
*/
- (int) retryEvery
{
return _retryEvery;
}
/**
* (no documentation provided)
*/
- (void) setRetryEvery: (int) newRetryEvery
{
_retryEvery = newRetryEvery;
}
/**
* (no documentation provided)
*/
- (int) retryMaxAttempts
{
return _retryMaxAttempts;
}
/**
* (no documentation provided)
*/
- (void) setRetryMaxAttempts: (int) newRetryMaxAttempts
{
_retryMaxAttempts = newRetryMaxAttempts;
}
/**
* (no documentation provided)
*/
- (BOOL) selectAllClientIds
{
return _selectAllClientIds;
}
/**
* (no documentation provided)
*/
- (void) setSelectAllClientIds: (BOOL) newSelectAllClientIds
{
_selectAllClientIds = newSelectAllClientIds;
}
/**
* (no documentation provided)
*/
- (EDC_APIS_CLIENTEDCParametersMapType *) jobPropertiesMap
{
return _jobPropertiesMap;
}
/**
* (no documentation provided)
*/
- (void) setJobPropertiesMap: (EDC_APIS_CLIENTEDCParametersMapType *) newJobPropertiesMap
{
[newJobPropertiesMap retain];
[_jobPropertiesMap release];
_jobPropertiesMap = newJobPropertiesMap;
}
/**
* (no documentation provided)
*/
- (long long *) requestTimeout
{
return _requestTimeout;
}
/**
* (no documentation provided)
*/
- (void) setRequestTimeout: (long long *) newRequestTimeout
{
if (_requestTimeout != NULL) {
free(_requestTimeout);
}
_requestTimeout = newRequestTimeout;
}
/**
* (no documentation provided)
*/
- (BOOL) processOnConnect
{
return _processOnConnect;
}
/**
* (no documentation provided)
*/
- (void) setProcessOnConnect: (BOOL) newProcessOnConnect
{
_processOnConnect = newProcessOnConnect;
}
/**
* (no documentation provided)
*/
- (BOOL) sendWakeupSMS
{
return _sendWakeupSMS;
}
/**
* (no documentation provided)
*/
- (void) setSendWakeupSMS: (BOOL) newSendWakeupSMS
{
_sendWakeupSMS = newSendWakeupSMS;
}
/**
* (no documentation provided)
*/
- (long long *) wakeupTimeout
{
return _wakeupTimeout;
}
/**
* (no documentation provided)
*/
- (void) setWakeupTimeout: (long long *) newWakeupTimeout
{
if (_wakeupTimeout != NULL) {
free(_wakeupTimeout);
}
_wakeupTimeout = newWakeupTimeout;
}
/**
* (no documentation provided)
*/
- (long long *) deviceInactivityTimeout
{
return _deviceInactivityTimeout;
}
/**
* (no documentation provided)
*/
- (void) setDeviceInactivityTimeout: (long long *) newDeviceInactivityTimeout
{
if (_deviceInactivityTimeout != NULL) {
free(_deviceInactivityTimeout);
}
_deviceInactivityTimeout = newDeviceInactivityTimeout;
}
- (void) dealloc
{
[self setJobType: NULL];
[self setJobDisplayName: nil];
[self setJobProperties: nil];
[self setJobAttachment: nil];
[self setTargetClientIds: nil];
[self setTargetDeviceTags: nil];
[self setStartOn: nil];
[self setEndOn: nil];
[self setCronRetryExpression: nil];
[self setJobPropertiesMap: nil];
[self setRequestTimeout: NULL];
[self setWakeupTimeout: NULL];
[self setDeviceInactivityTimeout: NULL];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCDeviceJobCreator *_eDC_APIS_CLIENTEDCDeviceJobCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCDeviceJobCreator = (EDC_APIS_CLIENTEDCDeviceJobCreator *) [EDC_APIS_CLIENTEDCDeviceJobCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCDeviceJobCreator;
}
//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 EDC_APIS_CLIENTEDCDeviceJobCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCDeviceJobCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCDeviceJobCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCDeviceJobCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCDeviceJobCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCDeviceJobCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCDeviceJobCreator *_eDC_APIS_CLIENTEDCDeviceJobCreator = [[EDC_APIS_CLIENTEDCDeviceJobCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCDeviceJobCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCDeviceJobCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCDeviceJobCreator autorelease];
return _eDC_APIS_CLIENTEDCDeviceJobCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCDeviceJobCreator 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 EDC_APIS_CLIENTEDCDeviceJobCreator 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 EDC_APIS_CLIENTEDCDeviceJobCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}deviceJobCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCDeviceJobCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCDeviceJobCreator *_deviceJobCreator = 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 {http://eurotech.com/edc/2.0}deviceJobCreator."];
}
}
if (xmlStrcmp(BAD_CAST "deviceJobCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}deviceJobCreator.");
#endif
_deviceJobCreator = (EDC_APIS_CLIENTEDCDeviceJobCreator *)[EDC_APIS_CLIENTEDCDeviceJobCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}deviceJobCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceJobCreator. Expected element {http://eurotech.com/edc/2.0}deviceJobCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceJobCreator. Expected element {http://eurotech.com/edc/2.0}deviceJobCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceJobCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceJobCreator to XML under element name "{http://eurotech.com/edc/2.0}deviceJobCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceJobCreator The DeviceJobCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceJobCreator 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, BAD_CAST "edc", BAD_CAST "deviceJobCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}deviceJobCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}deviceJobCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}deviceJobCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}deviceJobCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}deviceJobCreator for root element {http://eurotech.com/edc/2.0}deviceJobCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}deviceJobCreator for root element {http://eurotech.com/edc/2.0}deviceJobCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}deviceJobCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobType", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceJobTypeType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setJobType: ((enum EDC_APIS_CLIENTEDCDeviceJobType*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobDisplayName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jobDisplayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jobDisplayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setJobDisplayName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobProperties", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jobProperties of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jobProperties of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setJobProperties: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobAttachment", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jobAttachment of type {http://eurotech.com/edc/2.0}jobAttachmentCreator.");
#endif
__child = [EDC_APIS_CLIENTEDCJobAttachmentCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jobAttachment of type {http://eurotech.com/edc/2.0}jobAttachmentCreator.");
#endif
[self setJobAttachment: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "targetClientIds", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}targetClientIds of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}targetClientIds of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self targetClientIds]) {
[self setTargetClientIds: [[self targetClientIds] arrayByAddingObject: __child]];
}
else {
[self setTargetClientIds: [NSArray arrayWithObject: __child]];
}
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "targetDeviceTag", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}targetDeviceTag of type {http://www.w3.org/2001/XMLSchema}long.");
#endif
_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."];
}
__child = [NSValue value: _child_accessor withObjCType: @encode(long long)];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}targetDeviceTag of type {http://www.w3.org/2001/XMLSchema}long.");
#endif
if ([self targetDeviceTags]) {
[self setTargetDeviceTags: [[self targetDeviceTags] arrayByAddingObject: __child]];
}
else {
[self setTargetDeviceTags: [NSArray arrayWithObject: __child]];
}
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "startOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}startOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}startOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setStartOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "endOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}endOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}endOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setEndOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "timezoneInMins", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTimezoneInMins: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "cronRetryExpression", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}cronRetryExpression of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}cronRetryExpression of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCronRetryExpression: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "retryEvery", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRetryEvery: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "retryMaxAttempts", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRetryMaxAttempts: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "selectAllClientIds", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setSelectAllClientIds: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobPropertiesMap", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}jobPropertiesMap of type {http://eurotech.com/edc/2.0}parametersMapType.");
#endif
__child = [EDC_APIS_CLIENTEDCParametersMapType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}jobPropertiesMap of type {http://eurotech.com/edc/2.0}parametersMapType.");
#endif
[self setJobPropertiesMap: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "requestTimeout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRequestTimeout: ((long long*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "processOnConnect", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setProcessOnConnect: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "sendWakeupSMS", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setSendWakeupSMS: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "wakeupTimeout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setWakeupTimeout: ((long long*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "deviceInactivityTimeout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setDeviceInactivityTimeout: ((long long*) _child_accessor)];
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self jobType] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobType", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobType."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobType...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceJobTypeType(writer, [self jobType]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobType...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}jobType."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobType."];
}
}
if ([self jobDisplayName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobDisplayName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobDisplayName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobDisplayName...");
#endif
[[self jobDisplayName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobDisplayName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobDisplayName."];
}
}
if ([self jobProperties]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobProperties", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobProperties."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobProperties...");
#endif
[[self jobProperties] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobProperties...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobProperties."];
}
}
if ([self jobAttachment]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobAttachment", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobAttachment."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobAttachment...");
#endif
[[self jobAttachment] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobAttachment...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobAttachment."];
}
}
if ([self targetClientIds]) {
__enumerator = [[self targetClientIds] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "targetClientIds", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}targetClientIds."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}targetClientIds...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}targetClientIds...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}targetClientIds."];
}
} //end item iterator.
}
if ([self targetDeviceTags]) {
__enumerator = [[self targetDeviceTags] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "targetDeviceTag", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}targetDeviceTag."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}targetDeviceTag...");
#endif
status = xmlTextWriterWriteLongType(writer, ((long long*) [((NSValue *)__item) pointerValue]));
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}targetDeviceTag."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}targetDeviceTag...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}targetDeviceTag."];
}
} //end item iterator.
}
if ([self startOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "startOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}startOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}startOn...");
#endif
[[self startOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}startOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}startOn."];
}
}
if ([self endOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "endOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}endOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}endOn...");
#endif
[[self endOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}endOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}endOn."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "timezoneInMins", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}timezoneInMins."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}timezoneInMins...");
#endif
status = xmlTextWriterWriteIntType(writer, &_timezoneInMins);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}timezoneInMins...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}timezoneInMins."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}timezoneInMins."];
}
}
if ([self cronRetryExpression]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "cronRetryExpression", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}cronRetryExpression."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}cronRetryExpression...");
#endif
[[self cronRetryExpression] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}cronRetryExpression...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}cronRetryExpression."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "retryEvery", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}retryEvery."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}retryEvery...");
#endif
status = xmlTextWriterWriteIntType(writer, &_retryEvery);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}retryEvery...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}retryEvery."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}retryEvery."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "retryMaxAttempts", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}retryMaxAttempts...");
#endif
status = xmlTextWriterWriteIntType(writer, &_retryMaxAttempts);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}retryMaxAttempts...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}retryMaxAttempts."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "selectAllClientIds", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}selectAllClientIds."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}selectAllClientIds...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_selectAllClientIds);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}selectAllClientIds...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}selectAllClientIds."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}selectAllClientIds."];
}
}
if ([self jobPropertiesMap]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobPropertiesMap", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobPropertiesMap."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobPropertiesMap...");
#endif
[[self jobPropertiesMap] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobPropertiesMap...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobPropertiesMap."];
}
}
if ([self requestTimeout] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "requestTimeout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}requestTimeout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}requestTimeout...");
#endif
status = xmlTextWriterWriteLongType(writer, [self requestTimeout]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}requestTimeout...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}requestTimeout."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}requestTimeout."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "processOnConnect", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}processOnConnect."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}processOnConnect...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_processOnConnect);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}processOnConnect...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}processOnConnect."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}processOnConnect."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "sendWakeupSMS", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}sendWakeupSMS."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}sendWakeupSMS...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_sendWakeupSMS);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}sendWakeupSMS...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}sendWakeupSMS."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}sendWakeupSMS."];
}
}
if ([self wakeupTimeout] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "wakeupTimeout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}wakeupTimeout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}wakeupTimeout...");
#endif
status = xmlTextWriterWriteLongType(writer, [self wakeupTimeout]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}wakeupTimeout...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}wakeupTimeout."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}wakeupTimeout."];
}
}
if ([self deviceInactivityTimeout] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "deviceInactivityTimeout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}deviceInactivityTimeout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}deviceInactivityTimeout...");
#endif
status = xmlTextWriterWriteLongType(writer, [self deviceInactivityTimeout]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}deviceInactivityTimeout...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}deviceInactivityTimeout."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}deviceInactivityTimeout."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCDeviceJobCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceJobCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceJobStatus_M
#define DEF_EDC_APIS_CLIENTEDCDeviceJobStatus_M
/**
* Reads a DeviceJobStatus from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The DeviceJobStatus, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCDeviceJobStatus *xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceJobStatusType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCDeviceJobStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobStatus));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "CREATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CREATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STARTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STARTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "RUNNING") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_RUNNING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "SKIPPED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_SKIPPED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "FAILED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_FAILED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "COMPLETED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_COMPLETED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "ABANDONED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_ABANDONED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STOPPING") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STOPPED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "WAITING_FOR_DEVICES") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_WAITING_FOR_DEVICES;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONTINUED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CONTINUED;
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 _deviceJobStatus The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCDeviceJobStatus *formatStringToEDC_APIS_CLIENTEDCDeviceJobStatusType(NSString *_deviceJobStatus)
{
enum EDC_APIS_CLIENTEDCDeviceJobStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobStatus));
if ([@"CREATED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CREATED;
}
else if ([@"STARTED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STARTED;
}
else if ([@"RUNNING" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_RUNNING;
}
else if ([@"SKIPPED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_SKIPPED;
}
else if ([@"FAILED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_FAILED;
}
else if ([@"COMPLETED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_COMPLETED;
}
else if ([@"ABANDONED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_ABANDONED;
}
else if ([@"STOPPING" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPING;
}
else if ([@"STOPPED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPED;
}
else if ([@"WAITING_FOR_DEVICES" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_WAITING_FOR_DEVICES;
}
else if ([@"CONTINUED" isEqualToString:_deviceJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CONTINUED;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_deviceJobStatus UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a DeviceJobStatus to XML.
*
* @param writer The XML writer.
* @param _deviceJobStatus The DeviceJobStatus to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceJobStatusType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCDeviceJobStatus *_deviceJobStatus)
{
switch (*_deviceJobStatus) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CREATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CREATED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STARTED:
return xmlTextWriterWriteString(writer, BAD_CAST "STARTED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_RUNNING:
return xmlTextWriterWriteString(writer, BAD_CAST "RUNNING");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_SKIPPED:
return xmlTextWriterWriteString(writer, BAD_CAST "SKIPPED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_FAILED:
return xmlTextWriterWriteString(writer, BAD_CAST "FAILED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_COMPLETED:
return xmlTextWriterWriteString(writer, BAD_CAST "COMPLETED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_ABANDONED:
return xmlTextWriterWriteString(writer, BAD_CAST "ABANDONED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPING:
return xmlTextWriterWriteString(writer, BAD_CAST "STOPPING");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPED:
return xmlTextWriterWriteString(writer, BAD_CAST "STOPPED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_WAITING_FOR_DEVICES:
return xmlTextWriterWriteString(writer, BAD_CAST "WAITING_FOR_DEVICES");
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CONTINUED:
return xmlTextWriterWriteString(writer, BAD_CAST "CONTINUED");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of DeviceJobStatus.
*
* @param _deviceJobStatus The DeviceJobStatus to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCDeviceJobStatusTypeToString(enum EDC_APIS_CLIENTEDCDeviceJobStatus *_deviceJobStatus)
{
switch (*_deviceJobStatus) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CREATED:
return @"CREATED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STARTED:
return @"STARTED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_RUNNING:
return @"RUNNING";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_SKIPPED:
return @"SKIPPED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_FAILED:
return @"FAILED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_COMPLETED:
return @"COMPLETED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_ABANDONED:
return @"ABANDONED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPING:
return @"STOPPING";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_STOPPED:
return @"STOPPED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_WAITING_FOR_DEVICES:
return @"WAITING_FOR_DEVICES";
case EDC_APIS_CLIENT_EDC_DEVICEJOBSTATUS_CONTINUED:
return @"CONTINUED";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceJobStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceJobTargetStatus_M
#define DEF_EDC_APIS_CLIENTEDCDeviceJobTargetStatus_M
/**
* Reads a DeviceJobTargetStatus from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The DeviceJobTargetStatus, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceJobTargetStatusType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "CREATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CREATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "WAITING_WAKEUP") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_WAKEUP;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "WAITING_CONN") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_CONN;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "WAKEUP_FAILED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_FAILED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "WAKEUP_COMPLETED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_COMPLETED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_SENT") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_SENT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_RECEIVED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_RECEIVED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_IN_PROGRESS") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_IN_PROGRESS;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_TIMEOUT") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_TIMEOUT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_FAILED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_COMPLETED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_COMPLETED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_CANCELLING") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_CANCELLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_FAILED_CERTIFICATE_UPDATE") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_UPDATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "REQUEST_FAILED_CERTIFICATE_REVOKE") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_REVOKE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CERIFICATE_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CERIFICATE_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "VERIFICATION_STARTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_STARTED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "VERIFICATION_COMPLETED") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_COMPLETED;
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 _deviceJobTargetStatus The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *formatStringToEDC_APIS_CLIENTEDCDeviceJobTargetStatusType(NSString *_deviceJobTargetStatus)
{
enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus));
if ([@"CREATED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CREATED;
}
else if ([@"WAITING_WAKEUP" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_WAKEUP;
}
else if ([@"WAITING_CONN" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_CONN;
}
else if ([@"WAKEUP_FAILED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_FAILED;
}
else if ([@"WAKEUP_COMPLETED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_COMPLETED;
}
else if ([@"REQUEST_SENT" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_SENT;
}
else if ([@"REQUEST_RECEIVED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_RECEIVED;
}
else if ([@"REQUEST_IN_PROGRESS" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_IN_PROGRESS;
}
else if ([@"REQUEST_TIMEOUT" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_TIMEOUT;
}
else if ([@"REQUEST_FAILED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED;
}
else if ([@"REQUEST_COMPLETED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_COMPLETED;
}
else if ([@"REQUEST_CANCELLING" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLING;
}
else if ([@"REQUEST_CANCELLED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLED;
}
else if ([@"REQUEST_FAILED_CERTIFICATE_UPDATE" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_UPDATE;
}
else if ([@"REQUEST_FAILED_CERTIFICATE_REVOKE" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_REVOKE;
}
else if ([@"CERIFICATE_UPDATED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CERIFICATE_UPDATED;
}
else if ([@"VERIFICATION_STARTED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_STARTED;
}
else if ([@"VERIFICATION_COMPLETED" isEqualToString:_deviceJobTargetStatus]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_COMPLETED;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_deviceJobTargetStatus UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a DeviceJobTargetStatus to XML.
*
* @param writer The XML writer.
* @param _deviceJobTargetStatus The DeviceJobTargetStatus to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceJobTargetStatusType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *_deviceJobTargetStatus)
{
switch (*_deviceJobTargetStatus) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CREATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CREATED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_WAKEUP:
return xmlTextWriterWriteString(writer, BAD_CAST "WAITING_WAKEUP");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_CONN:
return xmlTextWriterWriteString(writer, BAD_CAST "WAITING_CONN");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_FAILED:
return xmlTextWriterWriteString(writer, BAD_CAST "WAKEUP_FAILED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_COMPLETED:
return xmlTextWriterWriteString(writer, BAD_CAST "WAKEUP_COMPLETED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_SENT:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_SENT");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_RECEIVED:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_RECEIVED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_IN_PROGRESS:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_IN_PROGRESS");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_TIMEOUT:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_TIMEOUT");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_FAILED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_COMPLETED:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_COMPLETED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLING:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_CANCELLING");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLED:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_CANCELLED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_UPDATE:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_FAILED_CERTIFICATE_UPDATE");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_REVOKE:
return xmlTextWriterWriteString(writer, BAD_CAST "REQUEST_FAILED_CERTIFICATE_REVOKE");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CERIFICATE_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CERIFICATE_UPDATED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_STARTED:
return xmlTextWriterWriteString(writer, BAD_CAST "VERIFICATION_STARTED");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_COMPLETED:
return xmlTextWriterWriteString(writer, BAD_CAST "VERIFICATION_COMPLETED");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of DeviceJobTargetStatus.
*
* @param _deviceJobTargetStatus The DeviceJobTargetStatus to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCDeviceJobTargetStatusTypeToString(enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *_deviceJobTargetStatus)
{
switch (*_deviceJobTargetStatus) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CREATED:
return @"CREATED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_WAKEUP:
return @"WAITING_WAKEUP";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAITING_CONN:
return @"WAITING_CONN";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_FAILED:
return @"WAKEUP_FAILED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_WAKEUP_COMPLETED:
return @"WAKEUP_COMPLETED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_SENT:
return @"REQUEST_SENT";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_RECEIVED:
return @"REQUEST_RECEIVED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_IN_PROGRESS:
return @"REQUEST_IN_PROGRESS";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_TIMEOUT:
return @"REQUEST_TIMEOUT";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED:
return @"REQUEST_FAILED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_COMPLETED:
return @"REQUEST_COMPLETED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLING:
return @"REQUEST_CANCELLING";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_CANCELLED:
return @"REQUEST_CANCELLED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_UPDATE:
return @"REQUEST_FAILED_CERTIFICATE_UPDATE";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_REQUEST_FAILED_CERTIFICATE_REVOKE:
return @"REQUEST_FAILED_CERTIFICATE_REVOKE";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_CERIFICATE_UPDATED:
return @"CERIFICATE_UPDATED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_STARTED:
return @"VERIFICATION_STARTED";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTARGETSTATUS_VERIFICATION_COMPLETED:
return @"VERIFICATION_COMPLETED";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceJobTargetStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceJobType_M
#define DEF_EDC_APIS_CLIENTEDCDeviceJobType_M
/**
* Reads a DeviceJobType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The DeviceJobType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCDeviceJobType *xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceJobTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCDeviceJobType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "device_command") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_COMMAND;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_config_update") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CONFIG_UPDATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_install") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_uninstall") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_certificate_update") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_UPDATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_certificate_revoke") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_REVOKE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_install_v2") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL_V2;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_uninstall_v2") == 0) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2;
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 _deviceJobType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCDeviceJobType *formatStringToEDC_APIS_CLIENTEDCDeviceJobTypeType(NSString *_deviceJobType)
{
enum EDC_APIS_CLIENTEDCDeviceJobType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCDeviceJobType));
if ([@"device_command" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_COMMAND;
}
else if ([@"device_config_update" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CONFIG_UPDATE;
}
else if ([@"device_software_install" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL;
}
else if ([@"device_software_uninstall" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL;
}
else if ([@"device_certificate_update" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_UPDATE;
}
else if ([@"device_certificate_revoke" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_REVOKE;
}
else if ([@"device_software_install_v2" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL_V2;
}
else if ([@"device_software_uninstall_v2" isEqualToString:_deviceJobType]) {
*value = EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_deviceJobType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a DeviceJobType to XML.
*
* @param writer The XML writer.
* @param _deviceJobType The DeviceJobType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceJobTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCDeviceJobType *_deviceJobType)
{
switch (*_deviceJobType) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_COMMAND:
return xmlTextWriterWriteString(writer, BAD_CAST "device_command");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CONFIG_UPDATE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_config_update");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_install");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_uninstall");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_UPDATE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_certificate_update");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_REVOKE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_certificate_revoke");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL_V2:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_install_v2");
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_uninstall_v2");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of DeviceJobType.
*
* @param _deviceJobType The DeviceJobType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCDeviceJobTypeTypeToString(enum EDC_APIS_CLIENTEDCDeviceJobType *_deviceJobType)
{
switch (*_deviceJobType) {
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_COMMAND:
return @"device_command";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CONFIG_UPDATE:
return @"device_config_update";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL:
return @"device_software_install";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL:
return @"device_software_uninstall";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_UPDATE:
return @"device_certificate_update";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_CERTIFICATE_REVOKE:
return @"device_certificate_revoke";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_INSTALL_V2:
return @"device_software_install_v2";
case EDC_APIS_CLIENT_EDC_DEVICEJOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2:
return @"device_software_uninstall_v2";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceJobType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCJobAttachmentType_M
#define DEF_EDC_APIS_CLIENTEDCJobAttachmentType_M
/**
* Reads a JobAttachmentType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The JobAttachmentType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCJobAttachmentType *xmlTextReaderReadEDC_APIS_CLIENTEDCJobAttachmentTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCJobAttachmentType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCJobAttachmentType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "BUNDLE") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_BUNDLE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONFIGURATION") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_CONFIGURATION;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "COMMAND") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_COMMAND;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "FILE") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_FILE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "URL") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_URL;
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 _jobAttachmentType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCJobAttachmentType *formatStringToEDC_APIS_CLIENTEDCJobAttachmentTypeType(NSString *_jobAttachmentType)
{
enum EDC_APIS_CLIENTEDCJobAttachmentType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCJobAttachmentType));
if ([@"BUNDLE" isEqualToString:_jobAttachmentType]) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_BUNDLE;
}
else if ([@"CONFIGURATION" isEqualToString:_jobAttachmentType]) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_CONFIGURATION;
}
else if ([@"COMMAND" isEqualToString:_jobAttachmentType]) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_COMMAND;
}
else if ([@"FILE" isEqualToString:_jobAttachmentType]) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_FILE;
}
else if ([@"URL" isEqualToString:_jobAttachmentType]) {
*value = EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_URL;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_jobAttachmentType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a JobAttachmentType to XML.
*
* @param writer The XML writer.
* @param _jobAttachmentType The JobAttachmentType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCJobAttachmentTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCJobAttachmentType *_jobAttachmentType)
{
switch (*_jobAttachmentType) {
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_BUNDLE:
return xmlTextWriterWriteString(writer, BAD_CAST "BUNDLE");
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_CONFIGURATION:
return xmlTextWriterWriteString(writer, BAD_CAST "CONFIGURATION");
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_COMMAND:
return xmlTextWriterWriteString(writer, BAD_CAST "COMMAND");
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_FILE:
return xmlTextWriterWriteString(writer, BAD_CAST "FILE");
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_URL:
return xmlTextWriterWriteString(writer, BAD_CAST "URL");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of JobAttachmentType.
*
* @param _jobAttachmentType The JobAttachmentType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCJobAttachmentTypeTypeToString(enum EDC_APIS_CLIENTEDCJobAttachmentType *_jobAttachmentType)
{
switch (*_jobAttachmentType) {
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_BUNDLE:
return @"BUNDLE";
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_CONFIGURATION:
return @"CONFIGURATION";
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_COMMAND:
return @"COMMAND";
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_FILE:
return @"FILE";
case EDC_APIS_CLIENT_EDC_JOBATTACHMENTTYPE_URL:
return @"URL";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCJobAttachmentType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCJobType_M
#define DEF_EDC_APIS_CLIENTEDCJobType_M
/**
* Reads a JobType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The JobType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCJobType *xmlTextReaderReadEDC_APIS_CLIENTEDCJobTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCJobType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCJobType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "device_config_update") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CONFIG_UPDATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_install") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_uninstall") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_install_v2") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL_V2;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_software_uninstall_v2") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_command") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_COMMAND;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_certificate_update") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_UPDATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_certificate_revoke") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_REVOKE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_provision_v1") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V1;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_provision_v2") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V2;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "device_provision_v3") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V3;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "sim_synchronization") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_SIM_SYNCHRONIZATION;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "billing_report") == 0) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_BILLING_REPORT;
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 _jobType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCJobType *formatStringToEDC_APIS_CLIENTEDCJobTypeType(NSString *_jobType)
{
enum EDC_APIS_CLIENTEDCJobType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCJobType));
if ([@"device_config_update" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CONFIG_UPDATE;
}
else if ([@"device_software_install" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL;
}
else if ([@"device_software_uninstall" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL;
}
else if ([@"device_software_install_v2" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL_V2;
}
else if ([@"device_software_uninstall_v2" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2;
}
else if ([@"device_command" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_COMMAND;
}
else if ([@"device_certificate_update" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_UPDATE;
}
else if ([@"device_certificate_revoke" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_REVOKE;
}
else if ([@"device_provision_v1" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V1;
}
else if ([@"device_provision_v2" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V2;
}
else if ([@"device_provision_v3" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V3;
}
else if ([@"sim_synchronization" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_SIM_SYNCHRONIZATION;
}
else if ([@"billing_report" isEqualToString:_jobType]) {
*value = EDC_APIS_CLIENT_EDC_JOBTYPE_BILLING_REPORT;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_jobType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a JobType to XML.
*
* @param writer The XML writer.
* @param _jobType The JobType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCJobTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCJobType *_jobType)
{
switch (*_jobType) {
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CONFIG_UPDATE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_config_update");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_install");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_uninstall");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL_V2:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_install_v2");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2:
return xmlTextWriterWriteString(writer, BAD_CAST "device_software_uninstall_v2");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_COMMAND:
return xmlTextWriterWriteString(writer, BAD_CAST "device_command");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_UPDATE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_certificate_update");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_REVOKE:
return xmlTextWriterWriteString(writer, BAD_CAST "device_certificate_revoke");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V1:
return xmlTextWriterWriteString(writer, BAD_CAST "device_provision_v1");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V2:
return xmlTextWriterWriteString(writer, BAD_CAST "device_provision_v2");
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V3:
return xmlTextWriterWriteString(writer, BAD_CAST "device_provision_v3");
case EDC_APIS_CLIENT_EDC_JOBTYPE_SIM_SYNCHRONIZATION:
return xmlTextWriterWriteString(writer, BAD_CAST "sim_synchronization");
case EDC_APIS_CLIENT_EDC_JOBTYPE_BILLING_REPORT:
return xmlTextWriterWriteString(writer, BAD_CAST "billing_report");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of JobType.
*
* @param _jobType The JobType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCJobTypeTypeToString(enum EDC_APIS_CLIENTEDCJobType *_jobType)
{
switch (*_jobType) {
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CONFIG_UPDATE:
return @"device_config_update";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL:
return @"device_software_install";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL:
return @"device_software_uninstall";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_INSTALL_V2:
return @"device_software_install_v2";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_SOFTWARE_UNINSTALL_V2:
return @"device_software_uninstall_v2";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_COMMAND:
return @"device_command";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_UPDATE:
return @"device_certificate_update";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_CERTIFICATE_REVOKE:
return @"device_certificate_revoke";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V1:
return @"device_provision_v1";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V2:
return @"device_provision_v2";
case EDC_APIS_CLIENT_EDC_JOBTYPE_DEVICE_PROVISION_V3:
return @"device_provision_v3";
case EDC_APIS_CLIENT_EDC_JOBTYPE_SIM_SYNCHRONIZATION:
return @"sim_synchronization";
case EDC_APIS_CLIENT_EDC_JOBTYPE_BILLING_REPORT:
return @"billing_report";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCJobType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCJobExecution_M
#define DEF_EDC_APIS_CLIENTEDCJobExecution_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCJobExecution
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (long long) jobId
{
return _jobId;
}
/**
* (no documentation provided)
*/
- (void) setJobId: (long long) newJobId
{
_jobId = newJobId;
}
/**
* (no documentation provided)
*/
- (long long) executionId
{
return _executionId;
}
/**
* (no documentation provided)
*/
- (void) setExecutionId: (long long) newExecutionId
{
_executionId = newExecutionId;
}
/**
* (no documentation provided)
*/
- (NSDate *) startedOn
{
return _startedOn;
}
/**
* (no documentation provided)
*/
- (void) setStartedOn: (NSDate *) newStartedOn
{
[newStartedOn retain];
[_startedOn release];
_startedOn = newStartedOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) endedOn
{
return _endedOn;
}
/**
* (no documentation provided)
*/
- (void) setEndedOn: (NSDate *) newEndedOn
{
[newEndedOn retain];
[_endedOn release];
_endedOn = newEndedOn;
}
/**
* (no documentation provided)
*/
- (NSString *) log
{
return _log;
}
/**
* (no documentation provided)
*/
- (void) setLog: (NSString *) newLog
{
[newLog retain];
[_log release];
_log = newLog;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (long long) optlock
{
return _optlock;
}
/**
* The optlock field is used to detect that this entity has not been
* modified by someone else. When updating an entity, first do a find to
* get the latest version of the entity and note the value of the optlock.
* Then in the update operation, set the optlock value to match the value
* that you found. If someone else has updated the entity between your
* find and update operations, the update will fail and the db/server will
* return an error.
*
* See this
* stackoverflow question for more information on optimistic locking.
*/
- (void) setOptlock: (long long) newOptlock
{
_optlock = newOptlock;
}
- (void) dealloc
{
[self setStartedOn: nil];
[self setEndedOn: nil];
[self setLog: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCJobExecution *_eDC_APIS_CLIENTEDCJobExecution;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCJobExecution = (EDC_APIS_CLIENTEDCJobExecution *) [EDC_APIS_CLIENTEDCJobExecution readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCJobExecution;
}
//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 EDC_APIS_CLIENTEDCJobExecution */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCJobExecution (JAXB)
@end /*interface EDC_APIS_CLIENTEDCJobExecution (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCJobExecution (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCJobExecution from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCJobExecution defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCJobExecution *_eDC_APIS_CLIENTEDCJobExecution = [[EDC_APIS_CLIENTEDCJobExecution alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCJobExecution initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCJobExecution = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCJobExecution autorelease];
return _eDC_APIS_CLIENTEDCJobExecution;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCJobExecution 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 EDC_APIS_CLIENTEDCJobExecution 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 EDC_APIS_CLIENTEDCJobExecution from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}jobExecution".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCJobExecution.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCJobExecution *_jobExecution = 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 {http://eurotech.com/edc/2.0}jobExecution."];
}
}
if (xmlStrcmp(BAD_CAST "jobExecution", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}jobExecution.");
#endif
_jobExecution = (EDC_APIS_CLIENTEDCJobExecution *)[EDC_APIS_CLIENTEDCJobExecution readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}jobExecution.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCJobExecution. Expected element {http://eurotech.com/edc/2.0}jobExecution. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCJobExecution. Expected element {http://eurotech.com/edc/2.0}jobExecution. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _jobExecution;
}
/**
* Writes this EDC_APIS_CLIENTEDCJobExecution to XML under element name "{http://eurotech.com/edc/2.0}jobExecution".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _jobExecution The JobExecution to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCJobExecution 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, BAD_CAST "edc", BAD_CAST "jobExecution", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}jobExecution. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}jobExecution...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}jobExecution'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}jobExecution...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}jobExecution for root element {http://eurotech.com/edc/2.0}jobExecution...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}jobExecution for root element {http://eurotech.com/edc/2.0}jobExecution...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}jobExecution. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setJobId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "executionId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setExecutionId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "startedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}startedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}startedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setStartedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "endedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}endedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}endedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setEndedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "log", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}log of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}log of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setLog: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "optlock", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setOptlock: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_jobId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}jobId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobId."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "executionId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}executionId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}executionId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_executionId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}executionId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}executionId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}executionId."];
}
}
if ([self startedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "startedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}startedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}startedOn...");
#endif
[[self startedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}startedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}startedOn."];
}
}
if ([self endedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "endedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}endedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}endedOn...");
#endif
[[self endedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}endedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}endedOn."];
}
}
if ([self log]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "log", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}log."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}log...");
#endif
[[self log] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}log...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}log."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "optlock", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}optlock."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}optlock...");
#endif
status = xmlTextWriterWriteLongType(writer, &_optlock);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}optlock...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}optlock."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}optlock."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCJobExecution (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCJobExecution_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcAssetInfo_M
#define DEF_EDC_APIS_CLIENTEDCEdcAssetInfo_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCEdcAssetInfo
/**
* (no documentation provided)
*/
- (NSString *) asset
{
return _asset;
}
/**
* (no documentation provided)
*/
- (void) setAsset: (NSString *) newAsset
{
[newAsset retain];
[_asset release];
_asset = newAsset;
}
/**
* (no documentation provided)
*/
- (NSDate *) lastMessageTimestamp
{
return _lastMessageTimestamp;
}
/**
* (no documentation provided)
*/
- (void) setLastMessageTimestamp: (NSDate *) newLastMessageTimestamp
{
[newLastMessageTimestamp retain];
[_lastMessageTimestamp release];
_lastMessageTimestamp = newLastMessageTimestamp;
}
- (void) dealloc
{
[self setAsset: nil];
[self setLastMessageTimestamp: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcAssetInfo *_eDC_APIS_CLIENTEDCEdcAssetInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcAssetInfo = (EDC_APIS_CLIENTEDCEdcAssetInfo *) [EDC_APIS_CLIENTEDCEdcAssetInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcAssetInfo;
}
//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 EDC_APIS_CLIENTEDCEdcAssetInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcAssetInfo (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcAssetInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcAssetInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcAssetInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcAssetInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcAssetInfo *_eDC_APIS_CLIENTEDCEdcAssetInfo = [[EDC_APIS_CLIENTEDCEdcAssetInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcAssetInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcAssetInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcAssetInfo autorelease];
return _eDC_APIS_CLIENTEDCEdcAssetInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcAssetInfo 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 EDC_APIS_CLIENTEDCEdcAssetInfo 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 EDC_APIS_CLIENTEDCEdcAssetInfo from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}assetInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcAssetInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcAssetInfo *_edcAssetInfo = 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 {http://eurotech.com/edc/2.0}assetInfo."];
}
}
if (xmlStrcmp(BAD_CAST "assetInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}assetInfo.");
#endif
_edcAssetInfo = (EDC_APIS_CLIENTEDCEdcAssetInfo *)[EDC_APIS_CLIENTEDCEdcAssetInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}assetInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcAssetInfo. Expected element {http://eurotech.com/edc/2.0}assetInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcAssetInfo. Expected element {http://eurotech.com/edc/2.0}assetInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcAssetInfo;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcAssetInfo to XML under element name "{http://eurotech.com/edc/2.0}assetInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcAssetInfo The EdcAssetInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcAssetInfo 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, BAD_CAST "edc", BAD_CAST "assetInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}assetInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}assetInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}assetInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}assetInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcAssetInfo for root element {http://eurotech.com/edc/2.0}assetInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcAssetInfo for root element {http://eurotech.com/edc/2.0}assetInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}assetInfo. 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 "asset", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}asset of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}asset of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setAsset: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "lastMessageOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}lastMessageOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}lastMessageOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setLastMessageTimestamp: __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 asset]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "asset", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}asset."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}asset...");
#endif
[[self asset] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}asset...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}asset."];
}
}
if ([self lastMessageTimestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "lastMessageOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}lastMessageOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}lastMessageOn...");
#endif
[[self lastMessageTimestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}lastMessageOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}lastMessageOn."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcAssetInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcAssetInfo_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcUsageInfo_M
#define DEF_EDC_APIS_CLIENTEDCEdcUsageInfo_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCEdcUsageInfo
/**
* (no documentation provided)
*/
- (NSDate *) timestamp
{
return _timestamp;
}
/**
* (no documentation provided)
*/
- (void) setTimestamp: (NSDate *) newTimestamp
{
[newTimestamp retain];
[_timestamp release];
_timestamp = newTimestamp;
}
/**
* (no documentation provided)
*/
- (long long) rxUsage
{
return _rxUsage;
}
/**
* (no documentation provided)
*/
- (void) setRxUsage: (long long) newRxUsage
{
_rxUsage = newRxUsage;
}
- (void) dealloc
{
[self setTimestamp: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcUsageInfo *_eDC_APIS_CLIENTEDCEdcUsageInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcUsageInfo = (EDC_APIS_CLIENTEDCEdcUsageInfo *) [EDC_APIS_CLIENTEDCEdcUsageInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcUsageInfo;
}
//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 EDC_APIS_CLIENTEDCEdcUsageInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcUsageInfo (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcUsageInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcUsageInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcUsageInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcUsageInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcUsageInfo *_eDC_APIS_CLIENTEDCEdcUsageInfo = [[EDC_APIS_CLIENTEDCEdcUsageInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcUsageInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcUsageInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcUsageInfo autorelease];
return _eDC_APIS_CLIENTEDCEdcUsageInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcUsageInfo 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 EDC_APIS_CLIENTEDCEdcUsageInfo 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 EDC_APIS_CLIENTEDCEdcUsageInfo from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}usageInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcUsageInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcUsageInfo *_edcUsageInfo = 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 {http://eurotech.com/edc/2.0}usageInfo."];
}
}
if (xmlStrcmp(BAD_CAST "usageInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}usageInfo.");
#endif
_edcUsageInfo = (EDC_APIS_CLIENTEDCEdcUsageInfo *)[EDC_APIS_CLIENTEDCEdcUsageInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}usageInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcUsageInfo. Expected element {http://eurotech.com/edc/2.0}usageInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcUsageInfo. Expected element {http://eurotech.com/edc/2.0}usageInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcUsageInfo;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcUsageInfo to XML under element name "{http://eurotech.com/edc/2.0}usageInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcUsageInfo The EdcUsageInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcUsageInfo 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, BAD_CAST "edc", BAD_CAST "usageInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}usageInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}usageInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}usageInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}usageInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcUsageInfo for root element {http://eurotech.com/edc/2.0}usageInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcUsageInfo for root element {http://eurotech.com/edc/2.0}usageInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}usageInfo. 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 "timestamp", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}timestamp of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}timestamp of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setTimestamp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "usage", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRxUsage: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if ([self timestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "timestamp", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}timestamp."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}timestamp...");
#endif
[[self timestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}timestamp...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}timestamp."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "usage", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}usage."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}usage...");
#endif
status = xmlTextWriterWriteLongType(writer, &_rxUsage);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}usage...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}usage."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}usage."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcUsageInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcUsageInfo_M */
#ifndef DEF_EDC_APIS_CLIENTEDCParameterType_M
#define DEF_EDC_APIS_CLIENTEDCParameterType_M
/**
* Reads a ParameterType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The ParameterType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCParameterType *xmlTextReaderReadEDC_APIS_CLIENTEDCParameterTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCParameterType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCParameterType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "text") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TEXT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "largeText") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_LARGETEXT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "richText") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_RICHTEXT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "numberInteger") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERINTEGER;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "numberLong") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERLONG;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "numberDouble") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERDOUBLE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "numberFloat") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERFLOAT;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "choice") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_CHOICE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "date") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_DATE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "time") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TIME;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "map") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_MAP;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "password") == 0) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_PASSWORD;
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 _parameterType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCParameterType *formatStringToEDC_APIS_CLIENTEDCParameterTypeType(NSString *_parameterType)
{
enum EDC_APIS_CLIENTEDCParameterType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCParameterType));
if ([@"text" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TEXT;
}
else if ([@"largeText" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_LARGETEXT;
}
else if ([@"richText" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_RICHTEXT;
}
else if ([@"numberInteger" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERINTEGER;
}
else if ([@"numberLong" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERLONG;
}
else if ([@"numberDouble" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERDOUBLE;
}
else if ([@"numberFloat" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERFLOAT;
}
else if ([@"choice" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_CHOICE;
}
else if ([@"date" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_DATE;
}
else if ([@"time" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TIME;
}
else if ([@"map" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_MAP;
}
else if ([@"password" isEqualToString:_parameterType]) {
*value = EDC_APIS_CLIENT_EDC_PARAMETERTYPE_PASSWORD;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_parameterType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a ParameterType to XML.
*
* @param writer The XML writer.
* @param _parameterType The ParameterType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCParameterTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCParameterType *_parameterType)
{
switch (*_parameterType) {
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TEXT:
return xmlTextWriterWriteString(writer, BAD_CAST "text");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_LARGETEXT:
return xmlTextWriterWriteString(writer, BAD_CAST "largeText");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_RICHTEXT:
return xmlTextWriterWriteString(writer, BAD_CAST "richText");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERINTEGER:
return xmlTextWriterWriteString(writer, BAD_CAST "numberInteger");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERLONG:
return xmlTextWriterWriteString(writer, BAD_CAST "numberLong");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERDOUBLE:
return xmlTextWriterWriteString(writer, BAD_CAST "numberDouble");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERFLOAT:
return xmlTextWriterWriteString(writer, BAD_CAST "numberFloat");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_CHOICE:
return xmlTextWriterWriteString(writer, BAD_CAST "choice");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_DATE:
return xmlTextWriterWriteString(writer, BAD_CAST "date");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TIME:
return xmlTextWriterWriteString(writer, BAD_CAST "time");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_MAP:
return xmlTextWriterWriteString(writer, BAD_CAST "map");
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_PASSWORD:
return xmlTextWriterWriteString(writer, BAD_CAST "password");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of ParameterType.
*
* @param _parameterType The ParameterType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCParameterTypeTypeToString(enum EDC_APIS_CLIENTEDCParameterType *_parameterType)
{
switch (*_parameterType) {
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TEXT:
return @"text";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_LARGETEXT:
return @"largeText";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_RICHTEXT:
return @"richText";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERINTEGER:
return @"numberInteger";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERLONG:
return @"numberLong";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERDOUBLE:
return @"numberDouble";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_NUMBERFLOAT:
return @"numberFloat";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_CHOICE:
return @"choice";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_DATE:
return @"date";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_TIME:
return @"time";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_MAP:
return @"map";
case EDC_APIS_CLIENT_EDC_PARAMETERTYPE_PASSWORD:
return @"password";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCParameterType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCVpnClientStatus_M
#define DEF_EDC_APIS_CLIENTEDCVpnClientStatus_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCVpnClientStatus
/**
* (no documentation provided)
*/
- (BOOL) connected
{
return _connected;
}
/**
* (no documentation provided)
*/
- (void) setConnected: (BOOL) newConnected
{
_connected = newConnected;
}
/**
* (no documentation provided)
*/
- (NSString *) ipAddress
{
return _ipAddress;
}
/**
* (no documentation provided)
*/
- (void) setIpAddress: (NSString *) newIpAddress
{
[newIpAddress retain];
[_ipAddress release];
_ipAddress = newIpAddress;
}
- (void) dealloc
{
[self setIpAddress: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCVpnClientStatus *_eDC_APIS_CLIENTEDCVpnClientStatus;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCVpnClientStatus = (EDC_APIS_CLIENTEDCVpnClientStatus *) [EDC_APIS_CLIENTEDCVpnClientStatus readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCVpnClientStatus;
}
//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 EDC_APIS_CLIENTEDCVpnClientStatus */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCVpnClientStatus (JAXB)
@end /*interface EDC_APIS_CLIENTEDCVpnClientStatus (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCVpnClientStatus (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCVpnClientStatus from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCVpnClientStatus defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCVpnClientStatus *_eDC_APIS_CLIENTEDCVpnClientStatus = [[EDC_APIS_CLIENTEDCVpnClientStatus alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCVpnClientStatus initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCVpnClientStatus = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCVpnClientStatus autorelease];
return _eDC_APIS_CLIENTEDCVpnClientStatus;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCVpnClientStatus 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 EDC_APIS_CLIENTEDCVpnClientStatus 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 EDC_APIS_CLIENTEDCVpnClientStatus from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}vpnClientStatus".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCVpnClientStatus.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCVpnClientStatus *_vpnClientStatus = 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 {http://eurotech.com/edc/2.0}vpnClientStatus."];
}
}
if (xmlStrcmp(BAD_CAST "vpnClientStatus", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}vpnClientStatus.");
#endif
_vpnClientStatus = (EDC_APIS_CLIENTEDCVpnClientStatus *)[EDC_APIS_CLIENTEDCVpnClientStatus readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}vpnClientStatus.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCVpnClientStatus. Expected element {http://eurotech.com/edc/2.0}vpnClientStatus. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCVpnClientStatus. Expected element {http://eurotech.com/edc/2.0}vpnClientStatus. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _vpnClientStatus;
}
/**
* Writes this EDC_APIS_CLIENTEDCVpnClientStatus to XML under element name "{http://eurotech.com/edc/2.0}vpnClientStatus".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _vpnClientStatus The VpnClientStatus to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCVpnClientStatus 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, BAD_CAST "edc", BAD_CAST "vpnClientStatus", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}vpnClientStatus. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}vpnClientStatus...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}vpnClientStatus'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}vpnClientStatus...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}vpnClientStatus for root element {http://eurotech.com/edc/2.0}vpnClientStatus...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}vpnClientStatus for root element {http://eurotech.com/edc/2.0}vpnClientStatus...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}vpnClientStatus. 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 "connected", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setConnected: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "ipAddress", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}ipAddress of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}ipAddress of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setIpAddress: __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 (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "connected", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}connected."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}connected...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_connected);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}connected...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}connected."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}connected."];
}
}
if ([self ipAddress]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "ipAddress", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}ipAddress."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}ipAddress...");
#endif
[[self ipAddress] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}ipAddress...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}ipAddress."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCVpnClientStatus (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCVpnClientStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCParameter_M
#define DEF_EDC_APIS_CLIENTEDCParameter_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCParameter
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) value
{
return _value;
}
/**
* (no documentation provided)
*/
- (void) setValue: (NSString *) newValue
{
[newValue retain];
[_value release];
_value = newValue;
}
- (void) dealloc
{
[self setName: nil];
[self setValue: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCParameter *_eDC_APIS_CLIENTEDCParameter;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCParameter = (EDC_APIS_CLIENTEDCParameter *) [EDC_APIS_CLIENTEDCParameter readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCParameter;
}
//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 EDC_APIS_CLIENTEDCParameter */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCParameter (JAXB)
@end /*interface EDC_APIS_CLIENTEDCParameter (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCParameter (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCParameter from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCParameter defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCParameter *_eDC_APIS_CLIENTEDCParameter = [[EDC_APIS_CLIENTEDCParameter alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCParameter initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCParameter = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCParameter autorelease];
return _eDC_APIS_CLIENTEDCParameter;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCParameter 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 EDC_APIS_CLIENTEDCParameter 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 EDC_APIS_CLIENTEDCParameter from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}parameter".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCParameter.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCParameter *_parameter = 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 {http://eurotech.com/edc/2.0}parameter."];
}
}
if (xmlStrcmp(BAD_CAST "parameter", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}parameter.");
#endif
_parameter = (EDC_APIS_CLIENTEDCParameter *)[EDC_APIS_CLIENTEDCParameter readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}parameter.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCParameter. Expected element {http://eurotech.com/edc/2.0}parameter. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCParameter. Expected element {http://eurotech.com/edc/2.0}parameter. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _parameter;
}
/**
* Writes this EDC_APIS_CLIENTEDCParameter to XML under element name "{http://eurotech.com/edc/2.0}parameter".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _parameter The Parameter to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCParameter 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, BAD_CAST "edc", BAD_CAST "parameter", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}parameter. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}parameter...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}parameter'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}parameter...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}parameter for root element {http://eurotech.com/edc/2.0}parameter...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}parameter for root element {http://eurotech.com/edc/2.0}parameter...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}parameter. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}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 "value", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setValue: __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 name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self value]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "value", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}value."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}value...");
#endif
[[self value] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}value...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}value."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCParameter (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCParameter_M */
#ifndef DEF_EDC_APIS_CLIENTEDCParametersMapType_M
#define DEF_EDC_APIS_CLIENTEDCParametersMapType_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCParametersMapType
/**
* (no documentation provided)
*/
- (NSArray *) parameters
{
return _parameters;
}
/**
* (no documentation provided)
*/
- (void) setParameters: (NSArray *) newParameters
{
[newParameters retain];
[_parameters release];
_parameters = newParameters;
}
- (void) dealloc
{
[self setParameters: nil];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTEDCParametersMapType */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCParametersMapType (JAXB)
@end /*interface EDC_APIS_CLIENTEDCParametersMapType (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCParametersMapType (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCParametersMapType from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCParametersMapType defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCParametersMapType *_eDC_APIS_CLIENTEDCParametersMapType = [[EDC_APIS_CLIENTEDCParametersMapType alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCParametersMapType initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCParametersMapType = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCParametersMapType autorelease];
return _eDC_APIS_CLIENTEDCParametersMapType;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCParametersMapType 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 EDC_APIS_CLIENTEDCParametersMapType 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 "parameter", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}parameter of type {http://eurotech.com/edc/2.0}parameter.");
#endif
__child = [EDC_APIS_CLIENTEDCParameter readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}parameter of type {http://eurotech.com/edc/2.0}parameter.");
#endif
if ([self parameters]) {
[self setParameters: [[self parameters] arrayByAddingObject: __child]];
}
else {
[self setParameters: [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 parameters]) {
__enumerator = [[self parameters] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "parameter", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}parameter."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}parameter...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}parameter...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}parameter."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTEDCParametersMapType (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCParametersMapType_M */
#ifndef DEF_EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue_M
#define DEF_EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue
/**
* (no documentation provided)
*/
- (EDC_APIS_CLIENTEDCTag *) key
{
return _key;
}
/**
* (no documentation provided)
*/
- (void) setKey: (EDC_APIS_CLIENTEDCTag *) newKey
{
[newKey retain];
[_key release];
_key = newKey;
}
/**
* (no documentation provided)
*/
- (long long *) value
{
return _value;
}
/**
* (no documentation provided)
*/
- (void) setValue: (long long *) newValue
{
if (_value != NULL) {
free(_value);
}
_value = newValue;
}
- (void) dealloc
{
[self setKey: nil];
[self setValue: NULL];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue (JAXB)
@end /*interface EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue *_eDC_APIS_CLIENTEDCXmlMapAdapterKeyValue = [[EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCXmlMapAdapterKeyValue initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCXmlMapAdapterKeyValue = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCXmlMapAdapterKeyValue autorelease];
return _eDC_APIS_CLIENTEDCXmlMapAdapterKeyValue;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue 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 EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue 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 "key", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}key of type {http://eurotech.com/edc/2.0}tag.");
#endif
__child = [EDC_APIS_CLIENTEDCTag readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}key of type {http://eurotech.com/edc/2.0}tag.");
#endif
[self setKey: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setValue: ((long long*) _child_accessor)];
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if ([self key]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "key", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}key."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}key...");
#endif
[[self key] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}key...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}key."];
}
}
if ([self value] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "value", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}value."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}value...");
#endif
status = xmlTextWriterWriteLongType(writer, [self value]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}value...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}value."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}value."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcPayload_M
#define DEF_EDC_APIS_CLIENTEDCEdcPayload_M
/**
* EdcPayload defines the recommended payload structure for the messages sent to the Everyware Cloud platform.
* Eurotech designed the format as an open format that is flexible from the aspect of data modeling
* yet is efficient when it comes to bandwidth conservation. The same payload model is used by the REST API
* - in which case it is serialized into XML or JSON as requested by the client - or uses the efficient
* Google ProtoBuf when sent over an MQTT connection when the bandwidth is very important.
* The EdcPayload contains the following fields: sentOn timestamp, an optional set of metrics represented as
* name-value pairs, an optional position field to capture a GPS position, and an optional binary body.
*
* - sentOn: it is the timestamp when the data was captured and sent to the Everyware Cloud platform.
*
- metrics: a metric is a data structure composed of the name, a value, and the type of the value.
* When used with the REST API valid metric types are: string, double, int, float, long, boolean, base64Binary.
* Data exposed into the payload metrics can be processed through the real-time rules offered by the
* Everyware Cloud platform or used as query criteria when searching for messages through the messages/searchByMetric API.
* Each payload can have zero or more metrics.
*
- position: it is an optional field used to capture a geo position associated to this payload.
*
- body: it is an optional part of the payload that allows additional information to be transmitted in any format determined by the user.
* This field will be stored into the platform database, but the Everyware Cloud cannot apply any statistical analysis on it.
*
*/
@implementation EDC_APIS_CLIENTEDCEdcPayload
/**
* Timestamp when the data was captured and sent to the Everyware Cloud platform.
*/
- (NSDate *) timestamp
{
return _timestamp;
}
/**
* Timestamp when the data was captured and sent to the Everyware Cloud platform.
*/
- (void) setTimestamp: (NSDate *) newTimestamp
{
[newTimestamp retain];
[_timestamp release];
_timestamp = newTimestamp;
}
/**
* It is an optional field used to capture a geo position associated to this payload.
*/
- (EDC_APIS_CLIENTEDCEdcPosition *) position
{
return _position;
}
/**
* It is an optional field used to capture a geo position associated to this payload.
*/
- (void) setPosition: (EDC_APIS_CLIENTEDCEdcPosition *) newPosition
{
[newPosition retain];
[_position release];
_position = newPosition;
}
/**
* A metric is a data structure composed of the name, a value, and the type of the value.
* When used with the REST API valid metric types are: string, double, int, float, long, boolean, base64Binary.
* Data exposed into the payload metrics can be processed through the real-time rules offered by the
* Everyware Cloud platform or used a query criteria when searching for messages through the messages/searchByMetric API.
* Each payload can have zero or more metrics.
*/
- (EDC_APIS_CLIENTEDCEdcMetricsMapType *) metrics
{
return _metrics;
}
/**
* A metric is a data structure composed of the name, a value, and the type of the value.
* When used with the REST API valid metric types are: string, double, int, float, long, boolean, base64Binary.
* Data exposed into the payload metrics can be processed through the real-time rules offered by the
* Everyware Cloud platform or used a query criteria when searching for messages through the messages/searchByMetric API.
* Each payload can have zero or more metrics.
*/
- (void) setMetrics: (EDC_APIS_CLIENTEDCEdcMetricsMapType *) newMetrics
{
[newMetrics retain];
[_metrics release];
_metrics = newMetrics;
}
/**
* It is an optional part of the payload that allows additional information to be transmitted in any format determined by the user.
* This field will be stored into the platform database but the Everyware Cloud cannot apply any statistical analysis on it.
*/
- (NSData *) body
{
return _body;
}
/**
* It is an optional part of the payload that allows additional information to be transmitted in any format determined by the user.
* This field will be stored into the platform database but the Everyware Cloud cannot apply any statistical analysis on it.
*/
- (void) setBody: (NSData *) newBody
{
[newBody retain];
[_body release];
_body = newBody;
}
- (void) dealloc
{
[self setTimestamp: nil];
[self setPosition: nil];
[self setMetrics: nil];
[self setBody: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcPayload *_eDC_APIS_CLIENTEDCEdcPayload;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcPayload = (EDC_APIS_CLIENTEDCEdcPayload *) [EDC_APIS_CLIENTEDCEdcPayload readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcPayload;
}
//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 EDC_APIS_CLIENTEDCEdcPayload */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcPayload (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcPayload (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcPayload (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcPayload from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcPayload defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcPayload *_eDC_APIS_CLIENTEDCEdcPayload = [[EDC_APIS_CLIENTEDCEdcPayload alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcPayload initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcPayload = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcPayload autorelease];
return _eDC_APIS_CLIENTEDCEdcPayload;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcPayload 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 EDC_APIS_CLIENTEDCEdcPayload 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 EDC_APIS_CLIENTEDCEdcPayload from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}payload".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcPayload.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcPayload *_edcPayload = 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 {http://eurotech.com/edc/2.0}payload."];
}
}
if (xmlStrcmp(BAD_CAST "payload", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}payload.");
#endif
_edcPayload = (EDC_APIS_CLIENTEDCEdcPayload *)[EDC_APIS_CLIENTEDCEdcPayload readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}payload.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcPayload. Expected element {http://eurotech.com/edc/2.0}payload. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcPayload. Expected element {http://eurotech.com/edc/2.0}payload. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcPayload;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcPayload to XML under element name "{http://eurotech.com/edc/2.0}payload".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcPayload The EdcPayload to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcPayload 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, BAD_CAST "edc", BAD_CAST "payload", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}payload. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}payload...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}payload'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}payload...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcPayload for root element {http://eurotech.com/edc/2.0}payload...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcPayload for root element {http://eurotech.com/edc/2.0}payload...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}payload. 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 "sentOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}sentOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}sentOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setTimestamp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "position", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}position of type {http://eurotech.com/edc/2.0}edcPosition.");
#endif
__child = [EDC_APIS_CLIENTEDCEdcPosition readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}position of type {http://eurotech.com/edc/2.0}edcPosition.");
#endif
[self setPosition: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "metrics", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}metrics of type {http://eurotech.com/edc/2.0}edcMetricsMapType.");
#endif
__child = [EDC_APIS_CLIENTEDCEdcMetricsMapType readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}metrics of type {http://eurotech.com/edc/2.0}edcMetricsMapType.");
#endif
[self setMetrics: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "body", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}body of type {http://www.w3.org/2001/XMLSchema}base64Binary.");
#endif
__child = [NSData readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}body of type {http://www.w3.org/2001/XMLSchema}base64Binary.");
#endif
[self setBody: __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 timestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "sentOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}sentOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}sentOn...");
#endif
[[self timestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}sentOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}sentOn."];
}
}
if ([self position]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "position", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}position."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}position...");
#endif
[[self position] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}position...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}position."];
}
}
if ([self metrics]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "metrics", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}metrics."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}metrics...");
#endif
[[self metrics] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}metrics...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}metrics."];
}
}
if ([self body]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "body", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}body."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}body...");
#endif
[[self body] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}body...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}body."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcPayload (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcPayload_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcMetric_M
#define DEF_EDC_APIS_CLIENTEDCEdcMetric_M
/**
* EdcMetric represents an instance of a metric published as part of the message.
* The metric is defined by a name, a type and a value. The name is an alphanumeric string.
* The type is expressed as a string and can be one of the following values: string, double, int, float, long boolean, base64Binary.
* The value is the string representation of the corresponding value object.
* For the primitive types, the conversion is straight forward.
* Values of type base64Binary represent a metric of type byte array;
* in this case, the metric value is serialized into a base64 encoded string.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetric
/**
* Name of the Metric.
*/
- (NSString *) name
{
return _name;
}
/**
* Name of the Metric.
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* Type of the Metric value. Allowed types are: string, double, int, float, long, boolean, base64Binary.
*/
- (NSString *) type
{
return _type;
}
/**
* Type of the Metric value. Allowed types are: string, double, int, float, long, boolean, base64Binary.
*/
- (void) setType: (NSString *) newType
{
[newType retain];
[_type release];
_type = newType;
}
/**
* String representation of the Metric value according to the Metric type.
*/
- (NSString *) value
{
return _value;
}
/**
* String representation of the Metric value according to the Metric type.
*/
- (void) setValue: (NSString *) newValue
{
[newValue retain];
[_value release];
_value = newValue;
}
- (void) dealloc
{
[self setName: nil];
[self setType: nil];
[self setValue: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcMetric *_eDC_APIS_CLIENTEDCEdcMetric;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcMetric = (EDC_APIS_CLIENTEDCEdcMetric *) [EDC_APIS_CLIENTEDCEdcMetric readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcMetric;
}
//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 EDC_APIS_CLIENTEDCEdcMetric */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcMetric (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcMetric (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetric (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcMetric from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcMetric defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcMetric *_eDC_APIS_CLIENTEDCEdcMetric = [[EDC_APIS_CLIENTEDCEdcMetric alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcMetric initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcMetric = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcMetric autorelease];
return _eDC_APIS_CLIENTEDCEdcMetric;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcMetric 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 EDC_APIS_CLIENTEDCEdcMetric 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 EDC_APIS_CLIENTEDCEdcMetric from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}metric".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcMetric.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcMetric *_edcMetric = 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 {http://eurotech.com/edc/2.0}metric."];
}
}
if (xmlStrcmp(BAD_CAST "metric", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}metric.");
#endif
_edcMetric = (EDC_APIS_CLIENTEDCEdcMetric *)[EDC_APIS_CLIENTEDCEdcMetric readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}metric.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMetric. Expected element {http://eurotech.com/edc/2.0}metric. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMetric. Expected element {http://eurotech.com/edc/2.0}metric. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcMetric;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMetric to XML under element name "{http://eurotech.com/edc/2.0}metric".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcMetric The EdcMetric to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMetric 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, BAD_CAST "edc", BAD_CAST "metric", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}metric. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}metric...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}metric'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}metric...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcMetric for root element {http://eurotech.com/edc/2.0}metric...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcMetric for root element {http://eurotech.com/edc/2.0}metric...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}metric. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}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 "type", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}type of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}type of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setType: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setValue: __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 name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self type]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "type", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}type."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}type...");
#endif
[[self type] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}type...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}type."];
}
}
if ([self value]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "value", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}value."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}value...");
#endif
[[self value] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}value...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}value."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcMetric (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcMetric_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcMetricsMapType_M
#define DEF_EDC_APIS_CLIENTEDCEdcMetricsMapType_M
/**
* A container for EdcMetric instances organized into a list.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetricsMapType
/**
* (no documentation provided)
*/
- (NSArray *) metrics
{
return _metrics;
}
/**
* (no documentation provided)
*/
- (void) setMetrics: (NSArray *) newMetrics
{
[newMetrics retain];
[_metrics release];
_metrics = newMetrics;
}
- (void) dealloc
{
[self setMetrics: nil];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTEDCEdcMetricsMapType */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcMetricsMapType (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcMetricsMapType (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetricsMapType (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcMetricsMapType from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcMetricsMapType defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcMetricsMapType *_eDC_APIS_CLIENTEDCEdcMetricsMapType = [[EDC_APIS_CLIENTEDCEdcMetricsMapType alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcMetricsMapType initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcMetricsMapType = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcMetricsMapType autorelease];
return _eDC_APIS_CLIENTEDCEdcMetricsMapType;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcMetricsMapType 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 EDC_APIS_CLIENTEDCEdcMetricsMapType 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 "metric", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}metric of type {http://eurotech.com/edc/2.0}edcMetric.");
#endif
__child = [EDC_APIS_CLIENTEDCEdcMetric readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}metric of type {http://eurotech.com/edc/2.0}edcMetric.");
#endif
if ([self metrics]) {
[self setMetrics: [[self metrics] arrayByAddingObject: __child]];
}
else {
[self setMetrics: [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 metrics]) {
__enumerator = [[self metrics] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "metric", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}metric."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}metric...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}metric...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}metric."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcMetricsMapType (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcMetricsMapType_M */
#ifndef DEF_EDC_APIS_CLIENTESFDeviceCommandOutput_M
#define DEF_EDC_APIS_CLIENTESFDeviceCommandOutput_M
/**
* Represents the result of an OS command executed remotely on a device.
*/
@implementation EDC_APIS_CLIENTESFDeviceCommandOutput
/**
* The OS command exit code.
*/
- (int *) exitCode
{
return _exitCode;
}
/**
* The OS command exit code.
*/
- (void) setExitCode: (int *) newExitCode
{
if (_exitCode != NULL) {
free(_exitCode);
}
_exitCode = newExitCode;
}
/**
* Whether the OS command has been terminated by a timeout.
*/
- (BOOL *) timedout
{
return _timedout;
}
/**
* Whether the OS command has been terminated by a timeout.
*/
- (void) setTimedout: (BOOL *) newTimedout
{
if (_timedout != NULL) {
free(_timedout);
}
_timedout = newTimedout;
}
/**
* The standard error of the OS command.
*/
- (NSString *) stderr
{
return _stderr;
}
/**
* The standard error of the OS command.
*/
- (void) setStderr: (NSString *) newStderr
{
[newStderr retain];
[_stderr release];
_stderr = newStderr;
}
/**
* The standard output of the OS command.
*/
- (NSString *) stdout
{
return _stdout;
}
/**
* The standard output of the OS command.
*/
- (void) setStdout: (NSString *) newStdout
{
[newStdout retain];
[_stdout release];
_stdout = newStdout;
}
/**
* The message associated to an Exception occurring during command execution.
*/
- (NSString *) exceptionMessage
{
return _exceptionMessage;
}
/**
* The message associated to an Exception occurring during command execution.
*/
- (void) setExceptionMessage: (NSString *) newExceptionMessage
{
[newExceptionMessage retain];
[_exceptionMessage release];
_exceptionMessage = newExceptionMessage;
}
/**
* The stack associated to an Exception occurring during command execution.
*/
- (NSString *) exceptionStack
{
return _exceptionStack;
}
/**
* The stack associated to an Exception occurring during command execution.
*/
- (void) setExceptionStack: (NSString *) newExceptionStack
{
[newExceptionStack retain];
[_exceptionStack release];
_exceptionStack = newExceptionStack;
}
- (void) dealloc
{
[self setExitCode: NULL];
[self setTimedout: NULL];
[self setStderr: nil];
[self setStdout: nil];
[self setExceptionMessage: nil];
[self setExceptionStack: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFDeviceCommandOutput *_eDC_APIS_CLIENTESFDeviceCommandOutput;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFDeviceCommandOutput = (EDC_APIS_CLIENTESFDeviceCommandOutput *) [EDC_APIS_CLIENTESFDeviceCommandOutput readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFDeviceCommandOutput;
}
//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 EDC_APIS_CLIENTESFDeviceCommandOutput */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFDeviceCommandOutput (JAXB)
@end /*interface EDC_APIS_CLIENTESFDeviceCommandOutput (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFDeviceCommandOutput (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFDeviceCommandOutput from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFDeviceCommandOutput defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFDeviceCommandOutput *_eDC_APIS_CLIENTESFDeviceCommandOutput = [[EDC_APIS_CLIENTESFDeviceCommandOutput alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFDeviceCommandOutput initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFDeviceCommandOutput = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFDeviceCommandOutput autorelease];
return _eDC_APIS_CLIENTESFDeviceCommandOutput;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFDeviceCommandOutput 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 EDC_APIS_CLIENTESFDeviceCommandOutput 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 EDC_APIS_CLIENTESFDeviceCommandOutput from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}commandOutput".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFDeviceCommandOutput.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFDeviceCommandOutput *_deviceCommandOutput = 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 {http://eurotech.com/esf/2.0}commandOutput."];
}
}
if (xmlStrcmp(BAD_CAST "commandOutput", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}commandOutput.");
#endif
_deviceCommandOutput = (EDC_APIS_CLIENTESFDeviceCommandOutput *)[EDC_APIS_CLIENTESFDeviceCommandOutput readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}commandOutput.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceCommandOutput. Expected element {http://eurotech.com/esf/2.0}commandOutput. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceCommandOutput. Expected element {http://eurotech.com/esf/2.0}commandOutput. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceCommandOutput;
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceCommandOutput to XML under element name "{http://eurotech.com/esf/2.0}commandOutput".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceCommandOutput The DeviceCommandOutput to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceCommandOutput 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, BAD_CAST "esf", BAD_CAST "commandOutput", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}commandOutput. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}commandOutput...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}commandOutput'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}commandOutput...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}deviceCommandOutput for root element {http://eurotech.com/esf/2.0}commandOutput...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}deviceCommandOutput for root element {http://eurotech.com/esf/2.0}commandOutput...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}commandOutput. 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 "exitCode", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setExitCode: ((int*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "timedout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTimedout: ((BOOL*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "stderr", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}stderr of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}stderr of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setStderr: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "stdout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}stdout of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}stdout of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setStdout: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "exceptionMessage", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}exceptionMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}exceptionMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setExceptionMessage: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "exceptionStack", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}exceptionStack of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}exceptionStack of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setExceptionStack: __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 exitCode] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "exitCode", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}exitCode."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}exitCode...");
#endif
status = xmlTextWriterWriteIntType(writer, [self exitCode]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}exitCode...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/esf/2.0}exitCode."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}exitCode."];
}
}
if ([self timedout] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "timedout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}timedout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}timedout...");
#endif
status = xmlTextWriterWriteBooleanType(writer, [self timedout]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}timedout...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/esf/2.0}timedout."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}timedout."];
}
}
if ([self stderr]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "stderr", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}stderr."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}stderr...");
#endif
[[self stderr] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}stderr...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}stderr."];
}
}
if ([self stdout]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "stdout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}stdout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}stdout...");
#endif
[[self stdout] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}stdout...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}stdout."];
}
}
if ([self exceptionMessage]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "exceptionMessage", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}exceptionMessage."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}exceptionMessage...");
#endif
[[self exceptionMessage] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}exceptionMessage...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}exceptionMessage."];
}
}
if ([self exceptionStack]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "exceptionStack", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}exceptionStack."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}exceptionStack...");
#endif
[[self exceptionStack] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}exceptionStack...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}exceptionStack."];
}
}
}
@end /* implementation EDC_APIS_CLIENTESFDeviceCommandOutput (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFDeviceCommandOutput_M */
#ifndef DEF_EDC_APIS_CLIENTESFDeviceConfiguration_M
#define DEF_EDC_APIS_CLIENTESFDeviceConfiguration_M
/**
* A container for a list of OSGi component configurations.
*/
@implementation EDC_APIS_CLIENTESFDeviceConfiguration
/**
* (no documentation provided)
*/
- (NSArray *) configurations
{
return _configurations;
}
/**
* (no documentation provided)
*/
- (void) setConfigurations: (NSArray *) newConfigurations
{
[newConfigurations retain];
[_configurations release];
_configurations = newConfigurations;
}
- (void) dealloc
{
[self setConfigurations: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFDeviceConfiguration *_eDC_APIS_CLIENTESFDeviceConfiguration;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFDeviceConfiguration = (EDC_APIS_CLIENTESFDeviceConfiguration *) [EDC_APIS_CLIENTESFDeviceConfiguration readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFDeviceConfiguration;
}
//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 EDC_APIS_CLIENTESFDeviceConfiguration */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFDeviceConfiguration (JAXB)
@end /*interface EDC_APIS_CLIENTESFDeviceConfiguration (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFDeviceConfiguration (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFDeviceConfiguration from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFDeviceConfiguration defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFDeviceConfiguration *_eDC_APIS_CLIENTESFDeviceConfiguration = [[EDC_APIS_CLIENTESFDeviceConfiguration alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFDeviceConfiguration initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFDeviceConfiguration = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFDeviceConfiguration autorelease];
return _eDC_APIS_CLIENTESFDeviceConfiguration;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFDeviceConfiguration 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 EDC_APIS_CLIENTESFDeviceConfiguration 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 EDC_APIS_CLIENTESFDeviceConfiguration from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}configurations".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFDeviceConfiguration.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFDeviceConfiguration *_deviceConfiguration = 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 {http://eurotech.com/esf/2.0}configurations."];
}
}
if (xmlStrcmp(BAD_CAST "configurations", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}configurations.");
#endif
_deviceConfiguration = (EDC_APIS_CLIENTESFDeviceConfiguration *)[EDC_APIS_CLIENTESFDeviceConfiguration readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}configurations.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceConfiguration. Expected element {http://eurotech.com/esf/2.0}configurations. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceConfiguration. Expected element {http://eurotech.com/esf/2.0}configurations. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceConfiguration;
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceConfiguration to XML under element name "{http://eurotech.com/esf/2.0}configurations".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceConfiguration The DeviceConfiguration to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceConfiguration 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, BAD_CAST "esf", BAD_CAST "configurations", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}configurations. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}configurations...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}configurations'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}configurations...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}deviceConfiguration for root element {http://eurotech.com/esf/2.0}configurations...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}deviceConfiguration for root element {http://eurotech.com/esf/2.0}configurations...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}configurations. 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 "configuration", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}configuration of type {http://eurotech.com/esf/2.0}deviceComponentConfiguration.");
#endif
__child = [EDC_APIS_CLIENTESFDeviceComponentConfiguration readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}configuration of type {http://eurotech.com/esf/2.0}deviceComponentConfiguration.");
#endif
if ([self configurations]) {
[self setConfigurations: [[self configurations] arrayByAddingObject: __child]];
}
else {
[self setConfigurations: [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 configurations]) {
__enumerator = [[self configurations] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "configuration", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}configuration."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}configuration...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}configuration...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}configuration."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTESFDeviceConfiguration (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFDeviceConfiguration_M */
#ifndef DEF_EDC_APIS_CLIENTESFXmlConfigPropertyAdapted_M
#define DEF_EDC_APIS_CLIENTESFXmlConfigPropertyAdapted_M
/**
* Represents a typed property.
* Various flags help in the interpretation and semantics of the property value.
* For example, a property value might be an array or the property value might have been
* encrypted.
*/
@implementation EDC_APIS_CLIENTESFXmlConfigPropertyAdapted
/**
* The name of the property.
*/
- (NSString *) name
{
return _name;
}
/**
* The name of the property.
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* Whether the property value is an array.
*/
- (BOOL) array
{
return _array;
}
/**
* Whether the property value is an array.
*/
- (void) setArray: (BOOL) newArray
{
_array = newArray;
}
/**
* Whether the property value is encrypted.
*/
- (BOOL) encrypted
{
return _encrypted;
}
/**
* Whether the property value is encrypted.
*/
- (void) setEncrypted: (BOOL) newEncrypted
{
_encrypted = newEncrypted;
}
/**
* The property type.
*/
- (enum EDC_APIS_CLIENTESFConfigPropertyType *) type
{
return _type;
}
/**
* The property type.
*/
- (void) setType: (enum EDC_APIS_CLIENTESFConfigPropertyType *) newType
{
if (_type != NULL) {
free(_type);
}
_type = newType;
}
/**
* The property value(s).
*/
- (NSArray *) values
{
return _values;
}
/**
* The property value(s).
*/
- (void) setValues: (NSArray *) newValues
{
[newValues retain];
[_values release];
_values = newValues;
}
- (void) dealloc
{
[self setName: nil];
[self setType: NULL];
[self setValues: nil];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTESFXmlConfigPropertyAdapted */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFXmlConfigPropertyAdapted (JAXB)
@end /*interface EDC_APIS_CLIENTESFXmlConfigPropertyAdapted (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFXmlConfigPropertyAdapted (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFXmlConfigPropertyAdapted from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFXmlConfigPropertyAdapted defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFXmlConfigPropertyAdapted *_eDC_APIS_CLIENTESFXmlConfigPropertyAdapted = [[EDC_APIS_CLIENTESFXmlConfigPropertyAdapted alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFXmlConfigPropertyAdapted initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFXmlConfigPropertyAdapted = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFXmlConfigPropertyAdapted autorelease];
return _eDC_APIS_CLIENTESFXmlConfigPropertyAdapted;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFXmlConfigPropertyAdapted 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 EDC_APIS_CLIENTESFXmlConfigPropertyAdapted 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;
}
if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read attribute {}name...");
#endif
[self setName: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read attribute {}name...");
#endif
return YES;
}
if ((xmlStrcmp(BAD_CAST "array", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read attribute {}array...");
#endif
_child_accessor = xmlTextReaderReadBooleanType(reader);
if (_child_accessor == NULL) {
//panic: unable to read the attribute value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading attribute {}array."];
}
[self setArray: *((BOOL*) _child_accessor)];
free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read attribute {}array...");
#endif
return YES;
}
if ((xmlStrcmp(BAD_CAST "encrypted", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read attribute {}encrypted...");
#endif
_child_accessor = xmlTextReaderReadBooleanType(reader);
if (_child_accessor == NULL) {
//panic: unable to read the attribute value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading attribute {}encrypted."];
}
[self setEncrypted: *((BOOL*) _child_accessor)];
free(_child_accessor);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read attribute {}encrypted...");
#endif
return YES;
}
if ((xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read attribute {}type...");
#endif
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTESFConfigPropertyTypeType(reader);
if (_child_accessor == NULL) {
//panic: unable to read the attribute value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading attribute {}type."];
}
[self setType: ((enum EDC_APIS_CLIENTESFConfigPropertyType*) _child_accessor)];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read attribute {}type...");
#endif
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 "value", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self values]) {
[self setValues: [[self values] arrayByAddingObject: __child]];
}
else {
[self setValues: [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];
if ([self name]) {
status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start attribute {}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing attribute {}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote attribute {}name...");
#endif
status = xmlTextWriterEndAttribute(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end attribute {}name."];
}
}
if (YES) { //always write the primitive attributes...
status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "array", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start attribute {}array."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing attribute {}array...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_array);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute {}array."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote attribute {}array...");
#endif
status = xmlTextWriterEndAttribute(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end attribute {}array."];
}
}
if (YES) { //always write the primitive attributes...
status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "encrypted", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start attribute {}encrypted."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing attribute {}encrypted...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_encrypted);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute {}encrypted."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote attribute {}encrypted...");
#endif
status = xmlTextWriterEndAttribute(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end attribute {}encrypted."];
}
}
if ([self type] != NULL) {
status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "type", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start attribute {}type."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing attribute {}type...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTESFConfigPropertyTypeType(writer, [self type]);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute {}type."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote attribute {}type...");
#endif
status = xmlTextWriterEndAttribute(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end attribute {}type."];
}
}
}
//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 values]) {
__enumerator = [[self values] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "value", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}value."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}value...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}value...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}value."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTESFXmlConfigPropertyAdapted (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFXmlConfigPropertyAdapted_M */
#ifndef DEF_EDC_APIS_CLIENTESFXmlBundleInfo_M
#define DEF_EDC_APIS_CLIENTESFXmlBundleInfo_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTESFXmlBundleInfo
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) version
{
return _version;
}
/**
* (no documentation provided)
*/
- (void) setVersion: (NSString *) newVersion
{
[newVersion retain];
[_version release];
_version = newVersion;
}
- (void) dealloc
{
[self setName: nil];
[self setVersion: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFXmlBundleInfo *_eDC_APIS_CLIENTESFXmlBundleInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFXmlBundleInfo = (EDC_APIS_CLIENTESFXmlBundleInfo *) [EDC_APIS_CLIENTESFXmlBundleInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFXmlBundleInfo;
}
//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 EDC_APIS_CLIENTESFXmlBundleInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFXmlBundleInfo (JAXB)
@end /*interface EDC_APIS_CLIENTESFXmlBundleInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFXmlBundleInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFXmlBundleInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFXmlBundleInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFXmlBundleInfo *_eDC_APIS_CLIENTESFXmlBundleInfo = [[EDC_APIS_CLIENTESFXmlBundleInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFXmlBundleInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFXmlBundleInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFXmlBundleInfo autorelease];
return _eDC_APIS_CLIENTESFXmlBundleInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFXmlBundleInfo 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 EDC_APIS_CLIENTESFXmlBundleInfo 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 EDC_APIS_CLIENTESFXmlBundleInfo from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}bundleInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFXmlBundleInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFXmlBundleInfo *_xmlBundleInfo = 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 {http://eurotech.com/esf/2.0}bundleInfo."];
}
}
if (xmlStrcmp(BAD_CAST "bundleInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}bundleInfo.");
#endif
_xmlBundleInfo = (EDC_APIS_CLIENTESFXmlBundleInfo *)[EDC_APIS_CLIENTESFXmlBundleInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}bundleInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlBundleInfo. Expected element {http://eurotech.com/esf/2.0}bundleInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlBundleInfo. Expected element {http://eurotech.com/esf/2.0}bundleInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _xmlBundleInfo;
}
/**
* Writes this EDC_APIS_CLIENTESFXmlBundleInfo to XML under element name "{http://eurotech.com/esf/2.0}bundleInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _xmlBundleInfo The XmlBundleInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFXmlBundleInfo 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, BAD_CAST "esf", BAD_CAST "bundleInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}bundleInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}bundleInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}bundleInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}bundleInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}xmlBundleInfo for root element {http://eurotech.com/esf/2.0}bundleInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}xmlBundleInfo for root element {http://eurotech.com/esf/2.0}bundleInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}bundleInfo. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}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 "version", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}version of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}version of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setVersion: __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 name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}name."];
}
}
if ([self version]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "version", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}version."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}version...");
#endif
[[self version] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}version...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}version."];
}
}
}
@end /* implementation EDC_APIS_CLIENTESFXmlBundleInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFXmlBundleInfo_M */
#ifndef DEF_EDC_APIS_CLIENTESFXmlDeploymentPackages_M
#define DEF_EDC_APIS_CLIENTESFXmlDeploymentPackages_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTESFXmlDeploymentPackages
/**
* (no documentation provided)
*/
- (NSArray *) deploymentPackages
{
return _deploymentPackages;
}
/**
* (no documentation provided)
*/
- (void) setDeploymentPackages: (NSArray *) newDeploymentPackages
{
[newDeploymentPackages retain];
[_deploymentPackages release];
_deploymentPackages = newDeploymentPackages;
}
- (void) dealloc
{
[self setDeploymentPackages: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFXmlDeploymentPackages *_eDC_APIS_CLIENTESFXmlDeploymentPackages;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFXmlDeploymentPackages = (EDC_APIS_CLIENTESFXmlDeploymentPackages *) [EDC_APIS_CLIENTESFXmlDeploymentPackages readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFXmlDeploymentPackages;
}
//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 EDC_APIS_CLIENTESFXmlDeploymentPackages */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFXmlDeploymentPackages (JAXB)
@end /*interface EDC_APIS_CLIENTESFXmlDeploymentPackages (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFXmlDeploymentPackages (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFXmlDeploymentPackages from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFXmlDeploymentPackages defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFXmlDeploymentPackages *_eDC_APIS_CLIENTESFXmlDeploymentPackages = [[EDC_APIS_CLIENTESFXmlDeploymentPackages alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFXmlDeploymentPackages initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFXmlDeploymentPackages = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFXmlDeploymentPackages autorelease];
return _eDC_APIS_CLIENTESFXmlDeploymentPackages;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFXmlDeploymentPackages 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 EDC_APIS_CLIENTESFXmlDeploymentPackages 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 EDC_APIS_CLIENTESFXmlDeploymentPackages from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}packages".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFXmlDeploymentPackages.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFXmlDeploymentPackages *_xmlDeploymentPackages = 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 {http://eurotech.com/esf/2.0}packages."];
}
}
if (xmlStrcmp(BAD_CAST "packages", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}packages.");
#endif
_xmlDeploymentPackages = (EDC_APIS_CLIENTESFXmlDeploymentPackages *)[EDC_APIS_CLIENTESFXmlDeploymentPackages readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}packages.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlDeploymentPackages. Expected element {http://eurotech.com/esf/2.0}packages. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlDeploymentPackages. Expected element {http://eurotech.com/esf/2.0}packages. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _xmlDeploymentPackages;
}
/**
* Writes this EDC_APIS_CLIENTESFXmlDeploymentPackages to XML under element name "{http://eurotech.com/esf/2.0}packages".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _xmlDeploymentPackages The XmlDeploymentPackages to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFXmlDeploymentPackages 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, BAD_CAST "esf", BAD_CAST "packages", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}packages. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}packages...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}packages'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}packages...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}xmlDeploymentPackages for root element {http://eurotech.com/esf/2.0}packages...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}xmlDeploymentPackages for root element {http://eurotech.com/esf/2.0}packages...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}packages. 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 "package", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}package of type {http://eurotech.com/esf/2.0}xmlDeploymentPackage.");
#endif
__child = [EDC_APIS_CLIENTESFXmlDeploymentPackage readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}package of type {http://eurotech.com/esf/2.0}xmlDeploymentPackage.");
#endif
if ([self deploymentPackages]) {
[self setDeploymentPackages: [[self deploymentPackages] arrayByAddingObject: __child]];
}
else {
[self setDeploymentPackages: [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 deploymentPackages]) {
__enumerator = [[self deploymentPackages] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "package", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}package."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}package...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}package...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}package."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTESFXmlDeploymentPackages (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFXmlDeploymentPackages_M */
#ifndef DEF_EDC_APIS_CLIENTESFXmlDeploymentPackage_M
#define DEF_EDC_APIS_CLIENTESFXmlDeploymentPackage_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTESFXmlDeploymentPackage
/**
* (no documentation provided)
*/
- (NSString *) name
{
return _name;
}
/**
* (no documentation provided)
*/
- (void) setName: (NSString *) newName
{
[newName retain];
[_name release];
_name = newName;
}
/**
* (no documentation provided)
*/
- (NSString *) version
{
return _version;
}
/**
* (no documentation provided)
*/
- (void) setVersion: (NSString *) newVersion
{
[newVersion retain];
[_version release];
_version = newVersion;
}
/**
* (no documentation provided)
*/
- (NSArray *) bundleInfos
{
return _bundleInfos;
}
/**
* (no documentation provided)
*/
- (void) setBundleInfos: (NSArray *) newBundleInfos
{
[newBundleInfos retain];
[_bundleInfos release];
_bundleInfos = newBundleInfos;
}
- (void) dealloc
{
[self setName: nil];
[self setVersion: nil];
[self setBundleInfos: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFXmlDeploymentPackage *_eDC_APIS_CLIENTESFXmlDeploymentPackage;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFXmlDeploymentPackage = (EDC_APIS_CLIENTESFXmlDeploymentPackage *) [EDC_APIS_CLIENTESFXmlDeploymentPackage readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFXmlDeploymentPackage;
}
//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 EDC_APIS_CLIENTESFXmlDeploymentPackage */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFXmlDeploymentPackage (JAXB)
@end /*interface EDC_APIS_CLIENTESFXmlDeploymentPackage (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFXmlDeploymentPackage (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFXmlDeploymentPackage from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFXmlDeploymentPackage defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFXmlDeploymentPackage *_eDC_APIS_CLIENTESFXmlDeploymentPackage = [[EDC_APIS_CLIENTESFXmlDeploymentPackage alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFXmlDeploymentPackage initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFXmlDeploymentPackage = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFXmlDeploymentPackage autorelease];
return _eDC_APIS_CLIENTESFXmlDeploymentPackage;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFXmlDeploymentPackage 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 EDC_APIS_CLIENTESFXmlDeploymentPackage 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 EDC_APIS_CLIENTESFXmlDeploymentPackage from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}package".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFXmlDeploymentPackage.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFXmlDeploymentPackage *_xmlDeploymentPackage = 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 {http://eurotech.com/esf/2.0}package."];
}
}
if (xmlStrcmp(BAD_CAST "package", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}package.");
#endif
_xmlDeploymentPackage = (EDC_APIS_CLIENTESFXmlDeploymentPackage *)[EDC_APIS_CLIENTESFXmlDeploymentPackage readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}package.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlDeploymentPackage. Expected element {http://eurotech.com/esf/2.0}package. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFXmlDeploymentPackage. Expected element {http://eurotech.com/esf/2.0}package. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _xmlDeploymentPackage;
}
/**
* Writes this EDC_APIS_CLIENTESFXmlDeploymentPackage to XML under element name "{http://eurotech.com/esf/2.0}package".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _xmlDeploymentPackage The XmlDeploymentPackage to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFXmlDeploymentPackage 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, BAD_CAST "esf", BAD_CAST "package", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}package. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}package...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}package'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}package...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}xmlDeploymentPackage for root element {http://eurotech.com/esf/2.0}package...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}xmlDeploymentPackage for root element {http://eurotech.com/esf/2.0}package...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}package. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}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 "version", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}version of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}version of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setVersion: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "bundles", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/esf/2.0}bundles...");
#endif
//start wrapper element "{http://eurotech.com/esf/2.0}bundles"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "bundle", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}bundle of type {http://eurotech.com/esf/2.0}xmlBundleInfo.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[EDC_APIS_CLIENTESFXmlBundleInfo alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [EDC_APIS_CLIENTESFXmlBundleInfo readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}bundle of type {http://eurotech.com/esf/2.0}xmlBundleInfo.");
#endif
if ([self bundleInfos]) {
[self setBundleInfos: [[self bundleInfos] arrayByAddingObject: __child]];
}
else {
[self setBundleInfos: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/esf/2.0}bundles...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setBundleInfos: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}name...");
#endif
[[self name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}name."];
}
}
if ([self version]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "version", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}version."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}version...");
#endif
[[self version] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}version...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}version."];
}
}
if ([self bundleInfos]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "bundles", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/esf/2.0}bundles."];
}
__enumerator = [[self bundleInfos] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "bundle", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}bundle."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}bundle...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}bundle...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}bundle."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/esf/2.0}bundles."];
}
}
}
@end /* implementation EDC_APIS_CLIENTESFXmlDeploymentPackage (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFXmlDeploymentPackage_M */
#ifndef DEF_EDC_APIS_CLIENTESFConfigPropertyType_M
#define DEF_EDC_APIS_CLIENTESFConfigPropertyType_M
/**
* Reads a ConfigPropertyType from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The ConfigPropertyType, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTESFConfigPropertyType *xmlTextReaderReadEDC_APIS_CLIENTESFConfigPropertyTypeType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTESFConfigPropertyType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTESFConfigPropertyType));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "String") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_STRINGTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Long") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_LONGTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Double") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_DOUBLETYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Float") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_FLOATTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Integer") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_INTEGERTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Byte") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BYTETYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Char") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_CHARTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Boolean") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BOOLEANTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Short") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_SHORTTYPE;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "Password") == 0) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_PASSWORDTYPE;
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 _configPropertyType The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTESFConfigPropertyType *formatStringToEDC_APIS_CLIENTESFConfigPropertyTypeType(NSString *_configPropertyType)
{
enum EDC_APIS_CLIENTESFConfigPropertyType *value = calloc(1, sizeof(enum EDC_APIS_CLIENTESFConfigPropertyType));
if ([@"String" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_STRINGTYPE;
}
else if ([@"Long" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_LONGTYPE;
}
else if ([@"Double" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_DOUBLETYPE;
}
else if ([@"Float" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_FLOATTYPE;
}
else if ([@"Integer" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_INTEGERTYPE;
}
else if ([@"Byte" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BYTETYPE;
}
else if ([@"Char" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_CHARTYPE;
}
else if ([@"Boolean" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BOOLEANTYPE;
}
else if ([@"Short" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_SHORTTYPE;
}
else if ([@"Password" isEqualToString:_configPropertyType]) {
*value = EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_PASSWORDTYPE;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_configPropertyType UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a ConfigPropertyType to XML.
*
* @param writer The XML writer.
* @param _configPropertyType The ConfigPropertyType to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTESFConfigPropertyTypeType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTESFConfigPropertyType *_configPropertyType)
{
switch (*_configPropertyType) {
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_STRINGTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "String");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_LONGTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Long");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_DOUBLETYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Double");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_FLOATTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Float");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_INTEGERTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Integer");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BYTETYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Byte");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_CHARTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Char");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BOOLEANTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Boolean");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_SHORTTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Short");
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_PASSWORDTYPE:
return xmlTextWriterWriteString(writer, BAD_CAST "Password");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of ConfigPropertyType.
*
* @param _configPropertyType The ConfigPropertyType to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTESFConfigPropertyTypeTypeToString(enum EDC_APIS_CLIENTESFConfigPropertyType *_configPropertyType)
{
switch (*_configPropertyType) {
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_STRINGTYPE:
return @"String";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_LONGTYPE:
return @"Long";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_DOUBLETYPE:
return @"Double";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_FLOATTYPE:
return @"Float";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_INTEGERTYPE:
return @"Integer";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BYTETYPE:
return @"Byte";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_CHARTYPE:
return @"Char";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_BOOLEANTYPE:
return @"Boolean";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_SHORTTYPE:
return @"Short";
case EDC_APIS_CLIENT_ESF_CONFIGPROPERTYTYPE_PASSWORDTYPE:
return @"Password";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTESFConfigPropertyType_M */
#ifndef DEF_EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted_M
#define DEF_EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted_M
/**
* A container for XmlConfigPropertyAdapted organized into an array.
*/
@implementation EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted
/**
* (no documentation provided)
*/
- (NSArray *) properties
{
return _properties;
}
/**
* (no documentation provided)
*/
- (void) setProperties: (NSArray *) newProperties
{
[newProperties retain];
[_properties release];
_properties = newProperties;
}
- (void) dealloc
{
[self setProperties: nil];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted (JAXB)
@end /*interface EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted *_eDC_APIS_CLIENTESFXmlConfigPropertiesAdapted = [[EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFXmlConfigPropertiesAdapted initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFXmlConfigPropertiesAdapted = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFXmlConfigPropertiesAdapted autorelease];
return _eDC_APIS_CLIENTESFXmlConfigPropertiesAdapted;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted 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 EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted 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 "property", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}property of type {http://eurotech.com/esf/2.0}xmlConfigPropertyAdapted.");
#endif
__child = [EDC_APIS_CLIENTESFXmlConfigPropertyAdapted readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}property of type {http://eurotech.com/esf/2.0}xmlConfigPropertyAdapted.");
#endif
if ([self properties]) {
[self setProperties: [[self properties] arrayByAddingObject: __child]];
}
else {
[self setProperties: [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 properties]) {
__enumerator = [[self properties] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "property", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}property."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}property...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}property...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}property."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted_M */
#ifndef DEF_EDC_APIS_CLIENTESFDeviceComponentConfiguration_M
#define DEF_EDC_APIS_CLIENTESFDeviceComponentConfiguration_M
/**
* Describes the configuration of an OSGi Component.
* The Component configuration groups all the information related to the configuration of a Component.
* It provides access to parsed ObjectClassDefintion associated to this Component.
* The configuration does not reuse the OSGi ObjectClassDefinition as the latter
* does not provide access to certain aspects such as the required attribute,
* the min and max values. Instead it returns the raw ObjectClassDefintion as parsed
* from the MetaType Information XML resource associated to this Component.
*/
@implementation EDC_APIS_CLIENTESFDeviceComponentConfiguration
/**
* The PID (service's persistent identity) of the OSGi Component
* associated to this configuration.
* The service's persistent identity is defined as the name attribute of the
* Component Descriptor XML file; at runtime, the same value is also available
* in the component.name and in the service.pid attributes of the Component Configuration.
*/
- (NSString *) componentId
{
return _componentId;
}
/**
* The PID (service's persistent identity) of the OSGi Component
* associated to this configuration.
* The service's persistent identity is defined as the name attribute of the
* Component Descriptor XML file; at runtime, the same value is also available
* in the component.name and in the service.pid attributes of the Component Configuration.
*/
- (void) setComponentId: (NSString *) newComponentId
{
[newComponentId retain];
[_componentId release];
_componentId = newComponentId;
}
/**
* The raw ObjectClassDefinition as parsed from the MetaType
* Information XML resource associated to this Component.
*/
- (EDC_APIS_CLIENTOCDTocd *) definition
{
return _definition;
}
/**
* The raw ObjectClassDefinition as parsed from the MetaType
* Information XML resource associated to this Component.
*/
- (void) setDefinition: (EDC_APIS_CLIENTOCDTocd *) newDefinition
{
[newDefinition retain];
[_definition release];
_definition = newDefinition;
}
/**
* The Dictionary of properties currently used by this component.
*/
- (EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted *) properties
{
return _properties;
}
/**
* The Dictionary of properties currently used by this component.
*/
- (void) setProperties: (EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted *) newProperties
{
[newProperties retain];
[_properties release];
_properties = newProperties;
}
- (void) dealloc
{
[self setComponentId: nil];
[self setDefinition: nil];
[self setProperties: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFDeviceComponentConfiguration *_eDC_APIS_CLIENTESFDeviceComponentConfiguration;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFDeviceComponentConfiguration = (EDC_APIS_CLIENTESFDeviceComponentConfiguration *) [EDC_APIS_CLIENTESFDeviceComponentConfiguration readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFDeviceComponentConfiguration;
}
//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 EDC_APIS_CLIENTESFDeviceComponentConfiguration */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFDeviceComponentConfiguration (JAXB)
@end /*interface EDC_APIS_CLIENTESFDeviceComponentConfiguration (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFDeviceComponentConfiguration (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFDeviceComponentConfiguration from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFDeviceComponentConfiguration defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFDeviceComponentConfiguration *_eDC_APIS_CLIENTESFDeviceComponentConfiguration = [[EDC_APIS_CLIENTESFDeviceComponentConfiguration alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFDeviceComponentConfiguration initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFDeviceComponentConfiguration = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFDeviceComponentConfiguration autorelease];
return _eDC_APIS_CLIENTESFDeviceComponentConfiguration;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFDeviceComponentConfiguration 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 EDC_APIS_CLIENTESFDeviceComponentConfiguration 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 EDC_APIS_CLIENTESFDeviceComponentConfiguration from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}configuration".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFDeviceComponentConfiguration.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFDeviceComponentConfiguration *_deviceComponentConfiguration = 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 {http://eurotech.com/esf/2.0}configuration."];
}
}
if (xmlStrcmp(BAD_CAST "configuration", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}configuration.");
#endif
_deviceComponentConfiguration = (EDC_APIS_CLIENTESFDeviceComponentConfiguration *)[EDC_APIS_CLIENTESFDeviceComponentConfiguration readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}configuration.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceComponentConfiguration. Expected element {http://eurotech.com/esf/2.0}configuration. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceComponentConfiguration. Expected element {http://eurotech.com/esf/2.0}configuration. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceComponentConfiguration;
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceComponentConfiguration to XML under element name "{http://eurotech.com/esf/2.0}configuration".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceComponentConfiguration The DeviceComponentConfiguration to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceComponentConfiguration 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, BAD_CAST "esf", BAD_CAST "configuration", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}configuration. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}configuration...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:ocd", BAD_CAST "http://www.osgi.org/xmlns/metatype/v1.2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:ocd' on '{http://eurotech.com/esf/2.0}configuration'. XML writer status: %i\n", rc];
}
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}configuration'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}configuration...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}deviceComponentConfiguration for root element {http://eurotech.com/esf/2.0}configuration...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}deviceComponentConfiguration for root element {http://eurotech.com/esf/2.0}configuration...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}configuration. XML writer status: %i\n", rc];
}
}
//documentation inherited.
- (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader
{
void *_child_accessor;
if ([super readJAXBAttribute: reader]) {
return YES;
}
if ((xmlStrcmp(BAD_CAST "pid", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read attribute {}pid...");
#endif
[self setComponentId: (NSString*) [NSString readXMLType: reader]];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read attribute {}pid...");
#endif
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 "OCD", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://www.osgi.org/xmlns/metatype/v1.2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://www.osgi.org/xmlns/metatype/v1.2.0}OCD of element {http://www.osgi.org/xmlns/metatype/v1.2.0}OCD.");
#endif
__child = [EDC_APIS_CLIENTOCDTocd readXMLElement: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://www.osgi.org/xmlns/metatype/v1.2.0}OCD of element {http://www.osgi.org/xmlns/metatype/v1.2.0}OCD.");
#endif
[self setDefinition: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "properties", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}properties of type {http://eurotech.com/esf/2.0}xmlConfigPropertiesAdapted.");
#endif
__child = [EDC_APIS_CLIENTESFXmlConfigPropertiesAdapted readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}properties of type {http://eurotech.com/esf/2.0}xmlConfigPropertiesAdapted.");
#endif
[self setProperties: __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];
if ([self componentId]) {
status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "pid", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start attribute {}pid."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing attribute {}pid...");
#endif
[[self componentId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote attribute {}pid...");
#endif
status = xmlTextWriterEndAttribute(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end attribute {}pid."];
}
}
}
//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 definition]) {
[[self definition] writeXMLElement: writer writeNamespaces: NO];
}
if ([self properties]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "properties", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}properties."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}properties...");
#endif
[[self properties] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}properties...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}properties."];
}
}
}
@end /* implementation EDC_APIS_CLIENTESFDeviceComponentConfiguration (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFDeviceComponentConfiguration_M */
#ifndef DEF_EDC_APIS_CLIENTESFDeviceCommandInput_M
#define DEF_EDC_APIS_CLIENTESFDeviceCommandInput_M
/**
* Represents an OS command to be executed remotely on a device.
*/
@implementation EDC_APIS_CLIENTESFDeviceCommandInput
/**
* The OS command to be executed.
*/
- (NSString *) command
{
return _command;
}
/**
* The OS command to be executed.
*/
- (void) setCommand: (NSString *) newCommand
{
[newCommand retain];
[_command release];
_command = newCommand;
}
/**
* The OS command arguments.
*/
- (NSArray *) arguments
{
return _arguments;
}
/**
* The OS command arguments.
*/
- (void) setArguments: (NSArray *) newArguments
{
[newArguments retain];
[_arguments release];
_arguments = newArguments;
}
/**
* Timeout, in seconds, to terminate the OS command.
*/
- (int) timeout
{
return _timeout;
}
/**
* Timeout, in seconds, to terminate the OS command.
*/
- (void) setTimeout: (int) newTimeout
{
_timeout = newTimeout;
}
/**
* The standard input for the OS command.
*/
- (NSString *) stdin
{
return _stdin;
}
/**
* The standard input for the OS command.
*/
- (void) setStdin: (NSString *) newStdin
{
[newStdin retain];
[_stdin release];
_stdin = newStdin;
}
/**
* An array of "key=value" environment variables.
*/
- (NSArray *) environment
{
return _environment;
}
/**
* An array of "key=value" environment variables.
*/
- (void) setEnvironment: (NSArray *) newEnvironment
{
[newEnvironment retain];
[_environment release];
_environment = newEnvironment;
}
/**
* Sets the working directory.
*/
- (NSString *) workingDir
{
return _workingDir;
}
/**
* Sets the working directory.
*/
- (void) setWorkingDir: (NSString *) newWorkingDir
{
[newWorkingDir retain];
[_workingDir release];
_workingDir = newWorkingDir;
}
/**
* Whether the OS command will run asynchronously.
*/
- (BOOL) runAsynch
{
return _runAsynch;
}
/**
* Whether the OS command will run asynchronously.
*/
- (void) setRunAsynch: (BOOL) newRunAsynch
{
_runAsynch = newRunAsynch;
}
/**
* The optional password required to execute commands on the device.
*/
- (NSString *) password
{
return _password;
}
/**
* The optional password required to execute commands on the device.
*/
- (void) setPassword: (NSString *) newPassword
{
[newPassword retain];
[_password release];
_password = newPassword;
}
- (void) dealloc
{
[self setCommand: nil];
[self setArguments: nil];
[self setStdin: nil];
[self setEnvironment: nil];
[self setWorkingDir: nil];
[self setPassword: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTESFDeviceCommandInput *_eDC_APIS_CLIENTESFDeviceCommandInput;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTESFDeviceCommandInput = (EDC_APIS_CLIENTESFDeviceCommandInput *) [EDC_APIS_CLIENTESFDeviceCommandInput readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTESFDeviceCommandInput;
}
//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 EDC_APIS_CLIENTESFDeviceCommandInput */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTESFDeviceCommandInput (JAXB)
@end /*interface EDC_APIS_CLIENTESFDeviceCommandInput (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTESFDeviceCommandInput (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTESFDeviceCommandInput from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTESFDeviceCommandInput defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTESFDeviceCommandInput *_eDC_APIS_CLIENTESFDeviceCommandInput = [[EDC_APIS_CLIENTESFDeviceCommandInput alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTESFDeviceCommandInput initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTESFDeviceCommandInput = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTESFDeviceCommandInput autorelease];
return _eDC_APIS_CLIENTESFDeviceCommandInput;
}
/**
* Initialize this instance of EDC_APIS_CLIENTESFDeviceCommandInput 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 EDC_APIS_CLIENTESFDeviceCommandInput 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 EDC_APIS_CLIENTESFDeviceCommandInput from an XML reader. The element to be read is
* "{http://eurotech.com/esf/2.0}commandInput".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTESFDeviceCommandInput.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTESFDeviceCommandInput *_deviceCommandInput = 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 {http://eurotech.com/esf/2.0}commandInput."];
}
}
if (xmlStrcmp(BAD_CAST "commandInput", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/esf/2.0}commandInput.");
#endif
_deviceCommandInput = (EDC_APIS_CLIENTESFDeviceCommandInput *)[EDC_APIS_CLIENTESFDeviceCommandInput readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/esf/2.0}commandInput.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceCommandInput. Expected element {http://eurotech.com/esf/2.0}commandInput. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTESFDeviceCommandInput. Expected element {http://eurotech.com/esf/2.0}commandInput. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceCommandInput;
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceCommandInput to XML under element name "{http://eurotech.com/esf/2.0}commandInput".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceCommandInput The DeviceCommandInput to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTESFDeviceCommandInput 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, BAD_CAST "esf", BAD_CAST "commandInput", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/esf/2.0}commandInput. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/esf/2.0}commandInput...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:esf", BAD_CAST "http://eurotech.com/esf/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:esf' on '{http://eurotech.com/esf/2.0}commandInput'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/esf/2.0}commandInput...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/esf/2.0}deviceCommandInput for root element {http://eurotech.com/esf/2.0}commandInput...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/esf/2.0}deviceCommandInput for root element {http://eurotech.com/esf/2.0}commandInput...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/esf/2.0}commandInput. 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 "command", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}command of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}command of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setCommand: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "arguments", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}arguments of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}arguments of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self arguments]) {
[self setArguments: [[self arguments] arrayByAddingObject: __child]];
}
else {
[self setArguments: [NSArray arrayWithObject: __child]];
}
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "timeout", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTimeout: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "stdin", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}stdin of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}stdin of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setStdin: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "environment", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}environment of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}environment of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self environment]) {
[self setEnvironment: [[self environment] arrayByAddingObject: __child]];
}
else {
[self setEnvironment: [NSArray arrayWithObject: __child]];
}
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "workingDir", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}workingDir of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}workingDir of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setWorkingDir: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "runAsync", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setRunAsynch: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "password", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/esf/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/esf/2.0}password of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/esf/2.0}password of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPassword: __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 command]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "command", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}command."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}command...");
#endif
[[self command] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}command...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}command."];
}
}
if ([self arguments]) {
__enumerator = [[self arguments] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "arguments", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}arguments."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}arguments...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}arguments...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}arguments."];
}
} //end item iterator.
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "timeout", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}timeout."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}timeout...");
#endif
status = xmlTextWriterWriteIntType(writer, &_timeout);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}timeout...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/esf/2.0}timeout."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}timeout."];
}
}
if ([self stdin]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "stdin", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}stdin."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}stdin...");
#endif
[[self stdin] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}stdin...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}stdin."];
}
}
if ([self environment]) {
__enumerator = [[self environment] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "environment", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}environment."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}environment...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}environment...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}environment."];
}
} //end item iterator.
}
if ([self workingDir]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "workingDir", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}workingDir."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}workingDir...");
#endif
[[self workingDir] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}workingDir...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}workingDir."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "runAsync", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}runAsync."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}runAsync...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_runAsynch);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}runAsync...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/esf/2.0}runAsync."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}runAsync."];
}
}
if ([self password]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "esf", BAD_CAST "password", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/esf/2.0}password."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/esf/2.0}password...");
#endif
[[self password] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/esf/2.0}password...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/esf/2.0}password."];
}
}
}
@end /* implementation EDC_APIS_CLIENTESFDeviceCommandInput (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTESFDeviceCommandInput_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcMetricValue_M
#define DEF_EDC_APIS_CLIENTEDCEdcMetricValue_M
/**
* EdcMetricValue represents an instance of a metric stored in metricsByValue or metricsByTimestamp column families.
* The metric is defined by a timestamp, a value and the UUID of the message on which the metric was published. The timestamp is a long type.
* The value is the string representation of the corresponding value object.?????
* For the primitive types, the conversion is straight forward.
* Values of type base64Binary represent a metric of type byte array;
* in this case, the metric value is serialized into a base64 encoded string.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetricValue
/**
* Timestamp of the Metric.
*/
- (long long *) timestamp
{
return _timestamp;
}
/**
* Timestamp of the Metric.
*/
- (void) setTimestamp: (long long *) newTimestamp
{
if (_timestamp != NULL) {
free(_timestamp);
}
_timestamp = newTimestamp;
}
/**
* String representation of the Metric value according to the Metric type.
*/
- (NSString *) value
{
return _value;
}
/**
* String representation of the Metric value according to the Metric type.
*/
- (void) setValue: (NSString *) newValue
{
[newValue retain];
[_value release];
_value = newValue;
}
/**
* UUID of the messages on which the metric was published.
*/
- (NSString *) uuid
{
return _uuid;
}
/**
* UUID of the messages on which the metric was published.
*/
- (void) setUuid: (NSString *) newUuid
{
[newUuid retain];
[_uuid release];
_uuid = newUuid;
}
- (void) dealloc
{
[self setTimestamp: NULL];
[self setValue: nil];
[self setUuid: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcMetricValue *_eDC_APIS_CLIENTEDCEdcMetricValue;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcMetricValue = (EDC_APIS_CLIENTEDCEdcMetricValue *) [EDC_APIS_CLIENTEDCEdcMetricValue readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcMetricValue;
}
//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 EDC_APIS_CLIENTEDCEdcMetricValue */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcMetricValue (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcMetricValue (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcMetricValue (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcMetricValue from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcMetricValue defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcMetricValue *_eDC_APIS_CLIENTEDCEdcMetricValue = [[EDC_APIS_CLIENTEDCEdcMetricValue alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcMetricValue initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcMetricValue = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcMetricValue autorelease];
return _eDC_APIS_CLIENTEDCEdcMetricValue;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcMetricValue 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 EDC_APIS_CLIENTEDCEdcMetricValue 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 EDC_APIS_CLIENTEDCEdcMetricValue from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}metricValue".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcMetricValue.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcMetricValue *_edcMetricValue = 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 {http://eurotech.com/edc/2.0}metricValue."];
}
}
if (xmlStrcmp(BAD_CAST "metricValue", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}metricValue.");
#endif
_edcMetricValue = (EDC_APIS_CLIENTEDCEdcMetricValue *)[EDC_APIS_CLIENTEDCEdcMetricValue readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}metricValue.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMetricValue. Expected element {http://eurotech.com/edc/2.0}metricValue. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMetricValue. Expected element {http://eurotech.com/edc/2.0}metricValue. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcMetricValue;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMetricValue to XML under element name "{http://eurotech.com/edc/2.0}metricValue".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcMetricValue The EdcMetricValue to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMetricValue 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, BAD_CAST "edc", BAD_CAST "metricValue", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}metricValue. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}metricValue...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}metricValue'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}metricValue...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcMetricValue for root element {http://eurotech.com/edc/2.0}metricValue...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcMetricValue for root element {http://eurotech.com/edc/2.0}metricValue...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}metricValue. 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 "timestamp", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setTimestamp: ((long long*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}value of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setValue: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "uuid", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}uuid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}uuid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setUuid: __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 timestamp] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "timestamp", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}timestamp."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}timestamp...");
#endif
status = xmlTextWriterWriteLongType(writer, [self timestamp]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}timestamp...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}timestamp."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}timestamp."];
}
}
if ([self value]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "value", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}value."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}value...");
#endif
[[self value] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}value...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}value."];
}
}
if ([self uuid]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "uuid", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}uuid."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}uuid...");
#endif
[[self uuid] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}uuid...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}uuid."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcMetricValue (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcMetricValue_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcPosition_M
#define DEF_EDC_APIS_CLIENTEDCEdcPosition_M
/**
* EdcPosition is a data structure to capture a geo location. It can be
* associated to an EdcPayload to geotag an EdcMessage before sending to the
* Everyware Cloud. Refer to the description of each of the fields for more
* information on the model of EdcPosition.
*/
@implementation EDC_APIS_CLIENTEDCEdcPosition
/**
* Longitude of this position in degrees. This is a mandatory field.
*/
- (double *) longitude
{
return _longitude;
}
/**
* Longitude of this position in degrees. This is a mandatory field.
*/
- (void) setLongitude: (double *) newLongitude
{
if (_longitude != NULL) {
free(_longitude);
}
_longitude = newLongitude;
}
/**
* Latitude of this position in degrees. This is a mandatory field.
*/
- (double *) latitude
{
return _latitude;
}
/**
* Latitude of this position in degrees. This is a mandatory field.
*/
- (void) setLatitude: (double *) newLatitude
{
if (_latitude != NULL) {
free(_latitude);
}
_latitude = newLatitude;
}
/**
* Altitude of the position in meters.
*/
- (double *) altitude
{
return _altitude;
}
/**
* Altitude of the position in meters.
*/
- (void) setAltitude: (double *) newAltitude
{
if (_altitude != NULL) {
free(_altitude);
}
_altitude = newAltitude;
}
/**
* Dilution of the precision (DOP) of the current GPS fix.
*/
- (double *) precision
{
return _precision;
}
/**
* Dilution of the precision (DOP) of the current GPS fix.
*/
- (void) setPrecision: (double *) newPrecision
{
if (_precision != NULL) {
free(_precision);
}
_precision = newPrecision;
}
/**
* Heading (direction) of the position in degrees
*/
- (double *) heading
{
return _heading;
}
/**
* Heading (direction) of the position in degrees
*/
- (void) setHeading: (double *) newHeading
{
if (_heading != NULL) {
free(_heading);
}
_heading = newHeading;
}
/**
* Speed for this position in meter/sec.
*/
- (double *) speed
{
return _speed;
}
/**
* Speed for this position in meter/sec.
*/
- (void) setSpeed: (double *) newSpeed
{
if (_speed != NULL) {
free(_speed);
}
_speed = newSpeed;
}
/**
* Timestamp extracted from the GPS system
*/
- (NSDate *) timestamp
{
return _timestamp;
}
/**
* Timestamp extracted from the GPS system
*/
- (void) setTimestamp: (NSDate *) newTimestamp
{
[newTimestamp retain];
[_timestamp release];
_timestamp = newTimestamp;
}
/**
* Number of satellites seen by the systems
*/
- (int *) satellites
{
return _satellites;
}
/**
* Number of satellites seen by the systems
*/
- (void) setSatellites: (int *) newSatellites
{
if (_satellites != NULL) {
free(_satellites);
}
_satellites = newSatellites;
}
/**
* Status of GPS system: 1 = no GPS response, 2 = error in response, 4 =
* valid.
*/
- (int *) status
{
return _status;
}
/**
* Status of GPS system: 1 = no GPS response, 2 = error in response, 4 =
* valid.
*/
- (void) setStatus: (int *) newStatus
{
if (_status != NULL) {
free(_status);
}
_status = newStatus;
}
- (void) dealloc
{
[self setLongitude: NULL];
[self setLatitude: NULL];
[self setAltitude: NULL];
[self setPrecision: NULL];
[self setHeading: NULL];
[self setSpeed: NULL];
[self setTimestamp: nil];
[self setSatellites: NULL];
[self setStatus: NULL];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcPosition *_eDC_APIS_CLIENTEDCEdcPosition;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcPosition = (EDC_APIS_CLIENTEDCEdcPosition *) [EDC_APIS_CLIENTEDCEdcPosition readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcPosition;
}
//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 EDC_APIS_CLIENTEDCEdcPosition */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcPosition (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcPosition (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcPosition (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcPosition from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcPosition defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcPosition *_eDC_APIS_CLIENTEDCEdcPosition = [[EDC_APIS_CLIENTEDCEdcPosition alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcPosition initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcPosition = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcPosition autorelease];
return _eDC_APIS_CLIENTEDCEdcPosition;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcPosition 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 EDC_APIS_CLIENTEDCEdcPosition 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 EDC_APIS_CLIENTEDCEdcPosition from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}position".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcPosition.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcPosition *_edcPosition = 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 {http://eurotech.com/edc/2.0}position."];
}
}
if (xmlStrcmp(BAD_CAST "position", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}position.");
#endif
_edcPosition = (EDC_APIS_CLIENTEDCEdcPosition *)[EDC_APIS_CLIENTEDCEdcPosition readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}position.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcPosition. Expected element {http://eurotech.com/edc/2.0}position. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcPosition. Expected element {http://eurotech.com/edc/2.0}position. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcPosition;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcPosition to XML under element name "{http://eurotech.com/edc/2.0}position".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcPosition The EdcPosition to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcPosition 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, BAD_CAST "edc", BAD_CAST "position", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}position. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}position...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}position'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}position...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcPosition for root element {http://eurotech.com/edc/2.0}position...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcPosition for root element {http://eurotech.com/edc/2.0}position...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}position. 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 "longitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setLongitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "latitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setLatitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "altitude", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setAltitude: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "precision", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setPrecision: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "heading", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setHeading: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "speed", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadDoubleType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setSpeed: ((double*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "timestamp", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}timestamp of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}timestamp of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setTimestamp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "satellites", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setSatellites: ((int*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setStatus: ((int*) _child_accessor)];
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if ([self longitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "longitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}longitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}longitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self longitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}longitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}longitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}longitude."];
}
}
if ([self latitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "latitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}latitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}latitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self latitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}latitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}latitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}latitude."];
}
}
if ([self altitude] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "altitude", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}altitude."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}altitude...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self altitude]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}altitude...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}altitude."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}altitude."];
}
}
if ([self precision] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "precision", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}precision."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}precision...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self precision]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}precision...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}precision."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}precision."];
}
}
if ([self heading] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "heading", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}heading."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}heading...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self heading]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}heading...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}heading."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}heading."];
}
}
if ([self speed] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "speed", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}speed."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}speed...");
#endif
status = xmlTextWriterWriteDoubleType(writer, [self speed]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}speed...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}speed."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}speed."];
}
}
if ([self timestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "timestamp", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}timestamp."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}timestamp...");
#endif
[[self timestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}timestamp...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}timestamp."];
}
}
if ([self satellites] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "satellites", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}satellites."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}satellites...");
#endif
status = xmlTextWriterWriteIntType(writer, [self satellites]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}satellites...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}satellites."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}satellites."];
}
}
if ([self status] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "status", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}status."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}status...");
#endif
status = xmlTextWriterWriteIntType(writer, [self status]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}status...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}status."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}status."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcPosition (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcPosition_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcMessage_M
#define DEF_EDC_APIS_CLIENTEDCEdcMessage_M
/**
* EdcMessage provides an abstraction over the messages sent in and out of the Everyware Cloud platform.
* It encapsulates all the information regarding the message: the topic it was addressed to, the timestamp
* when it was received by the platform, and the payload contained in the message.
* The payload can be represented by a raw binary array or by an EdcPayload object if it was formatted
* as such when the message was composed and sent. Refer to the EdcPayload documentation for more details on
* how EdcPayload are modelled and how they can be constructed.
* The EdcMessage class is used both by the messages/search API to return message results from the platform,
* as well as by messages/store and messages/publish API to send messages to the platform.
*
*/
@implementation EDC_APIS_CLIENTEDCEdcMessage
/**
* The topic to which this message is sent to.
* A generic Publishing topic can be represented as accountName/assetId/semanticTopic where:
*
* - accountName is the name of the Everyware Cloud account owner.
*
- assetId is a unique ID representing a particular asset (either the application or the sensors from which the data has been gathered).
*
- semanticTopic is the section of the topic used to further specify information about the device or data, using an hierarchical name space representation.
*
* System and control topic starts with the $EDC account and are represented as: $EDC/accountName/assetId/semanticTopic.
*/
- (NSString *) topic
{
return _topic;
}
/**
* The topic to which this message is sent to.
* A generic Publishing topic can be represented as accountName/assetId/semanticTopic where:
*
* - accountName is the name of the Everyware Cloud account owner.
*
- assetId is a unique ID representing a particular asset (either the application or the sensors from which the data has been gathered).
*
- semanticTopic is the section of the topic used to further specify information about the device or data, using an hierarchical name space representation.
*
* System and control topic starts with the $EDC account and are represented as: $EDC/accountName/assetId/semanticTopic.
*/
- (void) setTopic: (NSString *) newTopic
{
[newTopic retain];
[_topic release];
_topic = newTopic;
}
/**
* The timestamp when this message was received by the platform.
* This timestamp has to be distinguished from the timestamp when the message was sent to the platform, which applications can capture in the EdcPayload timestamp field.
* In the case of the REST API messages/store and messages/publish, the value provided in this field is ignored and a server-side timestamp will be used.
*/
- (NSDate *) timestamp
{
return _timestamp;
}
/**
* The timestamp when this message was received by the platform.
* This timestamp has to be distinguished from the timestamp when the message was sent to the platform, which applications can capture in the EdcPayload timestamp field.
* In the case of the REST API messages/store and messages/publish, the value provided in this field is ignored and a server-side timestamp will be used.
*/
- (void) setTimestamp: (NSDate *) newTimestamp
{
[newTimestamp retain];
[_timestamp release];
_timestamp = newTimestamp;
}
/**
* The payload of this message as EdcPayload object.
*/
- (EDC_APIS_CLIENTEDCEdcPayload *) edcPayload
{
return _edcPayload;
}
/**
* The payload of this message as EdcPayload object.
*/
- (void) setEdcPayload: (EDC_APIS_CLIENTEDCEdcPayload *) newEdcPayload
{
[newEdcPayload retain];
[_edcPayload release];
_edcPayload = newEdcPayload;
}
/**
* The uuid of the published message.
*/
- (NSString *) uuid
{
return _uuid;
}
/**
* The uuid of the published message.
*/
- (void) setUuid: (NSString *) newUuid
{
[newUuid retain];
[_uuid release];
_uuid = newUuid;
}
- (void) dealloc
{
[self setTopic: nil];
[self setTimestamp: nil];
[self setEdcPayload: nil];
[self setUuid: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcMessage *_eDC_APIS_CLIENTEDCEdcMessage;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcMessage = (EDC_APIS_CLIENTEDCEdcMessage *) [EDC_APIS_CLIENTEDCEdcMessage readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcMessage;
}
//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 EDC_APIS_CLIENTEDCEdcMessage */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcMessage (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcMessage (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcMessage (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcMessage from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcMessage defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcMessage *_eDC_APIS_CLIENTEDCEdcMessage = [[EDC_APIS_CLIENTEDCEdcMessage alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcMessage initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcMessage = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcMessage autorelease];
return _eDC_APIS_CLIENTEDCEdcMessage;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcMessage 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 EDC_APIS_CLIENTEDCEdcMessage 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 EDC_APIS_CLIENTEDCEdcMessage from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}message".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcMessage.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcMessage *_edcMessage = 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 {http://eurotech.com/edc/2.0}message."];
}
}
if (xmlStrcmp(BAD_CAST "message", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}message.");
#endif
_edcMessage = (EDC_APIS_CLIENTEDCEdcMessage *)[EDC_APIS_CLIENTEDCEdcMessage readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}message.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMessage. Expected element {http://eurotech.com/edc/2.0}message. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcMessage. Expected element {http://eurotech.com/edc/2.0}message. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcMessage;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMessage to XML under element name "{http://eurotech.com/edc/2.0}message".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcMessage The EdcMessage to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcMessage 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, BAD_CAST "edc", BAD_CAST "message", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}message. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}message...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}message'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}message...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcMessage for root element {http://eurotech.com/edc/2.0}message...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcMessage for root element {http://eurotech.com/edc/2.0}message...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}message. 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 "topic", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}topic of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}topic of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setTopic: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "receivedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}receivedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}receivedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setTimestamp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "payload", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}payload of type {http://eurotech.com/edc/2.0}edcPayload.");
#endif
__child = [EDC_APIS_CLIENTEDCEdcPayload readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}payload of type {http://eurotech.com/edc/2.0}edcPayload.");
#endif
[self setEdcPayload: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "uuid", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}uuid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}uuid of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setUuid: __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 topic]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "topic", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}topic."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}topic...");
#endif
[[self topic] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}topic...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}topic."];
}
}
if ([self timestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "receivedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}receivedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}receivedOn...");
#endif
[[self timestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}receivedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}receivedOn."];
}
}
if ([self edcPayload]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "payload", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}payload."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}payload...");
#endif
[[self edcPayload] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}payload...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}payload."];
}
}
if ([self uuid]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "uuid", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}uuid."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}uuid...");
#endif
[[self uuid] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}uuid...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}uuid."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcMessage (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcMessage_M */
#ifndef DEF_EDC_APIS_CLIENTEDCXmlMapAdaptedMap_M
#define DEF_EDC_APIS_CLIENTEDCXmlMapAdaptedMap_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCXmlMapAdaptedMap
/**
* (no documentation provided)
*/
- (NSArray *) entry
{
return _entry;
}
/**
* (no documentation provided)
*/
- (void) setEntry: (NSArray *) newEntry
{
[newEntry retain];
[_entry release];
_entry = newEntry;
}
- (void) dealloc
{
[self setEntry: nil];
[super dealloc];
}
@end /* implementation EDC_APIS_CLIENTEDCXmlMapAdaptedMap */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCXmlMapAdaptedMap (JAXB)
@end /*interface EDC_APIS_CLIENTEDCXmlMapAdaptedMap (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCXmlMapAdaptedMap (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCXmlMapAdaptedMap from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCXmlMapAdaptedMap defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCXmlMapAdaptedMap *_eDC_APIS_CLIENTEDCXmlMapAdaptedMap = [[EDC_APIS_CLIENTEDCXmlMapAdaptedMap alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCXmlMapAdaptedMap initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCXmlMapAdaptedMap = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCXmlMapAdaptedMap autorelease];
return _eDC_APIS_CLIENTEDCXmlMapAdaptedMap;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCXmlMapAdaptedMap 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 EDC_APIS_CLIENTEDCXmlMapAdaptedMap 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 "entry", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}entry of type {http://eurotech.com/edc/2.0}xmlMapAdapterKeyValue.");
#endif
__child = [EDC_APIS_CLIENTEDCXmlMapAdapterKeyValue readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}entry of type {http://eurotech.com/edc/2.0}xmlMapAdapterKeyValue.");
#endif
if ([self entry]) {
[self setEntry: [[self entry] arrayByAddingObject: __child]];
}
else {
[self setEntry: [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 entry]) {
__enumerator = [[self entry] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "entry", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}entry."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}entry...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}entry...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}entry."];
}
} //end item iterator.
}
}
@end /* implementation EDC_APIS_CLIENTEDCXmlMapAdaptedMap (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCXmlMapAdaptedMap_M */
#ifndef DEF_EDC_APIS_CLIENTEDCRuleActionInfo_M
#define DEF_EDC_APIS_CLIENTEDCRuleActionInfo_M
/**
* This class describes a rule action in the system.
*/
@implementation EDC_APIS_CLIENTEDCRuleActionInfo
/**
* (no documentation provided)
*/
- (NSString *) m_name
{
return _m_name;
}
/**
* (no documentation provided)
*/
- (void) setM_name: (NSString *) newM_name
{
[newM_name retain];
[_m_name release];
_m_name = newM_name;
}
/**
* (no documentation provided)
*/
- (NSArray *) m_parameterInfos
{
return _m_parameterInfos;
}
/**
* (no documentation provided)
*/
- (void) setM_parameterInfos: (NSArray *) newM_parameterInfos
{
[newM_parameterInfos retain];
[_m_parameterInfos release];
_m_parameterInfos = newM_parameterInfos;
}
- (void) dealloc
{
[self setM_name: nil];
[self setM_parameterInfos: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCRuleActionInfo *_eDC_APIS_CLIENTEDCRuleActionInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCRuleActionInfo = (EDC_APIS_CLIENTEDCRuleActionInfo *) [EDC_APIS_CLIENTEDCRuleActionInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCRuleActionInfo;
}
//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 EDC_APIS_CLIENTEDCRuleActionInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCRuleActionInfo (JAXB)
@end /*interface EDC_APIS_CLIENTEDCRuleActionInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCRuleActionInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCRuleActionInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCRuleActionInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCRuleActionInfo *_eDC_APIS_CLIENTEDCRuleActionInfo = [[EDC_APIS_CLIENTEDCRuleActionInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCRuleActionInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCRuleActionInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCRuleActionInfo autorelease];
return _eDC_APIS_CLIENTEDCRuleActionInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCRuleActionInfo 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 EDC_APIS_CLIENTEDCRuleActionInfo 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 EDC_APIS_CLIENTEDCRuleActionInfo from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}ruleActionInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCRuleActionInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCRuleActionInfo *_ruleActionInfo = 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 {http://eurotech.com/edc/2.0}ruleActionInfo."];
}
}
if (xmlStrcmp(BAD_CAST "ruleActionInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}ruleActionInfo.");
#endif
_ruleActionInfo = (EDC_APIS_CLIENTEDCRuleActionInfo *)[EDC_APIS_CLIENTEDCRuleActionInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}ruleActionInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRuleActionInfo. Expected element {http://eurotech.com/edc/2.0}ruleActionInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCRuleActionInfo. Expected element {http://eurotech.com/edc/2.0}ruleActionInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _ruleActionInfo;
}
/**
* Writes this EDC_APIS_CLIENTEDCRuleActionInfo to XML under element name "{http://eurotech.com/edc/2.0}ruleActionInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _ruleActionInfo The RuleActionInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCRuleActionInfo 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, BAD_CAST "edc", BAD_CAST "ruleActionInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}ruleActionInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}ruleActionInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}ruleActionInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}ruleActionInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}ruleActionInfo for root element {http://eurotech.com/edc/2.0}ruleActionInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}ruleActionInfo for root element {http://eurotech.com/edc/2.0}ruleActionInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}ruleActionInfo. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setM_name: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "parameterInfos", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/edc/2.0}parameterInfos...");
#endif
//start wrapper element "{http://eurotech.com/edc/2.0}parameterInfos"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "parameterInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}parameterInfo of type {http://eurotech.com/edc/2.0}parameterInfo.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[EDC_APIS_CLIENTEDCParameterInfo alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [EDC_APIS_CLIENTEDCParameterInfo readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}parameterInfo of type {http://eurotech.com/edc/2.0}parameterInfo.");
#endif
if ([self m_parameterInfos]) {
[self setM_parameterInfos: [[self m_parameterInfos] arrayByAddingObject: __child]];
}
else {
[self setM_parameterInfos: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/edc/2.0}parameterInfos...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setM_parameterInfos: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 m_name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self m_name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self m_parameterInfos]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "parameterInfos", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/edc/2.0}parameterInfos."];
}
__enumerator = [[self m_parameterInfos] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "parameterInfo", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}parameterInfo."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}parameterInfo."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/edc/2.0}parameterInfos."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCRuleActionInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCRuleActionInfo_M */
#ifndef DEF_EDC_APIS_CLIENTEDCParameterInfo_M
#define DEF_EDC_APIS_CLIENTEDCParameterInfo_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCParameterInfo
/**
* (no documentation provided)
*/
- (NSString *) m_name
{
return _m_name;
}
/**
* (no documentation provided)
*/
- (void) setM_name: (NSString *) newM_name
{
[newM_name retain];
[_m_name release];
_m_name = newM_name;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCParameterType *) m_type
{
return _m_type;
}
/**
* (no documentation provided)
*/
- (void) setM_type: (enum EDC_APIS_CLIENTEDCParameterType *) newM_type
{
if (_m_type != NULL) {
free(_m_type);
}
_m_type = newM_type;
}
/**
* (no documentation provided)
*/
- (NSString *) m_regex
{
return _m_regex;
}
/**
* (no documentation provided)
*/
- (void) setM_regex: (NSString *) newM_regex
{
[newM_regex retain];
[_m_regex release];
_m_regex = newM_regex;
}
/**
* (no documentation provided)
*/
- (BOOL) m_mandatory
{
return _m_mandatory;
}
/**
* (no documentation provided)
*/
- (void) setM_mandatory: (BOOL) newM_mandatory
{
_m_mandatory = newM_mandatory;
}
/**
* (no documentation provided)
*/
- (NSString *) m_default
{
return _m_default;
}
/**
* (no documentation provided)
*/
- (void) setM_default: (NSString *) newM_default
{
[newM_default retain];
[_m_default release];
_m_default = newM_default;
}
/**
* (no documentation provided)
*/
- (NSArray *) m_choices
{
return _m_choices;
}
/**
* (no documentation provided)
*/
- (void) setM_choices: (NSArray *) newM_choices
{
[newM_choices retain];
[_m_choices release];
_m_choices = newM_choices;
}
- (void) dealloc
{
[self setM_name: nil];
[self setM_type: NULL];
[self setM_regex: nil];
[self setM_default: nil];
[self setM_choices: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCParameterInfo *_eDC_APIS_CLIENTEDCParameterInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCParameterInfo = (EDC_APIS_CLIENTEDCParameterInfo *) [EDC_APIS_CLIENTEDCParameterInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCParameterInfo;
}
//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 EDC_APIS_CLIENTEDCParameterInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCParameterInfo (JAXB)
@end /*interface EDC_APIS_CLIENTEDCParameterInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCParameterInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCParameterInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCParameterInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCParameterInfo *_eDC_APIS_CLIENTEDCParameterInfo = [[EDC_APIS_CLIENTEDCParameterInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCParameterInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCParameterInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCParameterInfo autorelease];
return _eDC_APIS_CLIENTEDCParameterInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCParameterInfo 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 EDC_APIS_CLIENTEDCParameterInfo 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 EDC_APIS_CLIENTEDCParameterInfo from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}parameterInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCParameterInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCParameterInfo *_parameterInfo = 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 {http://eurotech.com/edc/2.0}parameterInfo."];
}
}
if (xmlStrcmp(BAD_CAST "parameterInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}parameterInfo.");
#endif
_parameterInfo = (EDC_APIS_CLIENTEDCParameterInfo *)[EDC_APIS_CLIENTEDCParameterInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}parameterInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCParameterInfo. Expected element {http://eurotech.com/edc/2.0}parameterInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCParameterInfo. Expected element {http://eurotech.com/edc/2.0}parameterInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _parameterInfo;
}
/**
* Writes this EDC_APIS_CLIENTEDCParameterInfo to XML under element name "{http://eurotech.com/edc/2.0}parameterInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _parameterInfo The ParameterInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCParameterInfo 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, BAD_CAST "edc", BAD_CAST "parameterInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}parameterInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}parameterInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}parameterInfo for root element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}parameterInfo for root element {http://eurotech.com/edc/2.0}parameterInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}parameterInfo. 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 "name", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}name of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setM_name: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "type", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCParameterTypeType(reader);
if (_child_accessor == NULL) {
//panic: unable to return the value for some reason.
[NSException raise: @"XMLReadError"
format: @"Error reading element value."];
}
[self setM_type: ((enum EDC_APIS_CLIENTEDCParameterType*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "regex", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}regex of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}regex of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setM_regex: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "mandatory", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setM_mandatory: *((BOOL*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "default", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}default of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}default of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setM_default: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "choices", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
if (xmlTextReaderIsEmptyElement(reader) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Unwrapping wrapper element {http://eurotech.com/edc/2.0}choices...");
#endif
//start wrapper element "{http://eurotech.com/edc/2.0}choices"
depth = xmlTextReaderDepth(reader);
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
while (xmlTextReaderDepth(reader) > depth) {
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to next wrapped child element."];
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "choice", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}choice of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if(xmlTextReaderIsEmptyElement(reader) != 0){
__child = [[NSString alloc] init];
xmlTextReaderAdvanceToNextStartOrEndElement(reader);
}else{
__child = [NSString readXMLType: reader];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}choice of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
if ([self m_choices]) {
[self setM_choices: [[self m_choices] arrayByAddingObject: __child]];
}
else {
[self setM_choices: [NSArray arrayWithObject: __child]];
}
continue; //continue "while in wrapper element" loop
} //end "if choice"
status = xmlTextReaderAdvanceToNextStartOrEndElement(reader);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully unwrapped wrapper element {http://eurotech.com/edc/2.0}choices...");
#endif
} // end "while in wrapper element" loop
if (status < 1) {
//panic: XML read error.
[NSException raise: @"XMLReadError"
format: @"Failure to advance to end wrapper element."];
}
} //end "if empty element" clause
else {
__child = [NSArray array];
[self setM_choices: (NSArray*) __child];
}
return YES;
} // end "if wrapper element" clause
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 m_name]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "name", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}name."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}name...");
#endif
[[self m_name] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}name...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}name."];
}
}
if ([self m_type] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "type", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}type."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}type...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCParameterTypeType(writer, [self m_type]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}type...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}type."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}type."];
}
}
if ([self m_regex]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "regex", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}regex."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}regex...");
#endif
[[self m_regex] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}regex...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}regex."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "mandatory", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}mandatory."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}mandatory...");
#endif
status = xmlTextWriterWriteBooleanType(writer, &_m_mandatory);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}mandatory...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}mandatory."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}mandatory."];
}
}
if ([self m_default]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "default", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}default."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}default...");
#endif
[[self m_default] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}default...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}default."];
}
}
if ([self m_choices]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "choices", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start wrapper element {http://eurotech.com/edc/2.0}choices."];
}
__enumerator = [[self m_choices] objectEnumerator];
while ( (__item = [__enumerator nextObject]) ) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "choice", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}choice."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}choice...");
#endif
[__item writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}choice...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}choice."];
}
} //end item iterator.
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end wrapper element {http://eurotech.com/edc/2.0}choices."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCParameterInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCParameterInfo_M */
#ifndef DEF_EDC_APIS_CLIENTEDCEdcTopicInfo_M
#define DEF_EDC_APIS_CLIENTEDCEdcTopicInfo_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCEdcTopicInfo
/**
* (no documentation provided)
*/
- (NSDate *) lastMessageTimestamp
{
return _lastMessageTimestamp;
}
/**
* (no documentation provided)
*/
- (void) setLastMessageTimestamp: (NSDate *) newLastMessageTimestamp
{
[newLastMessageTimestamp retain];
[_lastMessageTimestamp release];
_lastMessageTimestamp = newLastMessageTimestamp;
}
/**
* (no documentation provided)
*/
- (NSString *) fullTopic
{
return _fullTopic;
}
/**
* (no documentation provided)
*/
- (void) setFullTopic: (NSString *) newFullTopic
{
[newFullTopic retain];
[_fullTopic release];
_fullTopic = newFullTopic;
}
- (void) dealloc
{
[self setLastMessageTimestamp: nil];
[self setFullTopic: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCEdcTopicInfo *_eDC_APIS_CLIENTEDCEdcTopicInfo;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCEdcTopicInfo = (EDC_APIS_CLIENTEDCEdcTopicInfo *) [EDC_APIS_CLIENTEDCEdcTopicInfo readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCEdcTopicInfo;
}
//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 EDC_APIS_CLIENTEDCEdcTopicInfo */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCEdcTopicInfo (JAXB)
@end /*interface EDC_APIS_CLIENTEDCEdcTopicInfo (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCEdcTopicInfo (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCEdcTopicInfo from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCEdcTopicInfo defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCEdcTopicInfo *_eDC_APIS_CLIENTEDCEdcTopicInfo = [[EDC_APIS_CLIENTEDCEdcTopicInfo alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCEdcTopicInfo initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCEdcTopicInfo = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCEdcTopicInfo autorelease];
return _eDC_APIS_CLIENTEDCEdcTopicInfo;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCEdcTopicInfo 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 EDC_APIS_CLIENTEDCEdcTopicInfo 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 EDC_APIS_CLIENTEDCEdcTopicInfo from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}topicInfo".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCEdcTopicInfo.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCEdcTopicInfo *_edcTopicInfo = 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 {http://eurotech.com/edc/2.0}topicInfo."];
}
}
if (xmlStrcmp(BAD_CAST "topicInfo", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}topicInfo.");
#endif
_edcTopicInfo = (EDC_APIS_CLIENTEDCEdcTopicInfo *)[EDC_APIS_CLIENTEDCEdcTopicInfo readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}topicInfo.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcTopicInfo. Expected element {http://eurotech.com/edc/2.0}topicInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCEdcTopicInfo. Expected element {http://eurotech.com/edc/2.0}topicInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _edcTopicInfo;
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcTopicInfo to XML under element name "{http://eurotech.com/edc/2.0}topicInfo".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _edcTopicInfo The EdcTopicInfo to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCEdcTopicInfo 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, BAD_CAST "edc", BAD_CAST "topicInfo", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}topicInfo. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}topicInfo...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}topicInfo'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}topicInfo...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}edcTopicInfo for root element {http://eurotech.com/edc/2.0}topicInfo...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}edcTopicInfo for root element {http://eurotech.com/edc/2.0}topicInfo...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}topicInfo. 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 "lastMessageOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}lastMessageOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}lastMessageOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setLastMessageTimestamp: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "topic", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}topic of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}topic of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setFullTopic: __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 lastMessageTimestamp]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "lastMessageOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}lastMessageOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}lastMessageOn...");
#endif
[[self lastMessageTimestamp] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}lastMessageOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}lastMessageOn."];
}
}
if ([self fullTopic]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "topic", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}topic."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}topic...");
#endif
[[self fullTopic] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}topic...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}topic."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCEdcTopicInfo (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCEdcTopicInfo_M */
#ifndef DEF_EDC_APIS_CLIENTEDCProvisionJobStatus_M
#define DEF_EDC_APIS_CLIENTEDCProvisionJobStatus_M
/**
* Reads a ProvisionJobStatus from XML. The reader is assumed to be at the start element.
*
* @param reader The XML reader.
* @return The ProvisionJobStatus, or NULL if unable to be read.
*/
static enum EDC_APIS_CLIENTEDCProvisionJobStatus *xmlTextReaderReadEDC_APIS_CLIENTEDCProvisionJobStatusType(xmlTextReaderPtr reader)
{
xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader);
enum EDC_APIS_CLIENTEDCProvisionJobStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCProvisionJobStatus));
if (enumValue != NULL) {
if (xmlStrcmp(enumValue, BAD_CAST "CREATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CREATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "RUNNING") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_RUNNING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "SKIPPED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_SKIPPED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "APPS_INSTALLING") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "APPS_INSTALLED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONF_UPDATING") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "CONF_UPDATED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "FAILED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_FAILED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "ABANDONED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_ABANDONED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "COMPLETED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_COMPLETED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STOPPING") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPING;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STOPPED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPED;
free(enumValue);
return value;
}
if (xmlStrcmp(enumValue, BAD_CAST "STARTED") == 0) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STARTED;
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 _provisionJobStatus The string to format.
* @return The enum value or NULL on error.
*/
enum EDC_APIS_CLIENTEDCProvisionJobStatus *formatStringToEDC_APIS_CLIENTEDCProvisionJobStatusType(NSString *_provisionJobStatus)
{
enum EDC_APIS_CLIENTEDCProvisionJobStatus *value = calloc(1, sizeof(enum EDC_APIS_CLIENTEDCProvisionJobStatus));
if ([@"CREATED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CREATED;
}
else if ([@"RUNNING" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_RUNNING;
}
else if ([@"SKIPPED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_SKIPPED;
}
else if ([@"APPS_INSTALLING" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLING;
}
else if ([@"APPS_INSTALLED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLED;
}
else if ([@"CONF_UPDATING" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATING;
}
else if ([@"CONF_UPDATED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATED;
}
else if ([@"FAILED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_FAILED;
}
else if ([@"ABANDONED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_ABANDONED;
}
else if ([@"COMPLETED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_COMPLETED;
}
else if ([@"STOPPING" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPING;
}
else if ([@"STOPPED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPED;
}
else if ([@"STARTED" isEqualToString:_provisionJobStatus]) {
*value = EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STARTED;
}
else{
#if DEBUG_ENUNCIATE
NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", [_provisionJobStatus UTF8String]);
#endif
value = NULL;
}
return value;
}
/**
* Writes a ProvisionJobStatus to XML.
*
* @param writer The XML writer.
* @param _provisionJobStatus The ProvisionJobStatus to write.
* @return The bytes written (may be 0 in case of buffering) or -1 in case of error.
*/
static int xmlTextWriterWriteEDC_APIS_CLIENTEDCProvisionJobStatusType(xmlTextWriterPtr writer, enum EDC_APIS_CLIENTEDCProvisionJobStatus *_provisionJobStatus)
{
switch (*_provisionJobStatus) {
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CREATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CREATED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_RUNNING:
return xmlTextWriterWriteString(writer, BAD_CAST "RUNNING");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_SKIPPED:
return xmlTextWriterWriteString(writer, BAD_CAST "SKIPPED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLING:
return xmlTextWriterWriteString(writer, BAD_CAST "APPS_INSTALLING");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLED:
return xmlTextWriterWriteString(writer, BAD_CAST "APPS_INSTALLED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATING:
return xmlTextWriterWriteString(writer, BAD_CAST "CONF_UPDATING");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATED:
return xmlTextWriterWriteString(writer, BAD_CAST "CONF_UPDATED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_FAILED:
return xmlTextWriterWriteString(writer, BAD_CAST "FAILED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_ABANDONED:
return xmlTextWriterWriteString(writer, BAD_CAST "ABANDONED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_COMPLETED:
return xmlTextWriterWriteString(writer, BAD_CAST "COMPLETED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPING:
return xmlTextWriterWriteString(writer, BAD_CAST "STOPPING");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPED:
return xmlTextWriterWriteString(writer, BAD_CAST "STOPPED");
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STARTED:
return xmlTextWriterWriteString(writer, BAD_CAST "STARTED");
}
#if DEBUG_ENUNCIATE
NSLog(@"Unable to write enum value (no valid value found).");
#endif
return -1;
}
/**
* Utility method for getting the string value of ProvisionJobStatus.
*
* @param _provisionJobStatus The ProvisionJobStatus to format.
* @return The string value or NULL on error.
*/
static NSString *formatEDC_APIS_CLIENTEDCProvisionJobStatusTypeToString(enum EDC_APIS_CLIENTEDCProvisionJobStatus *_provisionJobStatus)
{
switch (*_provisionJobStatus) {
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CREATED:
return @"CREATED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_RUNNING:
return @"RUNNING";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_SKIPPED:
return @"SKIPPED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLING:
return @"APPS_INSTALLING";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_APPS_INSTALLED:
return @"APPS_INSTALLED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATING:
return @"CONF_UPDATING";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_CONF_UPDATED:
return @"CONF_UPDATED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_FAILED:
return @"FAILED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_ABANDONED:
return @"ABANDONED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_COMPLETED:
return @"COMPLETED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPING:
return @"STOPPING";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STOPPED:
return @"STOPPED";
case EDC_APIS_CLIENT_EDC_PROVISIONJOBSTATUS_STARTED:
return @"STARTED";
default:
return NULL;
}
return NULL;
}
#endif /* DEF_EDC_APIS_CLIENTEDCProvisionJobStatus_M */
#ifndef DEF_EDC_APIS_CLIENTEDCDeviceJobTarget_M
#define DEF_EDC_APIS_CLIENTEDCDeviceJobTarget_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCDeviceJobTarget
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (long long) jobId
{
return _jobId;
}
/**
* (no documentation provided)
*/
- (void) setJobId: (long long) newJobId
{
_jobId = newJobId;
}
/**
* (no documentation provided)
*/
- (NSString *) clientId
{
return _clientId;
}
/**
* (no documentation provided)
*/
- (void) setClientId: (NSString *) newClientId
{
[newClientId retain];
[_clientId release];
_clientId = newClientId;
}
/**
* (no documentation provided)
*/
- (NSDate *) createdOn
{
return _createdOn;
}
/**
* (no documentation provided)
*/
- (void) setCreatedOn: (NSDate *) newCreatedOn
{
[newCreatedOn retain];
[_createdOn release];
_createdOn = newCreatedOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) modifiedOn
{
return _modifiedOn;
}
/**
* (no documentation provided)
*/
- (void) setModifiedOn: (NSDate *) newModifiedOn
{
[newModifiedOn retain];
[_modifiedOn release];
_modifiedOn = newModifiedOn;
}
/**
* (no documentation provided)
*/
- (enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *) status
{
return _status;
}
/**
* (no documentation provided)
*/
- (void) setStatus: (enum EDC_APIS_CLIENTEDCDeviceJobTargetStatus *) newStatus
{
if (_status != NULL) {
free(_status);
}
_status = newStatus;
}
/**
* (no documentation provided)
*/
- (NSString *) statusMessage
{
return _statusMessage;
}
/**
* (no documentation provided)
*/
- (void) setStatusMessage: (NSString *) newStatusMessage
{
[newStatusMessage retain];
[_statusMessage release];
_statusMessage = newStatusMessage;
}
/**
* (no documentation provided)
*/
- (NSDate *) requestSentOn
{
return _requestSentOn;
}
/**
* (no documentation provided)
*/
- (void) setRequestSentOn: (NSDate *) newRequestSentOn
{
[newRequestSentOn retain];
[_requestSentOn release];
_requestSentOn = newRequestSentOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) requestRepliedOn
{
return _requestRepliedOn;
}
/**
* (no documentation provided)
*/
- (void) setRequestRepliedOn: (NSDate *) newRequestRepliedOn
{
[newRequestRepliedOn retain];
[_requestRepliedOn release];
_requestRepliedOn = newRequestRepliedOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) verificationStartedOn
{
return _verificationStartedOn;
}
/**
* (no documentation provided)
*/
- (void) setVerificationStartedOn: (NSDate *) newVerificationStartedOn
{
[newVerificationStartedOn retain];
[_verificationStartedOn release];
_verificationStartedOn = newVerificationStartedOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) verificationCompletedOn
{
return _verificationCompletedOn;
}
/**
* (no documentation provided)
*/
- (void) setVerificationCompletedOn: (NSDate *) newVerificationCompletedOn
{
[newVerificationCompletedOn retain];
[_verificationCompletedOn release];
_verificationCompletedOn = newVerificationCompletedOn;
}
/**
* (no documentation provided)
*/
- (NSDate *) lastUpdateOn
{
return _lastUpdateOn;
}
/**
* (no documentation provided)
*/
- (void) setLastUpdateOn: (NSDate *) newLastUpdateOn
{
[newLastUpdateOn retain];
[_lastUpdateOn release];
_lastUpdateOn = newLastUpdateOn;
}
/**
* (no documentation provided)
*/
- (int) progressPercentage
{
return _progressPercentage;
}
/**
* (no documentation provided)
*/
- (void) setProgressPercentage: (int) newProgressPercentage
{
_progressPercentage = newProgressPercentage;
}
- (void) dealloc
{
[self setClientId: nil];
[self setCreatedOn: nil];
[self setModifiedOn: nil];
[self setStatus: NULL];
[self setStatusMessage: nil];
[self setRequestSentOn: nil];
[self setRequestRepliedOn: nil];
[self setVerificationStartedOn: nil];
[self setVerificationCompletedOn: nil];
[self setLastUpdateOn: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCDeviceJobTarget *_eDC_APIS_CLIENTEDCDeviceJobTarget;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCDeviceJobTarget = (EDC_APIS_CLIENTEDCDeviceJobTarget *) [EDC_APIS_CLIENTEDCDeviceJobTarget readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCDeviceJobTarget;
}
//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 EDC_APIS_CLIENTEDCDeviceJobTarget */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCDeviceJobTarget (JAXB)
@end /*interface EDC_APIS_CLIENTEDCDeviceJobTarget (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCDeviceJobTarget (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCDeviceJobTarget from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCDeviceJobTarget defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCDeviceJobTarget *_eDC_APIS_CLIENTEDCDeviceJobTarget = [[EDC_APIS_CLIENTEDCDeviceJobTarget alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCDeviceJobTarget initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCDeviceJobTarget = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCDeviceJobTarget autorelease];
return _eDC_APIS_CLIENTEDCDeviceJobTarget;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCDeviceJobTarget 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 EDC_APIS_CLIENTEDCDeviceJobTarget 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 EDC_APIS_CLIENTEDCDeviceJobTarget from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}deviceJobTarget".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCDeviceJobTarget.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCDeviceJobTarget *_deviceJobTarget = 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 {http://eurotech.com/edc/2.0}deviceJobTarget."];
}
}
if (xmlStrcmp(BAD_CAST "deviceJobTarget", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}deviceJobTarget.");
#endif
_deviceJobTarget = (EDC_APIS_CLIENTEDCDeviceJobTarget *)[EDC_APIS_CLIENTEDCDeviceJobTarget readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}deviceJobTarget.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceJobTarget. Expected element {http://eurotech.com/edc/2.0}deviceJobTarget. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCDeviceJobTarget. Expected element {http://eurotech.com/edc/2.0}deviceJobTarget. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _deviceJobTarget;
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceJobTarget to XML under element name "{http://eurotech.com/edc/2.0}deviceJobTarget".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _deviceJobTarget The DeviceJobTarget to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCDeviceJobTarget 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, BAD_CAST "edc", BAD_CAST "deviceJobTarget", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}deviceJobTarget. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}deviceJobTarget...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}deviceJobTarget'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}deviceJobTarget...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}deviceJobTarget for root element {http://eurotech.com/edc/2.0}deviceJobTarget...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}deviceJobTarget for root element {http://eurotech.com/edc/2.0}deviceJobTarget...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}deviceJobTarget. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "jobId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setJobId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "clientId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}clientId of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setClientId: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "createdOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}createdOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}createdOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setCreatedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "modifiedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}modifiedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}modifiedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setModifiedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_child_accessor = xmlTextReaderReadEDC_APIS_CLIENTEDCDeviceJobTargetStatusType(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 EDC_APIS_CLIENTEDCDeviceJobTargetStatus*) _child_accessor)];
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "statusMessage", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}statusMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}statusMessage of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setStatusMessage: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "requestSentOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}requestSentOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}requestSentOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setRequestSentOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "requestRepliedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}requestRepliedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}requestRepliedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setRequestRepliedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "verificationStartedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}verificationStartedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}verificationStartedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setVerificationStartedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "verificationCompletedOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}verificationCompletedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}verificationCompletedOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setVerificationCompletedOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "lastUpdateOn", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}lastUpdateOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
__child = [NSDate readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}lastUpdateOn of type {http://www.w3.org/2001/XMLSchema}dateTime.");
#endif
[self setLastUpdateOn: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "progressPercentage", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setProgressPercentage: *((int*) _child_accessor)];
free(_child_accessor);
return YES;
}
return NO;
}
//documentation inherited.
- (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader
{
return [super readUnknownJAXBChildElement: reader];
}
//documentation inherited.
- (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader
{
[super readUnknownJAXBAttribute: reader];
}
//documentation inherited.
- (void) writeJAXBAttributes: (xmlTextWriterPtr) writer
{
int status;
[super writeJAXBAttributes: writer];
}
//documentation inherited.
- (void) writeJAXBValue: (xmlTextWriterPtr) writer
{
[super writeJAXBValue: writer];
}
/**
* Method for writing the child elements.
*
* @param writer The writer.
*/
- (void) writeJAXBChildElements: (xmlTextWriterPtr) writer
{
int status;
id __item;
id __item_copy;
NSEnumerator *__enumerator;
[super writeJAXBChildElements: writer];
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "jobId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}jobId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}jobId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_jobId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}jobId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}jobId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}jobId."];
}
}
if ([self clientId]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "clientId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}clientId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}clientId...");
#endif
[[self clientId] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}clientId...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}clientId."];
}
}
if ([self createdOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "createdOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}createdOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}createdOn...");
#endif
[[self createdOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}createdOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}createdOn."];
}
}
if ([self modifiedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "modifiedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}modifiedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}modifiedOn...");
#endif
[[self modifiedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}modifiedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}modifiedOn."];
}
}
if ([self status] != NULL) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "status", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}status."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}status...");
#endif
status = xmlTextWriterWriteEDC_APIS_CLIENTEDCDeviceJobTargetStatusType(writer, [self status]);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}status...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}status."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}status."];
}
}
if ([self statusMessage]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "statusMessage", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}statusMessage."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}statusMessage...");
#endif
[[self statusMessage] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}statusMessage...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}statusMessage."];
}
}
if ([self requestSentOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "requestSentOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}requestSentOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}requestSentOn...");
#endif
[[self requestSentOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}requestSentOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}requestSentOn."];
}
}
if ([self requestRepliedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "requestRepliedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}requestRepliedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}requestRepliedOn...");
#endif
[[self requestRepliedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}requestRepliedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}requestRepliedOn."];
}
}
if ([self verificationStartedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "verificationStartedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}verificationStartedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}verificationStartedOn...");
#endif
[[self verificationStartedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}verificationStartedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}verificationStartedOn."];
}
}
if ([self verificationCompletedOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "verificationCompletedOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}verificationCompletedOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}verificationCompletedOn...");
#endif
[[self verificationCompletedOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}verificationCompletedOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}verificationCompletedOn."];
}
}
if ([self lastUpdateOn]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "lastUpdateOn", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}lastUpdateOn."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}lastUpdateOn...");
#endif
[[self lastUpdateOn] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}lastUpdateOn...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}lastUpdateOn."];
}
}
if (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "progressPercentage", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}progressPercentage."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}progressPercentage...");
#endif
status = xmlTextWriterWriteIntType(writer, &_progressPercentage);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}progressPercentage...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}progressPercentage."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}progressPercentage."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCDeviceJobTarget (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCDeviceJobTarget_M */
#ifndef DEF_EDC_APIS_CLIENTEDCUserCreator_M
#define DEF_EDC_APIS_CLIENTEDCUserCreator_M
/**
* UserCreator encapsulates all the information needed to create a new User in the system.
*/
@implementation EDC_APIS_CLIENTEDCUserCreator
/**
* (no documentation provided)
*/
- (long long) accountId
{
return _accountId;
}
/**
* (no documentation provided)
*/
- (void) setAccountId: (long long) newAccountId
{
_accountId = newAccountId;
}
/**
* (no documentation provided)
*/
- (NSString *) username
{
return _username;
}
/**
* (no documentation provided)
*/
- (void) setUsername: (NSString *) newUsername
{
[newUsername retain];
[_username release];
_username = newUsername;
}
/**
* (no documentation provided)
*/
- (NSString *) password
{
return _password;
}
/**
* (no documentation provided)
*/
- (void) setPassword: (NSString *) newPassword
{
[newPassword retain];
[_password release];
_password = newPassword;
}
/**
* (no documentation provided)
*/
- (NSString *) displayName
{
return _displayName;
}
/**
* (no documentation provided)
*/
- (void) setDisplayName: (NSString *) newDisplayName
{
[newDisplayName retain];
[_displayName release];
_displayName = newDisplayName;
}
/**
* (no documentation provided)
*/
- (NSString *) email
{
return _email;
}
/**
* (no documentation provided)
*/
- (void) setEmail: (NSString *) newEmail
{
[newEmail retain];
[_email release];
_email = newEmail;
}
/**
* (no documentation provided)
*/
- (NSString *) phoneNumber
{
return _phoneNumber;
}
/**
* (no documentation provided)
*/
- (void) setPhoneNumber: (NSString *) newPhoneNumber
{
[newPhoneNumber retain];
[_phoneNumber release];
_phoneNumber = newPhoneNumber;
}
- (void) dealloc
{
[self setUsername: nil];
[self setPassword: nil];
[self setDisplayName: nil];
[self setEmail: nil];
[self setPhoneNumber: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCUserCreator *_eDC_APIS_CLIENTEDCUserCreator;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCUserCreator = (EDC_APIS_CLIENTEDCUserCreator *) [EDC_APIS_CLIENTEDCUserCreator readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCUserCreator;
}
//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 EDC_APIS_CLIENTEDCUserCreator */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCUserCreator (JAXB)
@end /*interface EDC_APIS_CLIENTEDCUserCreator (JAXB)*/
/**
* Internal, private implementation for JAXB reading and writing.
*/
@implementation EDC_APIS_CLIENTEDCUserCreator (JAXB)
/**
* Read an instance of EDC_APIS_CLIENTEDCUserCreator from an XML reader.
*
* @param reader The reader.
* @return An instance of EDC_APIS_CLIENTEDCUserCreator defined by the XML reader.
*/
+ (id) readXMLType: (xmlTextReaderPtr) reader
{
EDC_APIS_CLIENTEDCUserCreator *_eDC_APIS_CLIENTEDCUserCreator = [[EDC_APIS_CLIENTEDCUserCreator alloc] init];
NS_DURING
{
[_eDC_APIS_CLIENTEDCUserCreator initWithReader: reader];
}
NS_HANDLER
{
_eDC_APIS_CLIENTEDCUserCreator = nil;
[localException raise];
}
NS_ENDHANDLER
[_eDC_APIS_CLIENTEDCUserCreator autorelease];
return _eDC_APIS_CLIENTEDCUserCreator;
}
/**
* Initialize this instance of EDC_APIS_CLIENTEDCUserCreator 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 EDC_APIS_CLIENTEDCUserCreator 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 EDC_APIS_CLIENTEDCUserCreator from an XML reader. The element to be read is
* "{http://eurotech.com/edc/2.0}userCreator".
*
* @param reader The XML reader.
* @return The EDC_APIS_CLIENTEDCUserCreator.
*/
+ (id) readXMLElement: (xmlTextReaderPtr) reader {
int status;
EDC_APIS_CLIENTEDCUserCreator *_userCreator = 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 {http://eurotech.com/edc/2.0}userCreator."];
}
}
if (xmlStrcmp(BAD_CAST "userCreator", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read root element {http://eurotech.com/edc/2.0}userCreator.");
#endif
_userCreator = (EDC_APIS_CLIENTEDCUserCreator *)[EDC_APIS_CLIENTEDCUserCreator readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"Successfully read root element {http://eurotech.com/edc/2.0}userCreator.");
#endif
}
else {
if (xmlTextReaderConstNamespaceUri(reader) == NULL) {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCUserCreator. Expected element {http://eurotech.com/edc/2.0}userCreator. Current element: {}%s", xmlTextReaderConstLocalName(reader)];
}
else {
[NSException raise: @"XMLReadError"
format: @"Unable to read EDC_APIS_CLIENTEDCUserCreator. Expected element {http://eurotech.com/edc/2.0}userCreator. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)];
}
}
return _userCreator;
}
/**
* Writes this EDC_APIS_CLIENTEDCUserCreator to XML under element name "{http://eurotech.com/edc/2.0}userCreator".
* The namespace declarations for the element will be written.
*
* @param writer The XML writer.
* @param _userCreator The UserCreator to write.
* @return 1 if successful, 0 otherwise.
*/
- (void) writeXMLElement: (xmlTextWriterPtr) writer
{
[self writeXMLElement: writer writeNamespaces: YES];
}
/**
* Writes this EDC_APIS_CLIENTEDCUserCreator 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, BAD_CAST "edc", BAD_CAST "userCreator", NULL);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start element {http://eurotech.com/edc/2.0}userCreator. XML writer status: %i\n", rc];
}
if (writeNs) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing namespaces for start element {http://eurotech.com/edc/2.0}userCreator...");
#endif
rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:edc", BAD_CAST "http://eurotech.com/edc/2.0");
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing attribute 'xmlns:edc' on '{http://eurotech.com/edc/2.0}userCreator'. XML writer status: %i\n", rc];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote namespaces for start element {http://eurotech.com/edc/2.0}userCreator...");
#endif
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing type {http://eurotech.com/edc/2.0}userCreator for root element {http://eurotech.com/edc/2.0}userCreator...");
#endif
[self writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote type {http://eurotech.com/edc/2.0}userCreator for root element {http://eurotech.com/edc/2.0}userCreator...");
#endif
rc = xmlTextWriterEndElement(writer);
if (rc < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end element {http://eurotech.com/edc/2.0}userCreator. 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 "accountId", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
_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 setAccountId: *((long long*) _child_accessor)];
free(_child_accessor);
return YES;
}
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "username", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}username of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}username of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setUsername: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "password", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}password of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}password of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPassword: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "displayName", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}displayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}displayName of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setDisplayName: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "email", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}email of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}email of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setEmail: __child];
return YES;
} //end "if choice"
if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT
&& xmlStrcmp(BAD_CAST "phoneNumber", xmlTextReaderConstLocalName(reader)) == 0
&& xmlStrcmp(BAD_CAST "http://eurotech.com/edc/2.0", xmlTextReaderConstNamespaceUri(reader)) == 0) {
#if DEBUG_ENUNCIATE > 1
NSLog(@"Attempting to read choice {http://eurotech.com/edc/2.0}phoneNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
__child = [NSString readXMLType: reader];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully read choice {http://eurotech.com/edc/2.0}phoneNumber of type {http://www.w3.org/2001/XMLSchema}string.");
#endif
[self setPhoneNumber: __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 (YES) { //always write the primitive element...
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "accountId", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}accountId."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}accountId...");
#endif
status = xmlTextWriterWriteLongType(writer, &_accountId);
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}accountId...");
#endif
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing child element {http://eurotech.com/edc/2.0}accountId."];
}
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}accountId."];
}
}
if ([self username]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "username", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}username."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}username...");
#endif
[[self username] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}username...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}username."];
}
}
if ([self password]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "password", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}password."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}password...");
#endif
[[self password] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}password...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}password."];
}
}
if ([self displayName]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "displayName", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}displayName."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}displayName...");
#endif
[[self displayName] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}displayName...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}displayName."];
}
}
if ([self email]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "email", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}email."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}email...");
#endif
[[self email] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}email...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}email."];
}
}
if ([self phoneNumber]) {
status = xmlTextWriterStartElementNS(writer, BAD_CAST "edc", BAD_CAST "phoneNumber", NULL);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing start child element {http://eurotech.com/edc/2.0}phoneNumber."];
}
#if DEBUG_ENUNCIATE > 1
NSLog(@"writing element {http://eurotech.com/edc/2.0}phoneNumber...");
#endif
[[self phoneNumber] writeXMLType: writer];
#if DEBUG_ENUNCIATE > 1
NSLog(@"successfully wrote element {http://eurotech.com/edc/2.0}phoneNumber...");
#endif
status = xmlTextWriterEndElement(writer);
if (status < 0) {
[NSException raise: @"XMLWriteError"
format: @"Error writing end child element {http://eurotech.com/edc/2.0}phoneNumber."];
}
}
}
@end /* implementation EDC_APIS_CLIENTEDCUserCreator (JAXB) */
#endif /* DEF_EDC_APIS_CLIENTEDCUserCreator_M */
#ifndef DEF_EDC_APIS_CLIENTEDCRuleActionConfiguration_M
#define DEF_EDC_APIS_CLIENTEDCRuleActionConfiguration_M
/**
* (no documentation provided)
*/
@implementation EDC_APIS_CLIENTEDCRuleActionConfiguration
/**
* (no documentation provided)
*/
- (NSString *) ruleActionInfoName
{
return _ruleActionInfoName;
}
/**
* (no documentation provided)
*/
- (void) setRuleActionInfoName: (NSString *) newRuleActionInfoName
{
[newRuleActionInfoName retain];
[_ruleActionInfoName release];
_ruleActionInfoName = newRuleActionInfoName;
}
/**
* (no documentation provided)
*/
- (EDC_APIS_CLIENTEDCParametersMapType *) parameterValues
{
return _parameterValues;
}
/**
* (no documentation provided)
*/
- (void) setParameterValues: (EDC_APIS_CLIENTEDCParametersMapType *) newParameterValues
{
[newParameterValues retain];
[_parameterValues release];
_parameterValues = newParameterValues;
}
- (void) dealloc
{
[self setRuleActionInfoName: nil];
[self setParameterValues: nil];
[super dealloc];
}
//documentation inherited.
+ (id) readFromXML: (NSData *) xml
{
EDC_APIS_CLIENTEDCRuleActionConfiguration *_eDC_APIS_CLIENTEDCRuleActionConfiguration;
xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0);
if (reader == NULL) {
[NSException raise: @"XMLReadError"
format: @"Error instantiating an XML reader."];
return nil;
}
_eDC_APIS_CLIENTEDCRuleActionConfiguration = (EDC_APIS_CLIENTEDCRuleActionConfiguration *) [EDC_APIS_CLIENTEDCRuleActionConfiguration readXMLElement: reader];
xmlFreeTextReader(reader); //free the reader
return _eDC_APIS_CLIENTEDCRuleActionConfiguration;
}
//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 EDC_APIS_CLIENTEDCRuleActionConfiguration */
/**
* Internal, private interface for JAXB reading and writing.
*/
@interface EDC_APIS_CLIENTEDCRuleActionConfiguration (JAXB)