Top Inners Fields Constructors Methods
org.jabref.logic.importer.fileformat

public Class CitaviXmlImporter

extends Importer
implements Parser
Class Inheritance
All Implemented Interfaces
org.jabref.logic.importer.Parser
Imports
java.io.BufferedInputStream, .BufferedReader, .FileInputStream, .IOException, .InputStream, .InputStreamReader, .PushbackInputStream, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, .StandardCopyOption, .StandardOpenOption, java.util.ArrayList, .Collections, .EnumSet, .HashMap, .List, .Locale, .Map, .Objects, .Optional, .StringJoiner, java.util.function.Predicate, java.util.stream.Collectors, java.util.zip.ZipEntry, .ZipInputStream, javax.xml.stream.XMLInputFactory, .XMLStreamException, .XMLStreamReader, org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter, .NormalizePagesFormatter, org.jabref.logic.importer.Importer, .Parser, .ParserResult, org.jabref.logic.importer.fileformat.citavi.CitaviExchangeData, .CitaviExchangeData.KnowledgeItems, .CitaviExchangeData.KnowledgeItems.KnowledgeItem, .CitaviExchangeData.Persons.Person, org.jabref.logic.util.StandardFileType, org.jabref.model.entry.Author, .AuthorList, .BibEntry, .Keyword, .KeywordList, org.jabref.model.entry.field.StandardField, org.jabref.model.entry.types.EntryType, .IEEETranEntryType, .StandardEntryType, org.jabref.model.strings.StringUtil, jakarta.xml.bind.JAXBContext, .JAXBException, .Unmarshaller, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final HtmlToLatexFormatter
private CitaviExchangeData.Keywords
private CitaviExchangeData.KnowledgeItems
private final Map<String, Keyword>
private final Map<String, Author>
private final Map<String, String>
private static final Logger
private final NormalizePagesFormatter
private CitaviExchangeData.Persons
private CitaviExchangeData.Publishers
private static final EnumSet<CitaviXmlImporter.QuotationTypeMapping>
private CitaviExchangeData.ReferenceAuthors
private CitaviExchangeData.ReferenceEditors
private Map<String, String>
private Map<String, String>
private Map<String, String>
private Map<String, String>
private CitaviExchangeData.ReferenceKeywords
private CitaviExchangeData.ReferencePublishers
private Unmarshaller
private static final byte
private static final byte
private final XMLInputFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Map<String, String>
buildKeywordList(List<String> keywordsList)

private Map<String, String>
buildPersonList(List<String> authorsOrEditors)

private Map<String, String>
buildPublisherList(List<String> publishersList)

private static InputStream
private String
clean(String input)

pack-priv String
private static EntryType
private String
public String
getDescription()

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

Returns the description of the import format.

private String
public StandardFileType
getFileType()

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

Returns the type of files that this importer can read

public String
getId()

Overrides org.jabref.logic.importer.Importer.getId.

Returns a one-word ID which identifies this importer.

private String
private String
public String
getName()

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

Returns the name of this import format.

private String
private String
private BufferedReader
private EntryType
public ParserResult
importDatabase(Path
the path to the file which should be imported
filePath
)

Overrides org.jabref.logic.importer.Importer.importDatabase.

Parse the database in the specified file.

public ParserResult
importDatabase(BufferedReader
the input to read from
reader
)

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

Parse the database in the source.

private void
public boolean
isRecognizedFormat(BufferedReader reader)

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

Check whether the source is in the correct format for this importer.

public boolean
isRecognizedFormat(Path
the path of the file to check
filePath
)

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

Check whether the source is in the correct format for this importer.

private BibEntry
private List<BibEntry>
public List<BibEntry>
private String
private Object
Inherited from org.jabref.logic.importer.Importer:
compareToequalsgetCharsetgetReadergetReaderhashCodeimportDatabaseisRecognizedFormattoString

Field Detail

