Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.importer.fetcher

public Class SwhidFetcher

extends Object
implements IdBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.IdBasedFetcher, org.jabref.logic.importer.WebFetcher
Annotations
@NullMarked
Imports
java.net.MalformedURLException, .URISyntaxException, .URL, java.time.Duration, java.util.List, .Optional, org.jabref.logic.help.HelpFile, org.jabref.logic.importer.FetcherClientException, .FetcherException, .IdBasedFetcher, .ImportFormatPreferences, .ParseException, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.net.URLDownload, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.BiblatexSoftwareField, .UnknownField, org.jabref.model.entry.identifier.SWHID, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.jspecify.annotations.NullMarked, org.slf4j.Logger, .LoggerFactory

Fetches bibliographic citation entries from Software Heritage using SWHID identifiers.

Field Summary

Modifier and TypeField and Description
private static final String
public static final String
private final ImportFormatPreferences
private static final Logger
pack-priv static final FetcherRateLimiter
private static final String

Constructor Summary

AccessConstructor and Description
public
SwhidFetcher(ImportFormatPreferences importFormatPreferences)

Method Summary

Modifier and TypeMethod and Description
public Optional<HelpFile>
getHelpPage()

Overrides default org.jabref.logic.importer.WebFetcher.getHelpPage.

Returns the help page for this fetcher.

public String
getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher.

public URL
public Optional<BibEntry>
performSearchById(String identifier)

Implements org.jabref.logic.importer.IdBasedFetcher.performSearchById.

Looks for bibliographic information associated to the given identifier.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

API_URLback to summary
private static final String API_URL
FETCHER_NAMEback to summary
public static final String FETCHER_NAME
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
LOGGERback to summary
private static final Logger LOGGER
RATE_LIMITERback to summary
pack-priv static final FetcherRateLimiter RATE_LIMITER
USER_AGENTback to summary
private static final String USER_AGENT

Constructor Detail

SwhidFetcherback to summary
public SwhidFetcher(ImportFormatPreferences importFormatPreferences)

Method Detail

getHelpPageback to summary
public Optional<HelpFile> getHelpPage()

Overrides default org.jabref.logic.importer.WebFetcher.getHelpPage.

Doc from org.jabref.logic.importer.WebFetcher.getHelpPage.

Returns the help page for this fetcher.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.jabref.logic.importer.WebFetcher.getName.

Doc from org.jabref.logic.importer.WebFetcher.getName.

Returns the localized name of this fetcher. The title can be used to display the fetcher in the menu and in the side pane.

Todo

This name is also used for identifying the fetcher in preferences for API keys. Thus, any switch of the language will "remove" API keys.

Annotations
@Override
getURLForIdentifierback to summary
public URL getURLForIdentifier(String identifier) throws URISyntaxException, MalformedURLException
performSearchByIdback to summary
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException

Implements org.jabref.logic.importer.IdBasedFetcher.performSearchById.

Doc from org.jabref.logic.importer.IdBasedFetcher.performSearchById.

Looks for bibliographic information associated to the given identifier.

Annotations
@Override