class ExcelFieldImportService {

    public static FieldTypeImport getFieldType(final Field field) {
        FieldTypeImport fieldType;

        if (fieldsTypeCache.get(field) != null) {
            fieldType = fieldsTypeCache.get(field);
        } else {
            fieldType = FieldTypeImport.basic;        // default field type
            final Class fieldClass = ExcelFieldService.getFieldClass(field);

            // first we check if we have a basic type
            if (FieldType.BASICTYPES.contains(fieldClass) || fieldClass.isEnum()) {
                fieldType = FieldTypeImport.basic;
            } else {
                final ExcelImport excelImport = field.getAnnotation(ExcelImport.class);
                if (excelImport != null) {
                    fieldType = FieldTypeImport.object;

                    // check if we need to read and import the object from the database.
                    if (!excelImport.importByProp().isEmpty()) {
                        fieldType = FieldTypeImport.objectImportByProp;
                    }
                }
            }

            fieldsTypeCache.put(field, fieldType);
        }

        return fieldType;
    }

    private  ExcelFieldImportService();

}