Verified Owner
Top Fields Constructors Methods
org.jabref.logic.cleanup

public Class NormalizeWhitespacesCleanup

extends Object
implements CleanupJob
Class Inheritance
All Implemented Interfaces
org.jabref.logic.cleanup.CleanupJob
Imports
java.util.ArrayList, .Collection, .List, java.util.function.Consumer, org.jabref.logic.bibtex.FieldPreferences, org.jabref.logic.formatter.bibtexfields.NormalizeWhitespaceFormatter, org.jabref.model.FieldChange, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .FieldFactory

Field Summary

Modifier and TypeField and Description
private final NormalizeWhitespaceFormatter
private static final Collection<Field>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<FieldChange>
cleanup(BibEntry entry)

Implements org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleans up the given entry and returns the list of changes made.

public List<FieldChange>
cleanup(BibEntry entry, Consumer<Runnable> mutationScheduler)

Overrides default org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleans up the given entry, routing all BibEntry field mutations through the provided scheduler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatterback to summary
private final NormalizeWhitespaceFormatter formatter
NO_TEXT_FIELDSback to summary
private static final Collection<Field> NO_TEXT_FIELDS

Constructor Detail

NormalizeWhitespacesCleanupback to summary
public NormalizeWhitespacesCleanup(FieldPreferences fieldPreferences)

Method Detail

cleanupback to summary
public List<FieldChange> cleanup(BibEntry entry)

Implements org.jabref.logic.cleanup.CleanupJob.cleanup.

Doc from org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleans up the given entry and returns the list of changes made.

Annotations
@Override
cleanupback to summary
public List<FieldChange> cleanup(BibEntry entry, Consumer<Runnable> mutationScheduler)

Overrides default org.jabref.logic.cleanup.CleanupJob.cleanup.

Doc from org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleans up the given entry, routing all BibEntry field mutations through the provided scheduler.

The scheduler must execute mutations synchronously (blocking the caller until complete), e.g. UiTaskExecutor::runAndWaitInJavaFXThread when called from a background thread, or Runnable::run when already on the correct thread.

The default implementation wraps the entire cleanup(BibEntry) call in the scheduler, which is safe but puts all computation on the scheduler's thread. Override this method to keep expensive computation on the calling (background) thread and only schedule the actual field mutations.

Annotations
@Override