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

public Class DoiFetcher

extends Object
implements IdBasedFetcher, EntryBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.EntryBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.IdBasedFetcher
Known Direct Subclasses
org.jabref.logic.importer.fetcher.SsrnFetcher
Imports
java.io.InputStream, java.net.HttpURLConnection, .MalformedURLException, .URL, .URLConnection, .URLEncoder, java.nio.charset.StandardCharsets, java.time.Duration, java.util.List, .Optional, java.util.concurrent.CompletableFuture, .CompletionException, java.util.regex.Pattern, org.jabref.logic.cleanup.FieldFormatterCleanup, org.jabref.logic.formatter.bibtexfields.ClearFormatter, .HtmlToLatexFormatter, .NormalizeMonthFormatter, .NormalizePagesFormatter, org.jabref.logic.help.HelpFile, org.jabref.logic.importer.EntryBasedFetcher, .FetcherException, .IdBasedFetcher, .ImportFormatPreferences, .ParseException, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.importer.util.MediaTypes, org.jabref.logic.l10n.Localization, org.jabref.logic.net.URLDownload, org.jabref.logic.util.URLUtil, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.identifier.DOI, org.jabref.model.entry.types.StandardEntryType, org.jabref.model.util.DummyFileUpdateMonitor, .OptionalUtil, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private static final Pattern
private static final FieldFormatterCleanup
private static final FetcherRateLimiter
private static final FetcherRateLimiter
private static final FieldFormatterCleanup
private static final Logger
public static final String
private static final FieldFormatterCleanup
private static final FieldFormatterCleanup
private final ImportFormatPreferences

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected CompletableFuture<Optional<BibEntry>>
private void
doAPILimiting(String identifier)

private void
public Optional<String>
getAgency(DOI
the DOI to be searched
doi
)

Returns registration agency.

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.

private boolean
public List<BibEntry>
performSearch(@NonNull BibEntry entry)

Implements org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Looks for hits which are matched by the given BibEntry.

public Optional<BibEntry>
performSearchById(String identifier)

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

Looks for bibliographic information associated to the given identifier.

private void
private synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

APS_JOURNAL_ORG_DOI_IDback to summary
private static final String APS_JOURNAL_ORG_DOI_ID
APS_SUFFIXback to summary
private static final String APS_SUFFIX
APS_SUFFIX_PATTERNback to summary
private static final Pattern APS_SUFFIX_PATTERN
CLEAR_URLback to summary
private static final FieldFormatterCleanup CLEAR_URL
CROSSREF_DCN_RATE_LIMITERback to summary
private static final FetcherRateLimiter CROSSREF_DCN_RATE_LIMITER
DATA_CITE_DCN_RATE_LIMITERback to summary
private static final FetcherRateLimiter DATA_CITE_DCN_RATE_LIMITER
HTML_TO_LATEX_TITLEback to summary
private static final FieldFormatterCleanup HTML_TO_LATEX_TITLE
LOGGERback to summary
private static final Logger LOGGER
NAMEback to summary
public static final String NAME
NORMALIZE_MONTHback to summary
private static final FieldFormatterCleanup NORMALIZE_MONTH
NORMALIZE_PAGESback to summary
private static final FieldFormatterCleanup NORMALIZE_PAGES
preferencesback to summary
private final ImportFormatPreferences preferences

Constructor Detail

DoiFetcherback to summary
public DoiFetcher(ImportFormatPreferences preferences)

Method Detail

asyncPerformSearchByIdback to summary
protected CompletableFuture<Optional<BibEntry>> asyncPerformSearchById(String identifier)
doAPILimitingback to summary
private void doAPILimiting(String identifier)
doPostCleanupback to summary
private void doPostCleanup(BibEntry entry)
getAgencyback to summary
public Optional<String> getAgency(DOI doi) throws FetcherException, MalformedURLException

Returns registration agency. Optional.empty() if no agency is found.

Parameters
doi:DOI

the DOI to be searched

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
isAPSJournalback to summary
private boolean isAPSJournal(BibEntry entry, DOI doi)
performSearchback to summary
public List<BibEntry> performSearch(@NonNull BibEntry entry) throws FetcherException

Implements org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Doc from org.jabref.logic.importer.EntryBasedFetcher.performSearch.

Looks for hits which are matched by the given BibEntry.

Annotations
@Override
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
setPageNumbersBasedOnDoiback to summary
private void setPageNumbersBasedOnDoi(BibEntry entry, DOI doi)
updateCrossrefAPIRateback to summary
private synchronized void updateCrossrefAPIRate(URLConnection existingConnection)