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

public Class LOBIDFetcher

extends Object
implements PagedSearchBasedParserFetcher
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.PagedSearchBasedParserFetcher, org.jabref.logic.importer.ParserFetcher, org.jabref.logic.importer.PagedSearchBasedFetcher, org.jabref.logic.importer.SearchBasedFetcher, org.jabref.logic.importer.WebFetcher, org.jabref.logic.importer.SearchBasedParserFetcher
Imports
java.io.BufferedReader, .InputStreamReader, java.net.MalformedURLException, .URISyntaxException, .URL, java.util.ArrayList, .List, .Objects, .Optional, java.util.stream.Collectors, .IntStream, org.jabref.logic.importer.FetcherException, .ImporterPreferences, .PagedSearchBasedParserFetcher, .Parser, org.jabref.logic.importer.fetcher.transformers.LOBIDQueryTransformer, org.jabref.logic.util.OS, org.jabref.model.entry.BibEntry, org.jabref.model.entry.field.Field, .StandardField, org.jabref.model.entry.types.EntryType, .StandardEntryType, kong.unirest.core.json.JSONArray, kong.unirest.core.json.JSONObject, org.apache.hc.core5.net.URIBuilder, org.apache.lucene.queryparser.flexible.core.nodes.QueryNode, org.slf4j.Logger, .LoggerFactory

Fetches data from the LOBID API
See Also
API documentation for more details

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
LOBIDFetcher(ImporterPreferences importerPreferences)

Method Summary

Modifier and TypeMethod and Description
private static List<String>
getAuthorNames(kong.unirest.core.json.JSONArray authors)

private static String
getFirstArrayElement(kong.unirest.core.json.JSONObject jsonEntry, String key)

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

Returns:

URL
getURLForQuery
(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the search query
luceneQuery
,
int
the number of the page indexed from 0
pageNumber
)

Implements org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForQuery.

Gets the query URL

private BibEntry
parseJSONtoBibtex(kong.unirest.core.json.JSONObject jsonEntry)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

API_URLback to summary
private static final String API_URL
FETCHER_NAMEback to summary
public static final String FETCHER_NAME
importerPreferencesback to summary
private final ImporterPreferences importerPreferences
LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

LOBIDFetcherback to summary
public LOBIDFetcher(ImporterPreferences importerPreferences)

Method Detail

getAuthorNamesback to summary
private static List<String> getAuthorNames(kong.unirest.core.json.JSONArray authors)
getFirstArrayElementback to summary
private static String getFirstArrayElement(kong.unirest.core.json.JSONObject jsonEntry, String key)
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
getURLForQueryback to summary
public URL getURLForQuery(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery, int pageNumber) throws URISyntaxException, MalformedURLException, FetcherException

Implements org.jabref.logic.importer.PagedSearchBasedParserFetcher.getURLForQuery.

Gets the query URL

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

the search query

pageNumber:int

the number of the page indexed from 0

Returns:URL

URL

Annotations
@Override
parseJSONtoBibtexback to summary
private BibEntry parseJSONtoBibtex(kong.unirest.core.json.JSONObject jsonEntry)