@Test public void shouldReadTheLanguageFieldOfASingleEntry() throws IOException, ParseException { BibTeXDatabase db = loadUnixDatabase(); BibTeXEntry e = db.resolveEntry(new Key("Bach:1986:UTS")); BibTeXConverter conv = new BibTeXConverter(); CSLItemData cid = conv.toItemData(e); assertEquals("Bach:1986:UTS", cid.getId()); assertEquals("German", cid.getLanguage()); }
public Map<String, CSLItemData> toItemData(BibTeXDatabase db) { Map<String, CSLItemData> result = new LinkedHashMap<>(); for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) { result.put(e.getKey().getValue(), toItemData(e.getValue())); } return result; }
BibTeXConverter { public Map<String, CSLItemData> toItemData(BibTeXDatabase db) { Map<String, CSLItemData> result = new LinkedHashMap<>(); for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) { result.put(e.getKey().getValue(), toItemData(e.getValue())); } return result; } }
BibTeXConverter { public Map<String, CSLItemData> toItemData(BibTeXDatabase db) { Map<String, CSLItemData> result = new LinkedHashMap<>(); for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) { result.put(e.getKey().getValue(), toItemData(e.getValue())); } return result; } BibTeXConverter(); }
BibTeXConverter { public Map<String, CSLItemData> toItemData(BibTeXDatabase db) { Map<String, CSLItemData> result = new LinkedHashMap<>(); for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) { result.put(e.getKey().getValue(), toItemData(e.getValue())); } return result; } BibTeXConverter(); BibTeXDatabase loadDatabase(InputStream is); Map<String, CSLItemData> toItemData(BibTeXDatabase db); CSLItemData toItemData(BibTeXEntry e); CSLType toType(Key type); }
BibTeXConverter { public Map<String, CSLItemData> toItemData(BibTeXDatabase db) { Map<String, CSLItemData> result = new LinkedHashMap<>(); for (Map.Entry<Key, BibTeXEntry> e : db.getEntries().entrySet()) { result.put(e.getKey().getValue(), toItemData(e.getValue())); } return result; } BibTeXConverter(); BibTeXDatabase loadDatabase(InputStream is); Map<String, CSLItemData> toItemData(BibTeXDatabase db); CSLItemData toItemData(BibTeXEntry e); CSLType toType(Key type);  }