AnnotationHelper { public Class<?> getFieldTypeForProperty(final Class<?> clazz, final String propertyName) throws ODataAnnotationException { if (clazz == null) { return null; } Field field = getFieldForPropertyName(propertyName, clazz, true); if (field == null) { throw new ODataAnnotationException("No field for property '" + propertyName + "' found at class '" + clazz + "'."); } return field.getType(); }  boolean keyMatch(final Object firstInstance, final Object secondInstance); boolean keyMatch(final Object instance, final Map<String, Object> keyName2Value); String extractEntityTypeName(final EdmNavigationProperty enp, final Class<?> fallbackClass); String extractEntityTypeName(final EdmNavigationProperty enp, final Field field); String extractEntityTypeName(final Class<?> annotatedClass); String extractEntitySetName(final Class<?> annotatedClass); FullQualifiedName extractEntityTypeFqn(final EdmEntityType type, final Class<?> annotatedClass); FullQualifiedName extractEntityTypeFqn(final Class<?> annotatedClass); FullQualifiedName extractComplexTypeFqn(final Class<?> annotatedClass); FullQualifiedName extractComplexTypeFqn(final EdmComplexType type, final Class<?> annotatedClass); String extractComplexTypeName(final Class<?> annotatedClass); String generateNamespace(final Class<?> annotatedClass); String getPropertyNameFromAnnotation(final Field field); String getPropertyName(final Field field); String extractToRoleName(final EdmNavigationProperty enp, final Field field); String extractFromRoleEntityName(final Field field); String extractToRoleEntityName(final EdmNavigationProperty enp, final Field field); String getCanonicalRoleName(String name); String extractRelationshipName(final EdmNavigationProperty enp, final Field field); String createCanonicalRelationshipName(String fromRole, String toRole); EdmMultiplicity extractMultiplicity(final EdmNavigationProperty enp, final Field field); T setKeyFields(final T instance, final Map<String, Object> keys); AnnotatedNavInfo getCommonNavigationInfo(final Class<?> sourceClass, final Class<?> targetClass); Class<?> getFieldTypeForProperty(final Class<?> clazz, final String propertyName); Class<?> getFieldTypeForProperty(final Object instance, final String propertyName); Object getValueForProperty(final Object instance, final String propertyName); void setValueForProperty(final Object instance, final String propertyName, final Object propertyValue); Object getValueForField(final Object instance, final String fieldName,
      final Class<? extends Annotation> annotation); Object getValueForField(final Object instance, final Class<? extends Annotation> annotation); Map<String, Object> getValueForAnnotatedFields(final Object instance,
      final Class<? extends Annotation> annotation); String extractFunctionImportName(final Method annotatedMethod); ArrayList<FunctionImportParameter> extractFunctionImportParameters(final Method method); ReturnType extractReturnType(final Method annotatedMethod); String extractEntitySetName(final Method annotatedMethod); String extractHttpMethod(final Method annotatedMethod); void setValueForAnnotatedField(final Object instance, final Class<? extends Annotation> annotation,
      final Object value); void setValuesToAnnotatedFields(final Object instance,
      final Class<? extends Annotation> annotation, final Map<String, Object> fieldName2Value); List<Field> getAnnotatedFields(final Object instance, final Class<? extends Annotation> annotation); List<Field> getAnnotatedFields(final Class<?> fieldClass, final Class<? extends Annotation> annotation); List<Method> getAnnotatedMethods(final Class<?> resultClass,
                                           final Class<? extends Annotation> annotation,
                                           final boolean inherited); boolean isEdmAnnotated(final Object object); boolean isEdmTypeAnnotated(final Class<?> clazz); boolean isEdmAnnotated(final Class<?> clazz); boolean hasEdmFunction(final Class<?> clazz); String getCanonicalName(final Field field); String getCanonicalName(final Class<?> clazz); EdmSimpleTypeKind mapTypeKind(final org.apache.olingo.odata2.api.annotation.edm.EdmType type); EdmType mapType(final Class<?> type); EdmMultiplicity mapMultiplicity(final Multiplicity multiplicity); String getCanonicalNamespace(final Class<?> aClass); String extractContainerName(final Class<?> aClass); static final String DEFAULT_CONTAINER_NAME; }
@Test public void getFieldTypeForPropertyNullInstance() throws Exception { Object result = annotationHelper.getFieldTypeForProperty(null, ""); Assert.assertNull(result); }