Verified Owner
Top Description Fields Constructors Methods
org.jabref.logic.importer.fileformat

public Class MedlinePlainImporter

extends Importer
Class Inheritance
Imports
java.io.BufferedReader, .IOException, .Reader, java.util.ArrayList, .HashMap, .List, .Locale, .Map, java.util.regex.Pattern, org.jabref.logic.importer.ImportFormatPreferences, .Importer, .ParserResult, org.jabref.logic.importer.fileformat.medline.MeshHeading, org.jabref.logic.l10n.Localization, org.jabref.logic.util.StandardFileType, org.jabref.model.entry.AuthorList, .BibEntry, org.jabref.model.entry.field.Field, .StandardField, .UnknownField, org.jabref.model.entry.types.EntryType, .StandardEntryType, org.jspecify.annotations.NonNull

Importer for the MEDLINE Plain format.

check here for details on the format ...

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final Pattern
private final ImportFormatPreferences
private static final Pattern
private static final Pattern
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
addIDs(Map<Field, String> hm, String lab, String value)

private EntryType
private void
private void
private boolean
private void
fixAuthors(Map<Field, String> hm, String author, Field field)

public String
getDescription()

Implements abstract org.jabref.logic.importer.Importer.getDescription.

Returns the description of the import format.

public StandardFileType
getFileType()

Implements abstract org.jabref.logic.importer.Importer.getFileType.

Returns the type of files that this importer can read

public String
getId()

Implements abstract org.jabref.logic.importer.Importer.getId.

Returns a slug, which identifies this importer.

public String
getName()

Implements abstract org.jabref.logic.importer.Importer.getName.

Returns the name of this import format.

public ParserResult
importDatabase(@NonNull BufferedReader reader)

Implements abstract org.jabref.logic.importer.Importer.importDatabase.

Parse the database in the source.

private boolean
private boolean
public boolean
isRecognizedFormat(@NonNull Reader reader)

Overrides org.jabref.logic.importer.Importer.isRecognizedFormat.

#isRecognizedFormat(BufferedReader) without the requirement to reset

private List<String>
parseMeshTerm(String meshTerm)

Parses a MeSH term from MEDLINE plain format (e.g. *Kidney Diseases/diagnosis/epidemiology) into a MeshHeading and renders it as individual keywords (e.g. ["Kidney Diseases*/diagnosis", "Kidney Diseases*/epidemiology"]).

Inherited from org.jabref.logic.importer.Importer:
compareToequalsgetCharsetgetReadergetReaderhashCodeimportDatabaseimportDatabaseisRecognizedFormatisRecognizedFormatisRecognizedFormatsupportsFileExtensiontoString

Field Detail

COMPLETE_DATE_PATTERNback to summary
private static final Pattern COMPLETE_DATE_PATTERN
CREATE_DATE_PATTERNback to summary
private static final Pattern CREATE_DATE_PATTERN
importFormatPreferencesback to summary
private final ImportFormatPreferences importFormatPreferences
PMC_PATTERNback to summary
private static final Pattern PMC_PATTERN
PMCR_PATTERNback to summary
private static final Pattern PMCR_PATTERN
PMID_PATTERNback to summary
private static final Pattern PMID_PATTERN

Constructor Detail

MedlinePlainImporterback to summary
public MedlinePlainImporter(ImportFormatPreferences importFormatPreferences)

Method Detail

addAbstractback to summary
private void addAbstract(Map<Field, String> hm, String lab, String value)
addDatesback to summary
private void addDates(Map<Field, String> hm, String lab, String val)
addIDsback to summary
private void addIDs(Map<Field, String> hm, String lab, String value)
addSourceTypeback to summary
private EntryType addSourceType(String value, EntryType type)
addStandardNumberback to summary
private void addStandardNumber(Map<Field, String> hm, String lab, String value)
addTitlesback to summary
private void addTitles(Map<Field, String> hm, String lab, String val, EntryType type)
checkLineValidityback to summary
private boolean checkLineValidity(String line)
fixAuthorsback to summary
private void fixAuthors(Map<Field, String> hm, String author, Field field)
getDescriptionback to summary
public String getDescription()

Implements abstract org.jabref.logic.importer.Importer.getDescription.

Doc from org.jabref.logic.importer.Importer.getDescription.

Returns the description of the import format.

The description should specify
what kind of entries from what sources and based on what specification it is able to import

by what criteria it isRecognizedFormat(BufferedReader) recognizes an import format

Annotations
@Override
getFileTypeback to summary
public StandardFileType getFileType()

Implements abstract org.jabref.logic.importer.Importer.getFileType.

Doc from org.jabref.logic.importer.Importer.getFileType.

Returns the type of files that this importer can read

Annotations
@Override
getIdback to summary
public String getId()

Implements abstract org.jabref.logic.importer.Importer.getId.

Doc from org.jabref.logic.importer.Importer.getId.

Returns a slug, which identifies this importer. Used, for example, to identify the importer in CLI.

Typically, this name should be short, in English, and should not contain special characters like #, %, etc.

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract org.jabref.logic.importer.Importer.getName.

Doc from org.jabref.logic.importer.Importer.getName.

Returns the name of this import format. Typically, this is a string that denotes file type or format. It can also be localized, like "XMP-annotated PDF".

Annotations
@Override
importDatabaseback to summary
public ParserResult importDatabase(@NonNull BufferedReader reader) throws IOException

Implements abstract org.jabref.logic.importer.Importer.importDatabase.

Doc from org.jabref.logic.importer.Importer.importDatabase.

Parse the database in the source.

This method can be called in two different contexts - either when importing in a specified format, or when importing in unknown format. In the latter case, JabRef cycles through all available import formats. No error messages or feedback is displayed from individual import formats in this case.

If importing in a specified format and an empty library is returned, JabRef reports that no entries were found.

If your format is binary-based (PDF, ZIP-based, or others), then you should not solely override this method. For binary formats do this:

  1. Throw UnsupportedOperationException in this method.
  2. Override the method Importer#importDatabase(Path). Example of this workaround is in: org.jabref.logic.importer.fileformat.pdf.PdfImporter.
Annotations
@Override
isCreateDateFormatback to summary
private boolean isCreateDateFormat(String value)
isDateFormatback to summary
private boolean isDateFormat(String value)
isRecognizedFormatback to summary
public boolean isRecognizedFormat(@NonNull Reader reader) throws IOException

Overrides org.jabref.logic.importer.Importer.isRecognizedFormat.

Doc from org.jabref.logic.importer.Importer.isRecognizedFormat.

#isRecognizedFormat(BufferedReader) without the requirement to reset

Annotations
@Override
parseMeshTermback to summary
private List<String> parseMeshTerm(String meshTerm)

Parses a MeSH term from MEDLINE plain format (e.g. *Kidney Diseases/diagnosis/epidemiology) into a MeshHeading and renders it as individual keywords (e.g. ["Kidney Diseases*/diagnosis", "Kidney Diseases*/epidemiology"]).