htmlToLatexFormatterback to summary
private final HtmlToLatexFormatter htmlToLatexFormatter
keywordsback to summary
private CitaviExchangeData.Keywords keywords
knowledgeItemsback to summary
private CitaviExchangeData.KnowledgeItems knowledgeItems
knownKeywordsback to summary
private final Map<String, Keyword> knownKeywords
knownPersonsback to summary
private final Map<String, Author> knownPersons
knownPublishersback to summary
private final Map<String, String> knownPublishers
LOGGERback to summary
private static final Logger LOGGER

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

pagesFormatterback to summary
private final NormalizePagesFormatter pagesFormatter
personsback to summary
private CitaviExchangeData.Persons persons
publishersback to summary
private CitaviExchangeData.Publishers publishers
QUOTATION_TYPESback to summary
private static final EnumSet<CitaviXmlImporter.QuotationTypeMapping> QUOTATION_TYPES
refAuthorsback to summary
private CitaviExchangeData.ReferenceAuthors refAuthors
refEditorsback to summary
private CitaviExchangeData.ReferenceEditors refEditors
refIdWithAuthorsback to summary
private Map<String, String> refIdWithAuthors
refIdWithEditorsback to summary
private Map<String, String> refIdWithEditors
refIdWithKeywordsback to summary
private Map<String, String> refIdWithKeywords
refIdWithPublishersback to summary
private Map<String, String> refIdWithPublishers
refKeywordsback to summary
private CitaviExchangeData.ReferenceKeywords refKeywords
refPublishersback to summary
private CitaviExchangeData.ReferencePublishers refPublishers
unmarshallerback to summary
private Unmarshaller unmarshaller
UUID_LENGTHback to summary
private static final byte UUID_LENGTH
UUID_SEMICOLON_OFFSET_INDEXback to summary
private static final byte UUID_SEMICOLON_OFFSET_INDEX
xmlInputFactoryback to summary
private final XMLInputFactory xmlInputFactory

Constructor Detail

CitaviXmlImporterback to summary
public CitaviXmlImporter()

Method Detail

buildKeywordListback to summary
private Map<String, String> buildKeywordList(List<String> keywordsList)
buildPersonListback to summary
private Map<String, String> buildPersonList(List<String> authorsOrEditors)
buildPublisherListback to summary
private Map<String, String> buildPublisherList(List<String> publishersList)
checkForUtf8BOMAndDiscardIfAnyback to summary
private static InputStream checkForUtf8BOMAndDiscardIfAny(InputStream inputStream) throws IOException
cleanback to summary
private String clean(String input)
cleanUpTextback to summary
pack-priv String cleanUpText(String text)
convertRefNameToTypeback to summary
private static EntryType convertRefNameToType(String refName)
getAuthorNameback to summary
private String getAuthorName(CitaviExchangeData.References.Reference data)
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 recognizes an import format
Returns:String

description of the import format

Annotations
@Override
getEditorNameback to summary
private String getEditorName(CitaviExchangeData.References.Reference data)
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

Returns:StandardFileType

FileType corresponding to the importer

Annotations
@Override
getIdback to summary
public String getId()

Overrides org.jabref.logic.importer.Importer.getId.

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

Returns a one-word ID which identifies this importer. Used for example, to identify the importer when used from the command line.

Returns:String

ID, must be unique and not null

Annotations
@Override
getKeywordsback to summary
private String getKeywords(CitaviExchangeData.References.Reference data)
getKnowledgeItemback to summary
private String getKnowledgeItem(CitaviExchangeData.References.Reference data)
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.

The name must be unique.

Returns:String

format name, must be unique and not null

Annotations
@Override
getPagesback to summary
private String getPages(CitaviExchangeData.References.Reference data)
getPublisherback to summary
private String getPublisher(CitaviExchangeData.References.Reference data)
getReaderFromZipback to summary
private BufferedReader getReaderFromZip(Path filePath) throws IOException
getTypeback to summary
private EntryType getType(CitaviExchangeData.References.Reference data)
importDatabaseback to summary
public ParserResult importDatabase(Path filePath) throws IOException

Overrides org.jabref.logic.importer.Importer.importDatabase.

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

Parse the database in the specified file.

Parameters
filePath:Path

the path to the file which should be imported

