use of org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter in project jabref by JabRef.
the class CleanupWorkerTest method cleanupWithDisabledFieldFormatterChangesNothing.
@Test
public void cleanupWithDisabledFieldFormatterChangesNothing() {
CleanupPreset preset = new CleanupPreset(new FieldFormatterCleanups(false, Collections.singletonList(new FieldFormatterCleanup("month", new NormalizeMonthFormatter()))));
BibEntry entry = new BibEntry();
entry.setField("month", "01");
worker.cleanup(preset, entry);
Assert.assertEquals(Optional.of("01"), entry.getField("month"));
}
use of org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter in project jabref by JabRef.
the class MedlineFetcher method doPostCleanup.
@Override
public void doPostCleanup(BibEntry entry) {
new FieldFormatterCleanup("journal-abbreviation", new ClearFormatter()).cleanup(entry);
new FieldFormatterCleanup("status", new ClearFormatter()).cleanup(entry);
new FieldFormatterCleanup("copyright", new ClearFormatter()).cleanup(entry);
new FieldFormatterCleanup(FieldName.MONTH, new NormalizeMonthFormatter()).cleanup(entry);
}
use of org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter in project jabref by JabRef.
the class CleanupWorkerTest method cleanupMonthChangesNumberToBibtex.
@Test
public void cleanupMonthChangesNumberToBibtex() {
CleanupPreset preset = new CleanupPreset(new FieldFormatterCleanups(true, Collections.singletonList(new FieldFormatterCleanup("month", new NormalizeMonthFormatter()))));
BibEntry entry = new BibEntry();
entry.setField("month", "01");
worker.cleanup(preset, entry);
Assert.assertEquals(Optional.of("#jan#"), entry.getField("month"));
}
Aggregations