@Test public void deepComplexPropertyStandalone() throws Exception { final String complexPropertyJson = "{\"d\":{\"Location\":{\"__metadata\":{\"type\":\"RefScenario.c_Location\"}," + "\"City\":{\"__metadata\":{\"type\":\"RefScenario.c_City\"},\"PostalCode\":\"69124\"," + "\"CityName\":\"Heidelberg\"},\"Country\":\"Germany\"}}}"; JsonReader reader = prepareReader(complexPropertyJson); EdmProperty edmProperty = (EdmProperty) MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Employees").getEntityType() .getProperty("Location"); JsonPropertyConsumer jpc = new JsonPropertyConsumer(); Map<String, Object> result = jpc.readPropertyStandalone(reader, edmProperty, null); assertEquals(1, result.size()); @SuppressWarnings("unchecked") Map<String, Object> locationResult = (Map<String, Object>) result.get("Location"); assertEquals(2, locationResult.size()); assertEquals("Germany", locationResult.get("Country")); @SuppressWarnings("unchecked") Map<String, Object> innerResult = (Map<String, Object>) locationResult.get("City"); assertEquals(2, innerResult.size()); assertEquals("Heidelberg", innerResult.get("CityName")); assertEquals("69124", innerResult.get("PostalCode")); }
public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); } }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final EntityProviderReadProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final EntityProviderReadProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final EntityProviderReadProperties readProperties); }
JsonPropertyConsumer { public Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty, final EntityProviderReadProperties readProperties) throws EntityProviderException { return readPropertyStandalone(reader, EntityInfoAggregator.create(edmProperty), readProperties); }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final EntityProviderReadProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final EntityProviderReadProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final EntityProviderReadProperties readProperties);  }