Annotations
@Override
importDatabaseback to summary
public ParserResult importDatabase(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.

This method should never return null.

Parameters
reader:BufferedReader

the input to read from

Annotations
@Override
initUnmarshallerback to summary
private void initUnmarshaller() throws JAXBException
isRecognizedFormatback to summary
public boolean isRecognizedFormat(BufferedReader reader) throws IOException

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

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

Check whether the source is in the correct format for this importer.

The effect of this method is primarily to avoid unnecessary processing of files when searching for a suitable import format. If this method returns false, the import routine will move on to the next import format.

Thus, the correct behaviour is to return false if it is certain that the file is not of the suitable type, and true otherwise. Returning true is the safe choice if not certain.

Annotations
@Override
isRecognizedFormatback to summary
public boolean isRecognizedFormat(Path filePath) throws IOException

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

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

Check whether the source is in the correct format for this importer.

Parameters
filePath:Path

the path of the file to check

Returns:boolean

true, if the file is in a recognized format

Annotations
@Override
Exceptions
IOException:
Signals that an I/O exception has occurred.
parseDataback to summary
private BibEntry parseData(CitaviExchangeData.References.Reference data)
parseDataListback to summary
private List<BibEntry> parseDataList(CitaviExchangeData data)
parseEntriesback to summary
public List<BibEntry> parseEntries(InputStream inputStream)

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

Annotations
@Override
removeSpacesBeforeLineBreakback to summary
private String removeSpacesBeforeLineBreak(String string)
unmarshallRootback to summary
private Object unmarshallRoot(BufferedReader reader) throws XMLStreamException, JAXBException
org.jabref.logic.importer.fileformat back to summary

pack-priv final Enum CitaviXmlImporter.QuotationTypeMapping

extends Enum<CitaviXmlImporter.QuotationTypeMapping>
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
public static final CitaviXmlImporter.QuotationTypeMapping
public static final CitaviXmlImporter.QuotationTypeMapping
public static final CitaviXmlImporter.QuotationTypeMapping
public static final CitaviXmlImporter.QuotationTypeMapping
public static final CitaviXmlImporter.QuotationTypeMapping
public static final CitaviXmlImporter.QuotationTypeMapping
pack-priv final String
public static final CitaviXmlImporter.QuotationTypeMapping

Constructor Summary

AccessConstructor and Description
private
QuotationTypeMapping(int citaviType, String name)

Method Summary

Modifier and TypeMethod and Description
pack-priv int
pack-priv String
public static CitaviXmlImporter.QuotationTypeMapping
public static CitaviXmlImporter.QuotationTypeMapping[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

citaviTypeback to summary
pack-priv final int citaviType
COMMENTback to summary
public static final CitaviXmlImporter.QuotationTypeMapping COMMENT
DIRECT_QUOTATIONback to summary
public static final CitaviXmlImporter.QuotationTypeMapping DIRECT_QUOTATION
HIGHLIGHTback to summary
public static final CitaviXmlImporter.QuotationTypeMapping HIGHLIGHT
HIGHLIGHT_REDback to summary
public static final CitaviXmlImporter.QuotationTypeMapping HIGHLIGHT_RED
IMAGE_QUOTATIONback to summary
public static final CitaviXmlImporter.QuotationTypeMapping IMAGE_QUOTATION
INDIRECT_QUOTATIONback to summary
public static final CitaviXmlImporter.QuotationTypeMapping INDIRECT_QUOTATION
nameback to summary
pack-priv final String name

Hides java.lang.Enum.name.

SUMMARYback to summary
public static final CitaviXmlImporter.QuotationTypeMapping SUMMARY

Constructor Detail

QuotationTypeMappingback to summary
private QuotationTypeMapping(int citaviType, String name)

Method Detail

getCitaviIndexTypeback to summary
pack-priv int getCitaviIndexType()
getNameback to summary
pack-priv String getName()
valueOfback to summary
public static CitaviXmlImporter.QuotationTypeMapping valueOf(String name)
valuesback to summary
public static CitaviXmlImporter.QuotationTypeMapping[] values()