@Test public void simplePropertyOnOpenReader() throws Exception { String simplePropertyJson = "{\"Name\":\"Team 1\"}"; JsonReader reader = prepareReader(simplePropertyJson); EdmProperty edmProperty = (EdmProperty) MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Teams").getEntityType() .getProperty("Name"); EntityPropertyInfo entityPropertyInfo = EntityInfoAggregator.create(edmProperty); reader.beginObject(); reader.nextName(); JsonPropertyDeserializer jpc = new JsonPropertyDeserializer(); Object value = jpc.readPropertyValue(reader, entityPropertyInfo, null, null); assertEquals("Team 1", value); }
protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo, final Object typeMapping, final DeserializerProperties readProperties) throws EntityProviderException { try { return entityPropertyInfo.isComplex() ? readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) : readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties); } catch (final EdmException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } catch (final IOException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }
JsonPropertyDeserializer { protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo, final Object typeMapping, final DeserializerProperties readProperties) throws EntityProviderException { try { return entityPropertyInfo.isComplex() ? readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) : readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties); } catch (final EdmException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } catch (final IOException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } } }
JsonPropertyDeserializer { protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo, final Object typeMapping, final DeserializerProperties readProperties) throws EntityProviderException { try { return entityPropertyInfo.isComplex() ? readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) : readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties); } catch (final EdmException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } catch (final IOException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  }
JsonPropertyDeserializer { protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo, final Object typeMapping, final DeserializerProperties readProperties) throws EntityProviderException { try { return entityPropertyInfo.isComplex() ? readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) : readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties); } catch (final EdmException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } catch (final IOException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final DeserializerProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final DeserializerProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final DeserializerProperties readProperties); }
JsonPropertyDeserializer { protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo, final Object typeMapping, final DeserializerProperties readProperties) throws EntityProviderException { try { return entityPropertyInfo.isComplex() ? readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) : readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties); } catch (final EdmException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } catch (final IOException e) { throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass() .getSimpleName()), e); } }  Map<String, Object> readPropertyStandalone(JsonReader reader, final EdmProperty edmProperty,
      final DeserializerProperties readProperties); Map<String, Object> readPropertyStandalone(final JsonReader reader, final EntityPropertyInfo propertyInfo,
      final DeserializerProperties readProperties); List<?> readCollection(JsonReader reader, final EntityPropertyInfo propertyInfo,
        final DeserializerProperties readProperties);  }