@@ -0,0 +1,1155 @@
+package net.sf.jabref.logic.formatter;%0A%0Aimport net.sf.jabref.logic.FieldChange;%0Aimport net.sf.jabref.logic.cleanup.CleanupJob;%0Aimport net.sf.jabref.model.entry.BibEntry;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Can be used to turn a formatter into a cleanup action.%0A */%0Apublic class CleanupFormatter implements CleanupJob %7B%0A%0A    private Formatter formatter;%0A%0A    private String fieldKey;%0A%0A    public CleanupFormatter(Formatter formatter, String fieldKey) %7B%0A        this.formatter = formatter;%0A        this.fieldKey = fieldKey;%0A    %7D%0A%0A    @Override%0A    public List%3CFieldChange%3E cleanup(BibEntry entry) %7B%0A        List%3CFieldChange%3E result = new ArrayList%3C%3E(0);%0A%0A        String fieldValue = entry.getField(fieldKey);%0A        if (fieldValue != null) %7B%0A            String newValue = formatter.format(fieldValue);%0A%0A            //see if something has changed%0A            if (!fieldValue.equals(newValue)) %7B%0A                entry.setField(fieldKey, newValue);%0A                FieldChange change = new FieldChange(entry, fieldKey, fieldValue, newValue);%0A                result.add(change);%0A            %7D%0A        %7D%0A%0A        return result;%0A    %7D%0A%7D%0A

Add wrapper class for using a formatter as a cleanup action