Skip to content

Commit

Permalink
Refine documentation (#8551)
Browse files Browse the repository at this point in the history
* Refine documentation

* Update SearchBasedParserFetcher.java


Co-authored-by: Siedlerchr <siederkiller@gmail.com>
Co-authored-by: Tobias Diez <tobiasdiez@gmx.de>
  • Loading branch information
3 people authored Mar 11, 2022
1 parent 1134eb8 commit f62bef0
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;

import org.jabref.logic.cleanup.Formatter;
import org.jabref.logic.importer.fetcher.MedlineFetcher;
import org.jabref.model.entry.BibEntry;

import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode;
Expand All @@ -20,14 +21,24 @@
* <li>Post-process fetched entries</li>
* </ol>
* <p>
* This interface is used for web resources which do NOT provide BibTeX data {@link BibEntry}.
* Normally, a fetcher invokes an API and then parses the response (to get BibEntries).
* This kind of workflow is supported by the parser-based fetcher.
* Sometimes you need to have more flexibility, i.e. call multiple endpoints and merge the results etc.
* In theses cases, one has to use the non-parser-based fetcher interfaces.
* <p>
* <p>
* This interface is used for web resources which do NOT provide BibTeX data {@link BibEntry} directly.
* JabRef's infrastructure to convert arbitrary input data to BibTeX is {@link Parser}.
* </p>
* <p>
* This interface inherits {@link SearchBasedFetcher}, because the methods <code>performSearch</code> have to be provided by both.
* As non-BibTeX web fetcher one could do "magic" stuff without this helper interface and directly use {@link WebFetcher}, but this is more work.
* </p>
* <p>
* The idea is the one can reuse an importer in the place of a Parser.
* See {@link MedlineFetcher#getParser()} for an example.
* </p>
* <p>
* 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 {@link IdBasedFetcher}), complete entry {@link EntryBasedFetcher}, and search-based fetcher (this class).
Expand Down

0 comments on commit f62bef0

Please sign in to comment.