Verified Owner
Top Description Methods
org.jabref.logic.importer

public Interface SearchBasedParserFetcher

extends SearchBasedFetcher, ParserFetcher
Known Direct Subinterfaces
org.jabref.logic.importer.PagedSearchBasedParserFetcher
Known Direct Implementers
org.jabref.logic.importer.fetcher.DBLPFetcher, org.jabref.logic.importer.fetcher.ACMPortalFetcher, org.jabref.logic.importer.fetcher.BiodiversityLibrary, org.jabref.logic.importer.fetcher.BvbFetcher, org.jabref.logic.importer.fetcher.CollectionOfComputerScienceBibliographiesFetcher, org.jabref.logic.importer.fetcher.CrossRef, org.jabref.logic.importer.fetcher.DOABFetcher, org.jabref.logic.importer.fetcher.DOAJFetcher, org.jabref.logic.importer.fetcher.EuropePmcFetcher, org.jabref.logic.importer.fetcher.GvkFetcher, org.jabref.logic.importer.fetcher.INSPIREFetcher, org.jabref.logic.importer.fetcher.JstorFetcher, org.jabref.logic.importer.fetcher.MathSciNet, org.jabref.logic.importer.fetcher.OpenAlex, org.jabref.logic.importer.fetcher.ZbMATH
Imports
java.io.IOException, .InputStream, java.net.MalformedURLException, .URISyntaxException, .URL, java.util.List, org.jabref.model.entry.BibEntry, org.jabref.model.search.query.BaseQueryNode

Provides a convenient interface for search-based fetcher, which follows the usual three-step procedure:

This interface is used for web resources which do NOT provide BibTeX data BibEntry. JabRef's infrastructure to convert arbitrary input data to BibTeX is Parser.

This interface inherits SearchBasedFetcher, because the methods performSearch have to be provided by both. As non-BibTeX web fetcher one could do "magic" stuff without this helper interface and directly use WebFetcher, but this is more work.

Note that this interface "should" be an abstract class. However, Java does not support multi inheritance with classes (but with interfaces). We need multi inheritance, because a fetcher might implement multiple query types (such as id fetching IdBasedFetcher), complete entry EntryBasedFetcher, and search-based fetcher (this class).

Method Summary

Modifier and TypeMethod and Description
private List<BibEntry>
getBibEntries(URL urlForQuery)

public Parser
getParser()

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

public URL
getURLForQuery(BaseQueryNode
the list that contains the parsed nodes
queryList
)

Constructs a URL based on the lucene query.

public default URL
getURLForRawQuery(String
catalog-native query string sent verbatim to the catalog
rawQuery
)

Constructs a URL that sends the raw, catalog-native query verbatim to the catalog (bypassing the query transformer).

public default List<BibEntry>
performRawSearchQuery(String rawQuery)

Overrides default org.jabref.logic.importer.SearchBasedFetcher.performRawSearchQuery.

Default implementation: builds the URL via getURLForRawQuery(String), then downloads, parses, and post-cleans the result.

public default List<BibEntry>
performSearch(BaseQueryNode
the first search node
queryNode
)

Implements org.jabref.logic.importer.SearchBasedFetcher.performSearch.

This method is used to send queries with advanced URL parameters.

Inherited from org.jabref.logic.importer.ParserFetcher:
doPostCleanup
Inherited from org.jabref.logic.importer.SearchBasedFetcher:
getQueryNodeperformSearch

Method Detail

getBibEntriesback to summary
private List<BibEntry> getBibEntries(URL urlForQuery) throws FetcherException
getParserback to summary
public Parser getParser()

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

getURLForQueryback to summary
public URL getURLForQuery(BaseQueryNode queryList) throws URISyntaxException, MalformedURLException, FetcherException

Constructs a URL based on the lucene query.

Parameters
queryList:BaseQueryNode

the list that contains the parsed nodes

getURLForRawQueryback to summary
public default URL getURLForRawQuery(String rawQuery) throws URISyntaxException, MalformedURLException, FetcherException

Constructs a URL that sends the raw, catalog-native query verbatim to the catalog (bypassing the query transformer).

Parameters
rawQuery:String

catalog-native query string sent verbatim to the catalog

performRawSearchQueryback to summary
public default List<BibEntry> performRawSearchQuery(String rawQuery) throws FetcherException

Overrides default org.jabref.logic.importer.SearchBasedFetcher.performRawSearchQuery.

Default implementation: builds the URL via getURLForRawQuery(String), then downloads, parses, and post-cleans the result.

Annotations
@Override
performSearchback to summary
public default List<BibEntry> performSearch(BaseQueryNode queryNode) throws FetcherException

Implements org.jabref.logic.importer.SearchBasedFetcher.performSearch.

This method is used to send queries with advanced URL parameters. This method is necessary as the performSearch method does not support certain URL parameters that are used for fielded search, such as a title, author, or year parameter.

Parameters
queryNode:BaseQueryNode

the first search node

Annotations
@Override