ReadServiceObjectsCollectionFromXmlWithNamespace<TServiceObject extends ServiceObject> method
Future<List<TServiceObject> >
ReadServiceObjectsCollectionFromXmlWithNamespace<TServiceObject extends ServiceObject>(
- XmlNamespace collectionXmlNamespace,
- String collectionXmlElementName,
- IGetObjectInstanceDelegate<
TServiceObject> getObjectInstanceDelegate, - bool clearPropertyBag,
- PropertySet? requestedPropertySet,
- bool summaryPropertiesOnly,
Implementation
Future<List<TServiceObject>> ReadServiceObjectsCollectionFromXmlWithNamespace<
TServiceObject extends ServiceObject
>(
XmlNamespace collectionXmlNamespace,
String collectionXmlElementName,
IGetObjectInstanceDelegate<TServiceObject> getObjectInstanceDelegate,
bool clearPropertyBag,
PropertySet? requestedPropertySet,
bool summaryPropertiesOnly,
) async {
List<TServiceObject> serviceObjects = <TServiceObject>[];
TServiceObject? serviceObject;
if (!IsStartElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
)) {
await ReadStartElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
);
}
if (!IsEmptyElement) {
do {
await Read();
if (IsStartElement()) {
serviceObject = getObjectInstanceDelegate(Service, LocalName);
if (LocalName != serviceObject.GetXmlElementName()) {
throw ServiceLocalException(
"The type of the object in the store ($LocalName) does not match that of the local object (${serviceObject.GetXmlElementName()}).",
);
}
await serviceObject.LoadFromXmlWithPropertySet(
this,
clearPropertyBag,
requestedPropertySet,
summaryPropertiesOnly,
);
serviceObjects.add(serviceObject);
}
} while (!IsEndElementWithNamespace(
collectionXmlNamespace,
collectionXmlElementName,
));
}
return serviceObjects;
}