Verified Owner
Top Description Inners Fields Constructors Methods
org.jabref.logic.journals

public Class JournalAbbreviationLoader

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.file.Files, .InvalidPathException, .Path, java.util.Collection, .Collections, .List, .Optional, .Set, .TreeSet, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, org.jabref.logic.journals.ltwa.LtwaRepository, org.jabref.logic.util.BackgroundTask, .TaskExecutor, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

This class loads abbreviations from a CSV file and stores them into a MV file (readAbbreviationsFromCsvFile(Path)). It can also create an JournalAbbreviationRepository based on an MV file (loadRepository(AbbreviationPreferences)).

Abbreviations are available at https://github.com/JabRef/abbrv.jabref.org/.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static JournalAbbreviationRepository
public static JournalAbbreviationRepository
private static LtwaRepository
public static JournalAbbreviationRepository
loadRepository(AbbreviationPreferences abbreviationPreferences)

public static JournalAbbreviationRepository
loadRepositoryInBackground(AbbreviationPreferences abbreviationPreferences, TaskExecutor taskExecutor)

private static JournalAbbreviationRepository
public static Collection<Abbreviation>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

JournalAbbreviationLoaderback to summary
public JournalAbbreviationLoader()

Method Detail

getFallbackRepositoryback to summary
private static JournalAbbreviationRepository getFallbackRepository()
loadBuiltInRepositoryback to summary
public static JournalAbbreviationRepository loadBuiltInRepository()
loadLtwaRepositoryback to summary
private static LtwaRepository loadLtwaRepository() throws IOException
loadRepositoryback to summary
public static JournalAbbreviationRepository loadRepository(AbbreviationPreferences abbreviationPreferences)
loadRepositoryInBackgroundback to summary
public static JournalAbbreviationRepository loadRepositoryInBackground(AbbreviationPreferences abbreviationPreferences, TaskExecutor taskExecutor)
loadRepositorySynchronouslyback to summary
private static JournalAbbreviationRepository loadRepositorySynchronously(AbbreviationPreferences abbreviationPreferences)
readAbbreviationsFromCsvFileback to summary
public static Collection<Abbreviation> readAbbreviationsFromCsvFile(Path file) throws IOException
org.jabref.logic.journals back to summary

private Class JournalAbbreviationLoader.AsyncJournalAbbreviationRepository

extends JournalAbbreviationRepository
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AbbreviationPreferences
private final AtomicReference<JournalAbbreviationRepository>
private final AtomicBoolean
private final AtomicBoolean
private final Set<Abbreviation>
private final TaskExecutor
Inherited from org.jabref.logic.journals.JournalAbbreviationRepository:
QUESTION_MARK

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
public Optional<Abbreviation>
get(String input)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.get.

Attempts to get the abbreviation of the journal given.

public Collection<Abbreviation>
public Collection<Abbreviation>
public Optional<String>
public Optional<String>
public Set<String>
public Optional<String>
getLtwaAbbreviation(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getLtwaAbbreviation.

Get the LTWA abbreviation for the given journal name.

public Optional<String>
public Optional<String>
public boolean
isAbbreviatedName(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.isAbbreviatedName.

Returns true if the given journal name is in its abbreviated form (e.g. Phys.

public boolean
isKnownName(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.isKnownName.

Returns true if the given journal name is contained in the list either in its full form (e.g., Physical Review Letters) or its abbreviated form (e.g., Phys.

private Optional<JournalAbbreviationRepository>
private void
private void
Inherited from org.jabref.logic.journals.JournalAbbreviationRepository:
addCustomAbbreviation

Field Detail

abbreviationPreferencesback to summary
private final AbbreviationPreferences abbreviationPreferences
currentRepositoryback to summary
private final AtomicReference<JournalAbbreviationRepository> currentRepository
loadedback to summary
private final AtomicBoolean loaded
loadingStartedback to summary
private final AtomicBoolean loadingStarted
pendingCustomAbbreviationsback to summary
private final Set<Abbreviation> pendingCustomAbbreviations
taskExecutorback to summary
private final TaskExecutor taskExecutor

Constructor Detail

AsyncJournalAbbreviationRepositoryback to summary
private AsyncJournalAbbreviationRepository(AbbreviationPreferences abbreviationPreferences, TaskExecutor taskExecutor)

Method Detail

addCustomAbbreviationback to summary
public void addCustomAbbreviation(@NonNull Abbreviation abbreviation)
Annotations
@Override
addCustomAbbreviationsback to summary
public void addCustomAbbreviations(Collection<Abbreviation> abbreviationsToAdd)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.addCustomAbbreviations.

Annotations
@Override
ensureLoadingStartedback to summary
private void ensureLoadingStarted()
getback to summary
public Optional<Abbreviation> get(String input)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.get.

Doc from org.jabref.logic.journals.JournalAbbreviationRepository.get.

Attempts to get the abbreviation of the journal given. if no exact match is found, attempts a fuzzy match on full journal names.

Annotations
@Override
getAllLoadedback to summary
public Collection<Abbreviation> getAllLoaded()

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getAllLoaded.

Annotations
@Override
getCustomAbbreviationsback to summary
public Collection<Abbreviation> getCustomAbbreviations()

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getCustomAbbreviations.

Annotations
@Override
getDefaultAbbreviationback to summary
public Optional<String> getDefaultAbbreviation(String text)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getDefaultAbbreviation.

Annotations
@Override
getDotlessback to summary
public Optional<String> getDotless(String text)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getDotless.

Annotations
@Override
getFullNamesback to summary
public Set<String> getFullNames()

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getFullNames.

Annotations
@Override
getLtwaAbbreviationback to summary
public Optional<String> getLtwaAbbreviation(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getLtwaAbbreviation.

Doc from org.jabref.logic.journals.JournalAbbreviationRepository.getLtwaAbbreviation.

Get the LTWA abbreviation for the given journal name.

Annotations
@Override
getNextAbbreviationback to summary
public Optional<String> getNextAbbreviation(String text)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getNextAbbreviation.

Annotations
@Override
getShortestUniqueAbbreviationback to summary
public Optional<String> getShortestUniqueAbbreviation(String text)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.getShortestUniqueAbbreviation.

Annotations
@Override
isAbbreviatedNameback to summary
public boolean isAbbreviatedName(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.isAbbreviatedName.

Doc from org.jabref.logic.journals.JournalAbbreviationRepository.isAbbreviatedName.

Returns true if the given journal name is in its abbreviated form (e.g. Phys. Rev. Lett.). The test is strict, i.e., journals whose abbreviation is the same as the full name are not considered

Annotations
@Override
isKnownNameback to summary
public boolean isKnownName(String journalName)

Overrides org.jabref.logic.journals.JournalAbbreviationRepository.isKnownName.

Doc from org.jabref.logic.journals.JournalAbbreviationRepository.isKnownName.

Returns true if the given journal name is contained in the list either in its full form (e.g., Physical Review Letters) or its abbreviated form (e.g., Phys. Rev. Lett.). If the exact match is not found, attempts a fuzzy match to recognize minor input errors.

Annotations
@Override
loadedDelegateback to summary
private Optional<JournalAbbreviationRepository> loadedDelegate()
setFallbackRepositoryback to summary
private void setFallbackRepository()
setLoadedRepositoryback to summary
private void setLoadedRepository(JournalAbbreviationRepository repository)