op = OProperties.complex(name, (EdmComplexType) et, isNull ? null : Enumerable.create(parseProperties(reader, event.asStartElement(), metadata, est)).toList()); } else { op = OProperties.parseSimple(name, (EdmSimpleType<?>) et, isNull ? null : reader.getElementText());
op = OProperties.complex(name, (EdmComplexType) et, isNull ? null : Enumerable.create(parseProperties(reader, event.asStartElement(), metadata, est)).toList()); } else { op = OProperties.parseSimple(name, (EdmSimpleType<?>) et, isNull ? null : reader.getElementText());
private static OProperty<?> readCollection(String name, EdmCollectionType collectionType, XMLEventReader2 reader, StartElement2 collectionElement, EdmDataServices metadata, EdmStructuralType structuralType) { EdmType componentType = collectionType.getItemType(); OCollection.Builder<OObject> b = OCollections.newBuilder(componentType); while (reader.hasNext()) { XMLEvent2 event = reader.nextEvent(); if (event.isEndElement() && event.asEndElement().getName().equals(collectionElement.getName())) { break; } if (event.isStartElement() && event.asStartElement().getName().getNamespaceUri().equals(NS_DATASERVICES)) { OProperty<?> op = null; Attribute2 nullAttribute = event.asStartElement().getAttributeByName(M_NULL); boolean isNull = nullAttribute != null && "true".equals(nullAttribute.getValue()); if (!componentType.isSimple()) { EdmStructuralType est = (EdmStructuralType) componentType; op = OProperties.complex(name, (EdmComplexType) componentType, isNull ? null : Enumerable.create(parseProperties(reader, event.asStartElement(), metadata, est)).toList()); } else { op = OProperties.parseSimple(name, (EdmSimpleType<?>) componentType, isNull ? null : reader.getElementText()); } b.add(OSimpleObjects.create((EdmSimpleType<?>)componentType, op.getValue())); } } return OProperties.collection(name, collectionType, b.build()); }