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
Imports
java.io.IOException, java.net.HttpURLConnection, .URL, .URLConnection, java.util.Collections, .List, .Optional, java.util.concurrent.CompletableFuture, .CompletionException, java.util.regex.Pattern, org.jabref.logic.cleanup.FieldFormatterCleanup, org.jabref.logic.formatter.bibtexfields.ClearFormatter, .HtmlToLatexFormatter, .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.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.OptionalUtil, com.google.common.util.concurrent.RateLimiter, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, 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 RateLimiter
private static final RateLimiter
private static final Logger
public static final String
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
isAPSJournal(BibEntry entry, String doiAsString)

public List<BibEntry>
performSearch(BibEntry
entry to search bibliographic information for
entry
)

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

Looks for hits which are matched by the given BibEntry.

public Optional<BibEntry>
performSearchById(String
a string which uniquely identifies the item
identifier
)

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

Looks for bibliographic information associated to the given identifier.

private void
private 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
CROSSREF_DCN_RATE_LIMITERback to summary
private static final RateLimiter CROSSREF_DCN_RATE_LIMITER
DATA_CITE_DCN_RATE_LIMITERback to summary
private static final RateLimiter DATA_CITE_DCN_RATE_LIMITER
LOGGERback to summary
private static final Logger LOGGER
NAMEback to summary
public static final String NAME
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 IOException

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.

Returns:Optional<HelpFile>

the HelpFile enum constant for the help page

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.

Returns:String

the localized name

Annotations
@Override
isAPSJournalback to summary
private boolean isAPSJournal(BibEntry entry, String doiAsString)
performSearchback to summary
public List<BibEntry> performSearch(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.

Parameters
entry:BibEntry

entry to search bibliographic information for

Returns:List<BibEntry>

a list of BibEntry, which are matched by the query (may be empty)

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.

Parameters
identifier:String

a string which uniquely identifies the item

Returns:Optional<BibEntry>

a BibEntry containing the bibliographic information (or an empty optional if no data was found)

Annotations
@Override
setPageCountToArticleIdback to summary
private void setPageCountToArticleId(BibEntry entry, String doiAsString)
updateCrossrefAPIRateback to summary
private void updateCrossrefAPIRate(URLConnection existingConnection)