public class ExportFormat extends java.lang.Object implements IExportFormat
Modifier | Constructor and Description |
---|---|
protected |
ExportFormat()
Empty default constructor for subclasses
|
|
ExportFormat(java.lang.String displayName,
java.lang.String consoleName,
java.lang.String lfFileName,
java.lang.String directory,
java.lang.String extension)
Initialize another export format based on templates stored in dir with
layoutFile lfFilename.
|
Modifier and Type | Method and Description |
---|---|
void |
finalizeSaveSession(SaveSession ss) |
java.lang.String |
getConsoleName()
Name to call this format in the console.
|
java.lang.String |
getDisplayName()
Name to display to the user (for instance in the Save file format drop
down box.
|
javax.swing.filechooser.FileFilter |
getFileFilter()
A file filter that accepts filetypes that this exporter would create.
|
protected java.io.Reader |
getReader(java.lang.String filename)
This method should return a reader from which the given layout file can
be read.
|
protected SaveSession |
getSaveSession(java.lang.String encoding,
java.io.File outFile) |
void |
performExport(BibtexDatabase database,
MetaData metaData,
java.lang.String file,
java.lang.String encoding,
java.util.Set<java.lang.String> entryIds)
Perform the export of
database . |
void |
setCustomExport(boolean custom)
Indicate whether this is a custom export.
|
protected void |
setEncoding(java.lang.String encoding)
Set an encoding which will be used in preference to the default value
obtained from the basepanel.
|
public ExportFormat(java.lang.String displayName, java.lang.String consoleName, java.lang.String lfFileName, java.lang.String directory, java.lang.String extension)
displayName
- Name to display to the user.consoleName
- Name to call this format in the console.lfFileName
- Name of the main layout file.directory
- Directory in which to find the layout file.extension
- Should contain the . (for instance .txt).protected ExportFormat()
public void setCustomExport(boolean custom)
custom
- true to indicate a custom export format.public java.lang.String getConsoleName()
IExportFormat
getConsoleName
in interface IExportFormat
IExportFormat.getConsoleName()
public java.lang.String getDisplayName()
IExportFormat
getDisplayName
in interface IExportFormat
IExportFormat.getDisplayName()
protected void setEncoding(java.lang.String encoding)
encoding
- The name of the encoding to use.protected java.io.Reader getReader(java.lang.String filename) throws java.io.IOException
FileActions.getReader(String)
method.
Subclasses of ExportFormat are free to override and provide their own
implementation.filename
- the file namejava.io.IOException
- if the reader could not be createdpublic void performExport(BibtexDatabase database, MetaData metaData, java.lang.String file, java.lang.String encoding, java.util.Set<java.lang.String> entryIds) throws java.lang.Exception
database
.performExport
in interface IExportFormat
database
- The database to export from.metaData
- The database's meta data.file
- the file to write the resulting export toencoding
- The encoding of the databaseentryIds
- Contains the IDs of all entries that should be exported. If
null
, all entries will be exported.java.io.IOException
- if a problem occurred while trying to write to writer
or read from required resources.java.lang.Exception
- if any other error occurred during export.IExportFormat.performExport(net.sf.jabref.BibtexDatabase,
net.sf.jabref.MetaData, java.lang.String, java.lang.String, java.util.Set)
protected SaveSession getSaveSession(java.lang.String encoding, java.io.File outFile) throws java.io.IOException
java.io.IOException
public javax.swing.filechooser.FileFilter getFileFilter()
IExportFormat
getFileFilter
in interface IExportFormat
IExportFormat.getFileFilter()
public void finalizeSaveSession(SaveSession ss) throws java.lang.Exception
java.lang.Exception