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.JstorFetcher, 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.DBLPFetcher, org.jabref.logic.importer.fetcher.DOABFetcher, org.jabref.logic.importer.fetcher.DOAJFetcher, org.jabref.logic.importer.fetcher.GvkFetcher, org.jabref.logic.importer.fetcher.INSPIREFetcher, org.jabref.logic.importer.fetcher.MathSciNet, 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.apache.lucene.queryparser.flexible.core.nodes.QueryNode

Provides a convenient interface for search-based fetcher, which follows the usual three-step procedure:
  1. Open a URL based on the search query
  2. Parse the response to get a list of BibEntry
  3. Post-process fetched entries

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(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the root node of the lucene query
luceneQuery
)

Constructs a URL based on the lucene query.

public default List<BibEntry>
performSearch(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode
the root node of the lucene query
luceneQuery
)

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:
performSearch

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(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery) throws URISyntaxException, MalformedURLException, FetcherException

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

performSearchback to summary
public default List<BibEntry> performSearch(org.apache.lucene.queryparser.flexible.core.nodes.QueryNode luceneQuery) 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
luceneQuery:org.apache.lucene.queryparser.flexible.core.nodes.QueryNode

the root node of the lucene query

Returns:List<BibEntry>

Doc from org.jabref.logic.importer.SearchBasedFetcher.performSearch.

a list of BibEntry, which are matched by the query (may be empty)

Annotations
@Override