use of org.jbibtex.DigitStringValue in project jabref by JabRef.
the class CitationStyleGenerator method bibEntryToCSLItemData.
/**
* Converts the {@link BibEntry} into {@link CSLItemData}.
*/
private static CSLItemData bibEntryToCSLItemData(BibEntry bibEntry) {
String citeKey = bibEntry.getCiteKeyOptional().orElse("");
BibTeXEntry bibTeXEntry = new BibTeXEntry(new Key(bibEntry.getType()), new Key(citeKey));
// Not every field is already generated into latex free fields
for (String key : bibEntry.getFieldMap().keySet()) {
Optional<String> latexFreeField = bibEntry.getLatexFreeField(key);
latexFreeField.ifPresent(value -> bibTeXEntry.addField(new Key(key), new DigitStringValue(value)));
}
return BIBTEX_CONVERTER.toItemData(bibTeXEntry);
}
Aggregations