Verified Owner
Top Description Fields Constructors Methods
org.jabref.model.database

public Class CitationKeyListener

extends Object
Class Inheritance
Annotations
@NullMarked
Imports
java.util.ArrayList, .Arrays, .List, .Optional, .Set, org.jabref.model.database.event.EntriesRemovedEvent, org.jabref.model.entry.BibEntry, org.jabref.model.entry.event.FieldChangedEvent, org.jabref.model.entry.field.Field, .FieldProperty, .InternalField, com.google.common.eventbus.Subscribe, org.jspecify.annotations.NullMarked, .Nullable

Updates references of citation keys if the citation key of an entry is changed.

Field Summary

Modifier and TypeField and Description
private final BibDatabase

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
replaceKeyInMultiplesKeyField(BibEntry entry, Field field, String fieldContent, String oldKey, @Nullable String
The new key. If null, the key is removed.
newKey
)

private void
replaceSingleKeyInField(@Nullable String newKey, String oldKey, BibEntry entry, Field field, String fieldContent)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseback to summary
private final BibDatabase database

Constructor Detail

CitationKeyListenerback to summary
public CitationKeyListener(BibDatabase database)

Method Detail

listenback to summary
public void listen(FieldChangedEvent event)
Annotations
@Subscribe
listenback to summary
public void listen(EntriesRemovedEvent event)
Annotations
@Subscribe
replaceKeyInMultiplesKeyFieldback to summary
private void replaceKeyInMultiplesKeyField(BibEntry entry, Field field, String fieldContent, String oldKey, @Nullable String newKey)
Parameters
newKey:@Nullable String

The new key. If null, the key is removed.

replaceSingleKeyInFieldback to summary
private void replaceSingleKeyInField(@Nullable String newKey, String oldKey, BibEntry entry, Field field, String fieldContent)