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

public Class INSPIREFetcher

extends Object
implements SearchBasedParserFetcher, EntryBasedFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.EntryBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.SearchBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.SearchBasedFetcher
Imports
java.net.MalformedURLException, .URI, .URISyntaxException, .URL, java.util.List, .Optional, org.jabref.logic.cleanup.FieldFormatterCleanup, org.jabref.logic.formatter.bibtexfields.ClearFormatter, .RemoveEnclosingBracesFormatter, org.jabref.logic.help.HelpFile, org.jabref.logic.importer.EntryBasedFetcher, .FetcherException, .ImportFormatPreferences, .ParseException, .Parser, .SearchBasedParserFetcher, org.jabref.logic.importer.fetcher.transformers.DefaultQueryTransformer, org.jabref.logic.importer.fileformat.BibtexParser, org.jabref.logic.importer.util.MediaTypes, org.jabref.logic.layout.format.LatexToUnicodeFormatter, org.jabref.logic.net.URLDownload, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.StandardField, .UnknownField, org.jabref.model.search.query.BaseQueryNode, org.apache.hc.core5.net.URIBuilder, org.jspecify.annotations.NonNull

Fetches data from the INSPIRE database.

Field Summary

Modifier and TypeField and Description
private final ImportFormatPreferences
private static final String
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
doPostCleanup(BibEntry entry)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

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 Parser
getParser()

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Returns the parser used to convert the response to a list of BibEntry.

public URLDownload
getUrlDownload(URL url)

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

Constructs an URLDownload object for downloading content based on the given URL.

public URL
getURLForQuery(BaseQueryNode queryNode)

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the lucene query.

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

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

Looks for hits which are matched by the given BibEntry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
INSPIRE_ARXIV_HOSTback to summary
private static final String INSPIRE_ARXIV_HOST
INSPIRE_DOI_HOSTback to summary
private static final String INSPIRE_DOI_HOST
INSPIRE_HOSTback to summary
private static final String INSPIRE_HOST

Constructor Detail

INSPIREFetcherback to summary
public INSPIREFetcher(ImportFormatPreferences preferences)

Method Detail

doPostCleanupback to summary
public void doPostCleanup(BibEntry entry)

Overrides default org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Doc from org.jabref.logic.importer.ParserFetcher.doPostCleanup.

Performs a cleanup of the fetched entry.

Only systematic errors of the fetcher should be corrected here (i.e. if information is consistently contained in the wrong field or the wrong format) but not cosmetic issues which may depend on the user's taste (for example, LateX code vs HTML in the abstract).

Try to reuse existing org.jabref.logic.formatter.Formatter for the cleanup. For example, new FieldFormatterCleanup(StandardField.TITLE, new RemoveBracesFormatter()).cleanup(entry);

By default, no cleanup is done.

Annotations
@Override
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
getParserback to summary
public Parser getParser()

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Doc from org.jabref.logic.importer.SearchBasedParserFetcher.getParser.

Returns the parser used to convert the response to a list of BibEntry.

Annotations
@Override
getUrlDownloadback to summary
public URLDownload getUrlDownload(URL url)

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

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

Constructs an URLDownload object for downloading content based on the given URL. Overwrite, if you need to send additional headers for the download.

Annotations
@Override
getURLForQueryback to summary
public URL getURLForQuery(BaseQueryNode queryNode) throws URISyntaxException, MalformedURLException

Implements org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Doc from org.jabref.logic.importer.SearchBasedParserFetcher.getURLForQuery.

Constructs a URL based on the lucene query.

Annotations
@Override
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