@Test(expected = ODataNotImplementedException.class) public void setPropertyValueNotAnnotated() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); NotAnnotatedBean data = new NotAnnotatedBean(); EdmProperty property = mockProperty("Name"); Object value = "Another Name"; ava.setPropertyValue(data, property, value); }
@Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } }
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } } }
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } }  }
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } }  @Override Object getPropertyValue(final T data, final EdmProperty property); @Override void setPropertyValue(final T data, final EdmProperty property, final V value); @Override Class<?> getPropertyType(final T data, final EdmProperty property); @Override Object getMappingValue(final T data, final EdmMapping mapping); @Override void setMappingValue(final T data, final EdmMapping mapping, final V value); }
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } }  @Override Object getPropertyValue(final T data, final EdmProperty property); @Override void setPropertyValue(final T data, final EdmProperty property, final V value); @Override Class<?> getPropertyType(final T data, final EdmProperty property); @Override Object getMappingValue(final T data, final EdmMapping mapping); @Override void setMappingValue(final T data, final EdmMapping mapping, final V value);  }