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

public Class OpenLibraryIsbnFetcher

extends AbstractIsbnFetcher
Class Inheritance
Imports
java.net.MalformedURLException, .URISyntaxException, .URL, java.util.List, .Optional, java.util.stream.Collectors, .IntStream, .Stream, org.jabref.logic.importer.AuthorListParser, .FetcherClientException, .FetcherException, .ImportFormatPreferences, .ParseException, .Parser, org.jabref.logic.importer.fetcher.AbstractIsbnFetcher, org.jabref.logic.importer.util.JsonReader, org.jabref.logic.util.strings.StringUtil, org.jabref.model.entry.Author, .AuthorList, .BibEntry, .Date, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.StandardEntryType, kong.unirest.core.JsonNode, kong.unirest.core.Unirest, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.slf4j.Logger, .LoggerFactory

Fetcher for OpenLibrary. API documentation.

Field Summary

Modifier and TypeField and Description
private static final String
private static final Logger
Inherited from org.jabref.logic.importer.fetcher.AbstractIsbnFetcher:
importFormatPreferences

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.

private String
fromWorksToAuthors(kong.unirest.core.json.JSONArray works)

private Stream<Author>
public String
getName()

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

Returns the localized name of this fetcher.

public Parser
public URL
getUrlForIdentifier(String identifier)

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

private BibEntry
jsonItemToBibEntry(kong.unirest.core.json.JSONObject item)

public Optional<BibEntry>
performSearchById(String identifier)

Overrides default org.jabref.logic.importer.IdBasedParserFetcher.performSearchById.

Looks for bibliographic information associated to the given identifier.

private Author
private String
toAuthors(kong.unirest.core.json.JSONArray authors)

Inherited from org.jabref.logic.importer.fetcher.AbstractIsbnFetcher:
ensureThatIsbnIsValidgetHelpPage

Field Detail

BASE_URLback to summary
private static final String BASE_URL
LOGGERback to summary
private static final Logger LOGGER

Hides org.jabref.logic.importer.IdBasedParserFetcher.LOGGER.

Constructor Detail

OpenLibraryIsbnFetcherback to summary
public OpenLibraryIsbnFetcher(ImportFormatPreferences importFormatPreferences)

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
fromWorksToAuthorsback to summary
private String fromWorksToAuthors(kong.unirest.core.json.JSONArray works)
fromWorkToAuthorsback to summary
private Stream<Author> fromWorkToAuthors(String link)
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()

Overrides org.jabref.logic.importer.fetcher.AbstractIsbnFetcher.getParser.

Implements org.jabref.logic.importer.IdBasedParserFetcher.getParser.

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

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

Annotations
@Override
getUrlForIdentifierback to summary
public URL getUrlForIdentifier(String identifier) throws URISyntaxException, MalformedURLException

Implements org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Doc from org.jabref.logic.importer.IdBasedParserFetcher.getUrlForIdentifier.

Constructs a URL based on the query.

Annotations
@Override
jsonItemToBibEntryback to summary
private BibEntry jsonItemToBibEntry(kong.unirest.core.json.JSONObject item) throws ParseException
performSearchByIdback to summary
public Optional<BibEntry> performSearchById(String identifier) throws FetcherException

Overrides default org.jabref.logic.importer.IdBasedParserFetcher.performSearchById.

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

Looks for bibliographic information associated to the given identifier.

Annotations
@Override
toAuthorback to summary
private Author toAuthor(String key)
toAuthorsback to summary
private String toAuthors(kong.unirest.core.json.JSONArray authors)