@Test(expected = ODataNotImplementedException.class) public void getPropertyTypeNotAnnotated() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); NotAnnotatedBean data = new NotAnnotatedBean(); EdmProperty property = mockProperty("Name"); Class<?> type = ava.getPropertyType(data, property); Assert.assertEquals(String.class, type); }
@Override public <T> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); }
AnnotationValueAccess implements ValueAccess { @Override public <T> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } }
AnnotationValueAccess implements ValueAccess { @Override public <T> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); }  }
AnnotationValueAccess implements ValueAccess { @Override public <T> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } 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> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } 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);  }