Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.crawler

pack-priv Class StudyCatalogToFetcherConverter

extends Object
Class Inheritance
Imports
java.util.List, .Optional, .Set, org.jabref.logic.importer.ImportFormatPreferences, .ImporterPreferences, .SearchBasedFetcher, .WebFetchers, org.jabref.model.study.StudyCatalog

Converts library entries from the given study into their corresponding fetchers.

Field Summary

Modifier and TypeField and Description
private final ImporterPreferences
private final ImportFormatPreferences
private final List<StudyCatalog>

Constructor Summary

AccessConstructor and Description
public
StudyCatalogToFetcherConverter(List<StudyCatalog> libraryEntries, ImportFormatPreferences importFormatPreferences, ImporterPreferences importerPreferences)

Method Summary

Modifier and TypeMethod and Description
private Optional<SearchBasedFetcher>

Returns:

An instance of the fetcher defined by the library entry.
createFetcherFromLibraryEntry
(StudyCatalog
the entry that will be converted
studyCatalog
)

Transforms a library entry into a SearchBasedFetcher instance.

public List<SearchBasedFetcher>

Returns:

Instances of all active fetchers defined in the study definition.
getActiveFetchers
()

Returns a list of instances of all active library fetchers.

private List<SearchBasedFetcher>

Returns:

List of fetcher instances
getFetchersFromLibraryEntries
(List<StudyCatalog>
List of entries
libraryEntries
)

Transforms a list of libraryEntries into a list of SearchBasedFetcher instances.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

importerPreferencesback to summary
private final ImporterPreferences importerPreferences
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
libraryEntriesback to summary
private final List<StudyCatalog> libraryEntries

Constructor Detail

StudyCatalogToFetcherConverterback to summary
public StudyCatalogToFetcherConverter(List<StudyCatalog> libraryEntries, ImportFormatPreferences importFormatPreferences, ImporterPreferences importerPreferences)

Method Detail

createFetcherFromLibraryEntryback to summary
private Optional<SearchBasedFetcher> createFetcherFromLibraryEntry(StudyCatalog studyCatalog)

Transforms a library entry into a SearchBasedFetcher instance. This only works if the library entry specifies a supported fetcher.

Parameters
studyCatalog:StudyCatalog

the entry that will be converted

Returns:Optional<SearchBasedFetcher>

An instance of the fetcher defined by the library entry.

getActiveFetchersback to summary
public List<SearchBasedFetcher> getActiveFetchers()

Returns a list of instances of all active library fetchers.

A fetcher is considered active if there exists an library entry of the library the fetcher is associated with that is enabled.

Returns:List<SearchBasedFetcher>

Instances of all active fetchers defined in the study definition.

getFetchersFromLibraryEntriesback to summary
private List<SearchBasedFetcher> getFetchersFromLibraryEntries(List<StudyCatalog> libraryEntries)

Transforms a list of libraryEntries into a list of SearchBasedFetcher instances.

Parameters
libraryEntries:List<StudyCatalog>

List of entries

Returns:List<SearchBasedFetcher>

List of fetcher instances