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

public Class EndnoteXmlImporter

extends Importer
implements Parser
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.Parser
Imports
java.io.BufferedReader, .IOException, .InputStream, .InputStreamReader, .Reader, java.nio.charset.StandardCharsets, java.util.ArrayList, .List, .Locale, .Map, .StringJoiner, javax.xml.stream.XMLInputFactory, .XMLStreamException, .XMLStreamReader, javax.xml.stream.events.XMLEvent, org.jabref.logic.importer.ImportFormatPreferences, .Importer, .ParseException, .Parser, .ParserResult, org.jabref.logic.l10n.Localization, org.jabref.logic.util.StandardFileType, org.jabref.model.entry.BibEntry, .KeywordList, org.jabref.model.entry.field.Field, .StandardField, .UnknownField, org.jabref.model.entry.types.EntryType, .IEEETranEntryType, .StandardEntryType, org.jspecify.annotations.NonNull, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final Map<EntryType, String>
private static final UnknownField
private static final Map<Field, String>
private static final Logger
private final ImportFormatPreferences
private final XMLInputFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
clean(String input)

private void
extractPersons(XMLStreamReader reader, String elementName, BibEntry entry, StandardField author)

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 input)

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

Parse the database in the source.

private boolean
isEndElement(XMLStreamReader reader, String elementName)

private boolean
public boolean
isRecognizedFormat(@NonNull Reader reader)

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

#isRecognizedFormat(BufferedReader) without the requirement to reset

private boolean
isStartElement(XMLStreamReader reader, String elementName)

private boolean
private void
private void
private String
public List<BibEntry>
private void
private void
private void
private BibEntry
private void
private void
Inherited from org.jabref.logic.importer.Importer:
compareToequalsgetCharsetgetReadergetReaderhashCodeimportDatabaseimportDatabaseisRecognizedFormatisRecognizedFormatisRecognizedFormatsupportsFileExtensiontoString

Field Detail

ENTRY_TYPE_MAPPINGback to summary
private static final Map<EntryType, String> ENTRY_TYPE_MAPPING
FIELD_ALT_TITLEback to summary
private static final UnknownField FIELD_ALT_TITLE
FIELD_MAPPINGback to summary
private static final Map<Field, String> FIELD_MAPPING
LOGGERback to summary
private static final Logger LOGGER

Hides org.jabref.logic.importer.Importer.LOGGER.

preferencesback to summary
private final ImportFormatPreferences preferences
xmlInputFactoryback to summary
private final XMLInputFactory xmlInputFactory

Constructor Detail

EndnoteXmlImporterback to summary
public EndnoteXmlImporter(ImportFormatPreferences preferences)

Method Detail

cleanback to summary
private String clean(String input)
extractPersonsback to summary
private void extractPersons(XMLStreamReader reader, String elementName, BibEntry entry, StandardField author) throws XMLStreamException
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 input) 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
isEndElementback to summary
private boolean isEndElement(XMLStreamReader reader, String elementName)
isEndElementback to summary
private boolean isEndElement(XMLStreamReader reader)
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
isStartElementback to summary
private boolean isStartElement(XMLStreamReader reader, String elementName)
isStartElementback to summary
private boolean isStartElement(XMLStreamReader reader)
parseContributorsback to summary
private void parseContributors(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parseDatesback to summary
private void parseDates(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parseElementContentback to summary
private String parseElementContent(XMLStreamReader reader, String elementName) throws XMLStreamException
parseEntriesback to summary
public List<BibEntry> parseEntries(InputStream inputStream) throws ParseException

Implements org.jabref.logic.importer.Parser.parseEntries.

Annotations
@Override
parseJournalOrBookTitleback to summary
private void parseJournalOrBookTitle(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parseKeywordsback to summary
private void parseKeywords(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parsePeriodicalback to summary
private void parsePeriodical(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parseRecordback to summary
private BibEntry parseRecord(XMLStreamReader reader) throws XMLStreamException
parseTitlesback to summary
private void parseTitles(XMLStreamReader reader, BibEntry entry) throws XMLStreamException
parseUrlsback to summary
private void parseUrls(XMLStreamReader reader, BibEntry entry) throws XMLStreamException