Top Fields Constructors Methods
org.jabref.logic.exporter

public abstract Class Exporter

extends Object
Class Inheritance
Known Direct Subclasses
org.jabref.logic.exporter.ModsExporter, org.jabref.logic.exporter.MSBibExporter, org.jabref.logic.exporter.OpenDocumentSpreadsheetCreator, org.jabref.logic.exporter.OpenOfficeDocumentCreator, org.jabref.logic.exporter.TemplateExporter, org.jabref.logic.exporter.XmpExporter, org.jabref.logic.exporter.XmpPdfExporter, org.jabref.logic.exporter.CffExporter, org.jabref.logic.exporter.EmbeddedBibFilePdfExporter, org.jabref.logic.exporter.EndnoteXmlExporter
Imports
java.nio.file.Files, .Path, java.util.Collections, .List, .Optional, org.jabref.logic.journals.JournalAbbreviationRepository, org.jabref.logic.util.FileType, org.jabref.model.database.BibDatabaseContext, org.jabref.model.entry.BibEntry, .LinkedFile, org.jabref.preferences.FilePreferences

Field Summary

Modifier and TypeField and Description
private final String
private final FileType
private final String

Constructor Summary

AccessConstructor and Description
public
Exporter(String id, String displayName, FileType extension)

Method Summary

Modifier and TypeMethod and Description
public abstract void
export(BibDatabaseContext
the database to export from
databaseContext
,
Path
the file to write to
file
,
List<BibEntry>
a list containing all entries that should be exported
entries
)

Performs the export.

public void
export(BibDatabaseContext databaseContext, Path file, List<BibEntry> entries, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository)

public boolean

Returns:

whether any file was written on
exportToAllFilesOfEntry
(BibDatabaseContext
the database to export from
databaseContext
,
FilePreferences
the filePreferences to use for resolving paths
filePreferences
,
BibEntry
the entry for which we want to write on all linked pdfs
entryToWriteOn
,
List<BibEntry>
the content that we want to export to the pdfs
entriesToWrite
,
JournalAbbreviationRepository
the opened repository of journal abbreviations
abbreviationRepository
)

Exports to all files linked to a given entry

public boolean

Returns:

whether the file was written on at least once
exportToFileByPath
(BibDatabaseContext
the database-context to export from
databaseContext
,
FilePreferences
the filePreferences to use for resolving paths
filePreferences
,
Path
the path to the file we want to write on
filePath
,
JournalAbbreviationRepository
the opened repository of journal abbreviations
abbreviationRepository
)

Exports bib-entries a file is linked to Behaviour in case the file is linked to different bib-entries depends on the implementation of export.

public FileType
getFileType()

Returns the type of files this exporter creates.

public String
getId()

Returns a one-word ID (used, for example, to identify the exporter in the console).

public String
getName()

Returns the name of the exporter (to display to the user).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

displayNameback to summary
private final String displayName
fileTypeback to summary
private final FileType fileType
idback to summary
private final String id

Constructor Detail

Exporterback to summary
public Exporter(String id, String displayName, FileType extension)

Method Detail

exportback to summary
public abstract void export(BibDatabaseContext databaseContext, Path file, List<BibEntry> entries) throws Exception

Performs the export.

Parameters
databaseContext:BibDatabaseContext

the database to export from

file:Path

the file to write to

entries:List<BibEntry>

a list containing all entries that should be exported

exportback to summary
public void export(BibDatabaseContext databaseContext, Path file, List<BibEntry> entries, List<Path> fileDirForDatabase, JournalAbbreviationRepository abbreviationRepository) throws Exception
exportToAllFilesOfEntryback to summary
public boolean exportToAllFilesOfEntry(BibDatabaseContext databaseContext, FilePreferences filePreferences, BibEntry entryToWriteOn, List<BibEntry> entriesToWrite, JournalAbbreviationRepository abbreviationRepository) throws Exception

Exports to all files linked to a given entry

Parameters
databaseContext:BibDatabaseContext

the database to export from

filePreferences:FilePreferences

the filePreferences to use for resolving paths

entryToWriteOn:BibEntry

the entry for which we want to write on all linked pdfs

entriesToWrite:List<BibEntry>

the content that we want to export to the pdfs

abbreviationRepository:JournalAbbreviationRepository

the opened repository of journal abbreviations

Returns:boolean

whether any file was written on

Exceptions
Exception:
if the writing fails
exportToFileByPathback to summary
public boolean exportToFileByPath(BibDatabaseContext databaseContext, FilePreferences filePreferences, Path filePath, JournalAbbreviationRepository abbreviationRepository) throws Exception

Exports bib-entries a file is linked to Behaviour in case the file is linked to different bib-entries depends on the implementation of export. If it overwrites any existing information, only the last found bib-entry will be exported (as the previous exports are overwritten). If it extends existing information, all found bib-entries will be exported.

Parameters
databaseContext:BibDatabaseContext

the database-context to export from

filePreferences:FilePreferences

the filePreferences to use for resolving paths

filePath:Path

the path to the file we want to write on

abbreviationRepository:JournalAbbreviationRepository

the opened repository of journal abbreviations

Returns:boolean

whether the file was written on at least once

Exceptions
Exception:
if the writing fails
getFileTypeback to summary
public FileType getFileType()

Returns the type of files this exporter creates.

getIdback to summary
public String getId()

Returns a one-word ID (used, for example, to identify the exporter in the console).

getNameback to summary
public String getName()

Returns the name of the exporter (to display to the user).

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override