From f62bef023e6dba2751a714ecf181ff7c42a36a55 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Fri, 11 Mar 2022 20:14:48 +0100 Subject: [PATCH] Refine documentation (#8551) * Refine documentation * Update SearchBasedParserFetcher.java Co-authored-by: Siedlerchr Co-authored-by: Tobias Diez --- .../logic/importer/SearchBasedParserFetcher.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java index 1d9c2882acf..29756cdf6ea 100644 --- a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java @@ -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; @@ -20,7 +21,13 @@ *
  • Post-process fetched entries
  • * *

    - * 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. + *

    + *

    + * 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}. *

    *

    @@ -28,6 +35,10 @@ * As non-BibTeX web fetcher one could do "magic" stuff without this helper interface and directly use {@link WebFetcher}, but this is more work. *

    *

    + * The idea is the one can reuse an importer in the place of a Parser. + * See {@link MedlineFetcher#getParser()} for an example. + *

    + *

    * 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).