Search in sources :

Example 1 with CleanupJob

use of org.jabref.model.cleanup.CleanupJob in project jabref by JabRef.

the class CleanupWorker method cleanup.

public List<FieldChange> cleanup(CleanupPreset preset, BibEntry entry) {
    Objects.requireNonNull(preset);
    Objects.requireNonNull(entry);
    List<CleanupJob> jobs = determineCleanupActions(preset);
    List<FieldChange> changes = new ArrayList<>();
    for (CleanupJob job : jobs) {
        changes.addAll(job.cleanup(entry));
    }
    return changes;
}
Also used : ArrayList(java.util.ArrayList) FieldChange(org.jabref.model.FieldChange) CleanupJob(org.jabref.model.cleanup.CleanupJob)

Example 2 with CleanupJob

use of org.jabref.model.cleanup.CleanupJob in project jabref by JabRef.

the class DoiCleanup method removeFieldValue.

private void removeFieldValue(BibEntry entry, String field, List<FieldChange> changes) {
    CleanupJob eraser = new FieldFormatterCleanup(field, new ClearFormatter());
    changes.addAll(eraser.cleanup(entry));
}
Also used : FieldFormatterCleanup(org.jabref.model.cleanup.FieldFormatterCleanup) ClearFormatter(org.jabref.logic.formatter.bibtexfields.ClearFormatter) CleanupJob(org.jabref.model.cleanup.CleanupJob)

Aggregations

CleanupJob (org.jabref.model.cleanup.CleanupJob)2 ArrayList (java.util.ArrayList)1 ClearFormatter (org.jabref.logic.formatter.bibtexfields.ClearFormatter)1 FieldChange (org.jabref.model.FieldChange)1 FieldFormatterCleanup (org.jabref.model.cleanup.FieldFormatterCleanup)1