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

public Class BiodiversityLibrary

extends Object
implements SearchBasedParserFetcher, CustomizableKeyFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.fetcher.CustomizableKeyFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.SearchBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.SearchBasedFetcher
Imports
java.io.IOException, java.net.MalformedURLException, .URISyntaxException, .URL, java.util.ArrayList, .Collections, .List, java.util.stream.IntStream, org.jabref.logic.importer.FetcherException, .ImporterPreferences, .ParseException, .Parser, .SearchBasedParserFetcher, org.jabref.logic.importer.fetcher.transformers.BiodiversityLibraryTransformer, org.jabref.logic.importer.util.JsonReader, org.jabref.logic.net.URLDownload, org.jabref.logic.util.BuildInfo, org.jabref.model.entry.Author, .AuthorList, .BibEntry, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.StandardEntryType, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONException, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.apache.lucene.queryparser.flexible.core.nodes.QueryNode, org.tinylog.Logger

Fetches data from the Biodiversity Heritage Library
See Also
API documentation

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public URL
public kong.unirest.core.json.JSONObject
public URL
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 URL
public String
public URL
getURLForQuery(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the root node of the lucene query
luceneQuery
)

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

Constructs a URL based on the lucene query.

public BibEntry
jsonResultToBibEntry(kong.unirest.core.json.JSONObject item)

public BibEntry
parseBibJSONtoBibtex(kong.unirest.core.json.JSONObject item, BibEntry entry)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

API_KEYback to summary
private static final String API_KEY
BASE_URLback to summary
private static final String BASE_URL
FETCHER_NAMEback to summary
private static final String FETCHER_NAME
importerPreferencesback to summary
private final ImporterPreferences importerPreferences
RESPONSE_FORMATback to summary
private static final String RESPONSE_FORMAT
TEST_URL_WITHOUT_API_KEYback to summary
private static final String TEST_URL_WITHOUT_API_KEY

Constructor Detail

BiodiversityLibraryback to summary
public BiodiversityLibrary(ImporterPreferences importerPreferences)

Method Detail

getBaseURLback to summary
public URL getBaseURL() throws URISyntaxException, MalformedURLException
getDetailsback to summary
public kong.unirest.core.json.JSONObject getDetails(URL url) throws IOException
getItemMetadataURLback to summary
public URL getItemMetadataURL(String identifier) throws URISyntaxException, MalformedURLException
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
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
getPartMetadataURLback to summary
public URL getPartMetadataURL(String identifier) throws URISyntaxException, MalformedURLException
getTestUrlback to summary
public String getTestUrl()

Overrides default org.jabref.logic.importer.fetcher.CustomizableKeyFetcher.getTestUrl.

Annotations
@Override
getURLForQueryback to summary
public URL getURLForQuery(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery) throws URISyntaxException, MalformedURLException, FetcherException

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

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

Constructs a URL based on the lucene query.

Parameters
luceneQuery:org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

the root node of the lucene query

Annotations
@Override
jsonResultToBibEntryback to summary
public BibEntry jsonResultToBibEntry(kong.unirest.core.json.JSONObject item)
parseBibJSONtoBibtexback to summary
public BibEntry parseBibJSONtoBibtex(kong.unirest.core.json.JSONObject item, BibEntry entry) throws IOException, URISyntaxException
toAuthorsback to summary
private String toAuthors(kong.unirest.core.json.JSONArray authors)