class ExcelFieldService {

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

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

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

                    // if we just want to export a field (toString) we consider it a basic type.
                    if (excelExport.justExport()) {
                        fieldType = FieldType.basic;
                    }

                    // check if we want to export the object in a separate sheet
                    if (excelExport.separateSheet()) {
                        fieldType = FieldType.objectSeparateSheet;
                    }
                }
            }

            fieldsTypeCache.put(field, fieldType);
        }

        return fieldType;
    }

    private  ExcelFieldService();

}