test_class.file: kilt-core/src/test/java/de/poiu/kilt/importexport/xls/XlsFileTest.java
test_class.identifier: XlsFileTest
test_case.body: @Test
    public void testRead_WithEmptyDefaultLanguage() throws Exception {
      // - preparation
      final File file= new File(Resources.getResource("i18n_expected.xlsx").toURI());
  
      // - execution
      final XlsFile xlsFile= new XlsFile(file);
  
      // - verification
      final Map<I18nBundleKey, Collection<Translation>> content= xlsFile.getContent();
  
      assertThat(content).containsOnlyKeys(new I18nBundleKey("i18n/messages", "ok"), new I18nBundleKey("i18n/messages", "cancel"));
      assertThat(content.get(new I18nBundleKey("i18n/messages", "ok"))).containsOnly(
        new Translation(Language.of("de"), "OK"),
        new Translation(Language.of(""), "OK")
      );
      assertThat(content.get(new I18nBundleKey("i18n/messages", "cancel"))).containsOnly(
        new Translation(Language.of("de"), "Abbrechen"),
        new Translation(Language.of(""), "Cancel")
      );
    }
test_case.class_method_signature: XlsFileTest.testRead_WithEmptyDefaultLanguage()
test_case.full_signature: @Test public void testRead_WithEmptyDefaultLanguage()
test_case.identifier: testRead_WithEmptyDefaultLanguage
test_case.invocations: toURI getResource getContent containsOnlyKeys assertThat containsOnly assertThat get of of containsOnly assertThat get of of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRead_WithEmptyDefaultLanguage()
focal_class.declarator: LOGGER= LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER= LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: DEFAULT_I18N_SHEET_NAME = "i18n"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_I18N_SHEET_NAME = "i18n";
focal_class.type: String
focal_class.var_name: DEFAULT_I18N_SHEET_NAME
focal_class.declarator: KILT_INFO_SHEET_NAME = "generation-info"
focal_class.modifier: private static final
focal_class.original_string: private static final String KILT_INFO_SHEET_NAME = "generation-info";
focal_class.type: String
focal_class.var_name: KILT_INFO_SHEET_NAME
focal_class.declarator: workbook
focal_class.modifier: private final
focal_class.original_string: private final Workbook workbook;
focal_class.type: Workbook
focal_class.var_name: workbook
focal_class.declarator: i18nSheet
focal_class.modifier: private final
focal_class.original_string: private final SheetWrapper i18nSheet;
focal_class.type: SheetWrapper
focal_class.var_name: i18nSheet
focal_class.declarator: kiltInfoSheet
focal_class.modifier: private final
focal_class.original_string: private final Sheet kiltInfoSheet;
focal_class.type: Sheet
focal_class.var_name: kiltInfoSheet
focal_class.declarator: file
focal_class.modifier: private final
focal_class.original_string: private final File file;
focal_class.type: File
focal_class.var_name: file
focal_class.declarator: languageColumnMap= HashBiMap.create()
focal_class.modifier: private final
focal_class.original_string: private final BiMap<Language, Integer> languageColumnMap= HashBiMap.create();
focal_class.type: BiMap<Language, Integer>
focal_class.var_name: languageColumnMap
focal_class.declarator: i18nKeyRowMap= HashBiMap.create()
focal_class.modifier: private final
focal_class.original_string: private final BiMap<I18nBundleKey, Integer> i18nKeyRowMap= HashBiMap.create();
focal_class.type: BiMap<I18nBundleKey, Integer>
focal_class.var_name: i18nKeyRowMap
focal_class.file: kilt-core/src/main/java/de/poiu/kilt/importexport/xls/XlsFile.java
focal_class.identifier: XlsFile
focal_class.class_method_signature: XlsFile.XlsFile(final File file)
focal_class.full_signature: public  XlsFile(final File file)
focal_class.identifier: XlsFile
focal_class.modifiers: public
focal_class.parameters: (final File file)
focal_class.signature:  XlsFile(final File file)
focal_class.class_method_signature: XlsFile.prepareWorkbook(final File inputFile)
focal_class.full_signature: private Workbook prepareWorkbook(final File inputFile)
focal_class.identifier: prepareWorkbook
focal_class.modifiers: private
focal_class.parameters: (final File inputFile)
focal_class.return: Workbook
focal_class.signature: Workbook prepareWorkbook(final File inputFile)
focal_class.class_method_signature: XlsFile.prepareI18nSheet(final Workbook workbook, final String sheetName)
focal_class.full_signature: private SheetWrapper prepareI18nSheet(final Workbook workbook, final String sheetName)
focal_class.identifier: prepareI18nSheet
focal_class.modifiers: private
focal_class.parameters: (final Workbook workbook, final String sheetName)
focal_class.return: SheetWrapper
focal_class.signature: SheetWrapper prepareI18nSheet(final Workbook workbook, final String sheetName)
focal_class.class_method_signature: XlsFile.updateKiltInfoSheet(final Workbook workbook, final String sheetName)
focal_class.full_signature: private Sheet updateKiltInfoSheet(final Workbook workbook, final String sheetName)
focal_class.identifier: updateKiltInfoSheet
focal_class.modifiers: private
focal_class.parameters: (final Workbook workbook, final String sheetName)
focal_class.return: Sheet
focal_class.signature: Sheet updateKiltInfoSheet(final Workbook workbook, final String sheetName)
focal_class.class_method_signature: XlsFile.getContentAsString()
focal_class.full_signature: public CharSequence getContentAsString()
focal_class.identifier: getContentAsString
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CharSequence
focal_class.signature: CharSequence getContentAsString()
focal_class.class_method_signature: XlsFile.init()
focal_class.full_signature: private void init()
focal_class.identifier: init
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: XlsFile.setValue(final I18nBundleKey i18nKey, final Language language, final String value)
focal_class.full_signature: public void setValue(final I18nBundleKey i18nKey, final Language language, final String value)
focal_class.identifier: setValue
focal_class.modifiers: public
focal_class.parameters: (final I18nBundleKey i18nKey, final Language language, final String value)
focal_class.return: void
focal_class.signature: void setValue(final I18nBundleKey i18nKey, final Language language, final String value)
focal_class.class_method_signature: XlsFile.setValue(final I18nBundleKey i18nKey, final Translation translation)
focal_class.full_signature: public void setValue(final I18nBundleKey i18nKey, final Translation translation)
focal_class.identifier: setValue
focal_class.modifiers: public
focal_class.parameters: (final I18nBundleKey i18nKey, final Translation translation)
focal_class.return: void
focal_class.signature: void setValue(final I18nBundleKey i18nKey, final Translation translation)
focal_class.class_method_signature: XlsFile.setValue(final I18nBundleKey i18nKey, final Collection<Translation> translations)
focal_class.full_signature: public void setValue(final I18nBundleKey i18nKey, final Collection<Translation> translations)
focal_class.identifier: setValue
focal_class.modifiers: public
focal_class.parameters: (final I18nBundleKey i18nKey, final Collection<Translation> translations)
focal_class.return: void
focal_class.signature: void setValue(final I18nBundleKey i18nKey, final Collection<Translation> translations)
focal_class.class_method_signature: XlsFile.appendLanguageColumn(final Language language)
focal_class.full_signature: private void appendLanguageColumn(final Language language)
focal_class.identifier: appendLanguageColumn
focal_class.modifiers: private
focal_class.parameters: (final Language language)
focal_class.return: void
focal_class.signature: void appendLanguageColumn(final Language language)
focal_class.class_method_signature: XlsFile.save()
focal_class.full_signature: public void save()
focal_class.identifier: save
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void save()
focal_class.class_method_signature: XlsFile.saveTo(final File file)
focal_class.full_signature: public void saveTo(final File file)
focal_class.identifier: saveTo
focal_class.modifiers: public
focal_class.parameters: (final File file)
focal_class.return: void
focal_class.signature: void saveTo(final File file)
focal_class.class_method_signature: XlsFile.getContent()
focal_class.full_signature: public Map<I18nBundleKey, Collection<Translation>> getContent()
focal_class.identifier: getContent
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<I18nBundleKey, Collection<Translation>>
focal_class.signature: Map<I18nBundleKey, Collection<Translation>> getContent()
focal_class.class_method_signature: XlsFile.writeRow(final Sheet sheet, final String... values)
focal_class.full_signature: private void writeRow(final Sheet sheet, final String... values)
focal_class.identifier: writeRow
focal_class.modifiers: private
focal_class.parameters: (final Sheet sheet, final String... values)
focal_class.return: void
focal_class.signature: void writeRow(final Sheet sheet, final String... values)
focal_method.body: public Map<I18nBundleKey, Collection<Translation>> getContent() {
      final Multimap<I18nBundleKey, Translation> contentMap= LinkedHashMultimap.create();
  
      for (int i= this.i18nSheet.getFirstRowNum() + 1; i < this.i18nSheet.getLastRowNum() + 1; i++) {
        final Row row= this.i18nSheet.getRow(i);
        //LibreOffice sometimes creates sheets that are broken and return a larget last row that really exists
        if (row == null) {
          continue;
        }
        final Optional<String> baseBundleName= this.i18nSheet.getStringValue(i, 0);
        final Optional<String> key= this.i18nSheet.getStringValue(i, 1);
        final I18nBundleKey i18nKey= new I18nBundleKey(baseBundleName.orElse(""), key.orElse(""));
  
        for (final Map.Entry<Language, Integer> entry : this.languageColumnMap.entrySet()) {
          final Language language = entry.getKey();
          final Integer columnIdx = entry.getValue();
          final Cell cell= row.getCell(columnIdx);
          if (cell != null) {
            contentMap.put(i18nKey, new Translation(language, cell.getStringCellValue()));
          }
        }
      }
  
      return contentMap.asMap();
    }
focal_method.class_method_signature: XlsFile.getContent()
focal_method.full_signature: public Map<I18nBundleKey, Collection<Translation>> getContent()
focal_method.identifier: getContent
focal_method.invocations: create getFirstRowNum getLastRowNum getRow getStringValue getStringValue orElse orElse entrySet getKey getValue getCell put getStringCellValue asMap
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Map<I18nBundleKey, Collection<Translation>>
focal_method.signature: Map<I18nBundleKey, Collection<Translation>> getContent()