test_class.file: persistence/src/test/java/org/devgateway/toolkit/persistence/excel/ExcelFieldImportServiceTest.java
test_class.identifier: ExcelFieldImportServiceTest
test_case.body: @Test
      public void getFieldType() throws Exception {
          final ClassFields classFields = new ClassFieldsDefault(TestClass.class);
          final Iterator<Field> fields = classFields.getFields();
  
          final Field firstField = fields.next();      // get first element
          Assert.assertEquals("Check basic field type", FieldTypeImport.basic, ExcelFieldImportService.getFieldType(firstField));
  
          final Field thirdField = fields.next();      // get second element
          Assert.assertEquals("Check basic field type for Object", FieldTypeImport.object, ExcelFieldImportService.getFieldType(thirdField));
  
          final Field fourthField = fields.next();      // get third element
          Assert.assertEquals("Check importByProp field type Object", FieldTypeImport.objectImportByProp, ExcelFieldImportService.getFieldType(fourthField));
      }
test_case.class_method_signature: ExcelFieldImportServiceTest.getFieldType()
test_case.full_signature: @Test public void getFieldType()
test_case.identifier: getFieldType
test_case.invocations: getFields next assertEquals getFieldType next assertEquals getFieldType next assertEquals getFieldType
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getFieldType()
focal_class.declarator: logger = LoggerFactory.getLogger(ExcelFieldImportService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ExcelFieldImportService.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: fieldsTypeCache
focal_class.modifier: private static
focal_class.original_string: private static Map<Field, FieldTypeImport> fieldsTypeCache;
focal_class.type: Map<Field, FieldTypeImport>
focal_class.var_name: fieldsTypeCache
focal_class.declarator: fieldsCache
focal_class.modifier: private static
focal_class.original_string: private static Map<Class, List<Field>> fieldsCache;
focal_class.type: Map<Class, List<Field>>
focal_class.var_name: fieldsCache
focal_class.declarator: repositoryCache
focal_class.modifier: private static
focal_class.original_string: private static Map<String, BaseJpaRepository> repositoryCache;
focal_class.type: Map<String, BaseJpaRepository>
focal_class.var_name: repositoryCache
focal_class.declarator: repositoryValuesCache
focal_class.modifier: private static
focal_class.original_string: private static Map<String, Object> repositoryValuesCache;
focal_class.type: Map<String, Object>
focal_class.var_name: repositoryValuesCache
focal_class.declarator: repositoryMethodsCache
focal_class.modifier: private static
focal_class.original_string: private static Map<String, Method> repositoryMethodsCache;
focal_class.type: Map<String, Method>
focal_class.var_name: repositoryMethodsCache
focal_class.file: persistence/src/main/java/org/devgateway/toolkit/persistence/excel/ExcelFieldImportService.java
focal_class.identifier: ExcelFieldImportService
focal_class.class_method_signature: ExcelFieldImportService.ExcelFieldImportService()
focal_class.full_signature: private  ExcelFieldImportService()
focal_class.identifier: ExcelFieldImportService
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ExcelFieldImportService()
focal_class.class_method_signature: ExcelFieldImportService.getFieldType(final Field field)
focal_class.full_signature: public static FieldTypeImport getFieldType(final Field field)
focal_class.identifier: getFieldType
focal_class.modifiers: public static
focal_class.parameters: (final Field field)
focal_class.return: FieldTypeImport
focal_class.signature: FieldTypeImport getFieldType(final Field field)
focal_class.class_method_signature: ExcelFieldImportService.getFields(final Class clazz)
focal_class.full_signature: public static Iterator<Field> getFields(final Class clazz)
focal_class.identifier: getFields
focal_class.modifiers: public static
focal_class.parameters: (final Class clazz)
focal_class.return: Iterator<Field>
focal_class.signature: Iterator<Field> getFields(final Class clazz)
focal_class.class_method_signature: ExcelFieldImportService.getFieldProp(final Field field)
focal_class.full_signature: public static String getFieldProp(final Field field)
focal_class.identifier: getFieldProp
focal_class.modifiers: public static
focal_class.parameters: (final Field field)
focal_class.return: String
focal_class.signature: String getFieldProp(final Field field)
focal_class.class_method_signature: ExcelFieldImportService.getFieldBean(final Field field)
focal_class.full_signature: public static Class getFieldBean(final Field field)
focal_class.identifier: getFieldBean
focal_class.modifiers: public static
focal_class.parameters: (final Field field)
focal_class.return: Class
focal_class.signature: Class getFieldBean(final Field field)
focal_class.class_method_signature: ExcelFieldImportService.getFieldClazz(final Field field)
focal_class.full_signature: public static Class[] getFieldClazz(final Field field)
focal_class.identifier: getFieldClazz
focal_class.modifiers: public static
focal_class.parameters: (final Field field)
focal_class.return: Class[]
focal_class.signature: Class[] getFieldClazz(final Field field)
focal_class.class_method_signature: ExcelFieldImportService.getObjectFromRepository(final ApplicationContext applicationContext, final Field parentField,
                                                   final Field field, final Object cellValue, final ImportBean importBean)
focal_class.full_signature: public static Object getObjectFromRepository(final ApplicationContext applicationContext, final Field parentField,
                                                   final Field field, final Object cellValue, final ImportBean importBean)
focal_class.identifier: getObjectFromRepository
focal_class.modifiers: public static
focal_class.parameters: (final ApplicationContext applicationContext, final Field parentField,
                                                   final Field field, final Object cellValue, final ImportBean importBean)
focal_class.return: Object
focal_class.signature: Object getObjectFromRepository(final ApplicationContext applicationContext, final Field parentField,
                                                   final Field field, final Object cellValue, final ImportBean importBean)
focal_class.class_method_signature: ExcelFieldImportService.findMethod(final Class<? extends BaseJpaRepository> clazzRepository,
                                       final String prop, final Class methodParamClass)
focal_class.full_signature: private static Method findMethod(final Class<? extends BaseJpaRepository> clazzRepository,
                                       final String prop, final Class methodParamClass)
focal_class.identifier: findMethod
focal_class.modifiers: private static
focal_class.parameters: (final Class<? extends BaseJpaRepository> clazzRepository,
                                       final String prop, final Class methodParamClass)
focal_class.return: Method
focal_class.signature: Method findMethod(final Class<? extends BaseJpaRepository> clazzRepository,
                                       final String prop, final Class methodParamClass)
focal_method.body: 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;
      }
focal_method.class_method_signature: ExcelFieldImportService.getFieldType(final Field field)
focal_method.full_signature: public static FieldTypeImport getFieldType(final Field field)
focal_method.identifier: getFieldType
focal_method.invocations: get get getFieldClass contains isEnum getAnnotation isEmpty importByProp put
focal_method.modifiers: public static
focal_method.parameters: (final Field field)
focal_method.return: FieldTypeImport
focal_method.signature: FieldTypeImport getFieldType(final Field field)