public class ImportFormatReader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BIBTEX_FORMAT |
Constructor and Description |
---|
ImportFormatReader() |
Modifier and Type | Method and Description |
---|---|
static BibtexDatabase |
createDatabase(java.util.Collection<BibtexEntry> bibentries) |
static java.lang.String |
expandAll(java.lang.String s) |
static java.lang.String |
expandAuthorInitials(java.lang.String name)
Expand initials, e.g.
|
java.util.SortedSet<ImportFormat> |
getBuiltInInputFormats()
All built-in importers.
|
ImportFormat |
getByCliId(java.lang.String cliId)
Format for a given CLI-ID.
|
java.util.SortedSet<ImportFormat> |
getCustomImportFormats()
All custom importers.
|
java.lang.String |
getImportFormatList()
Human readable list of all known import formats (name and CLI Id).
|
java.util.SortedSet<ImportFormat> |
getImportFormats()
All importers.
|
static java.io.Reader |
getReader(java.io.File f,
java.lang.String encoding) |
static java.io.Reader |
getReaderDefaultEncoding(java.io.InputStream in) |
java.util.List<BibtexEntry> |
importFromFile(ImportFormat importer,
java.lang.String filename,
OutputPrinter status) |
java.util.List<BibtexEntry> |
importFromFile(java.lang.String format,
java.lang.String filename,
OutputPrinter status) |
java.util.List<BibtexEntry> |
importFromStream(java.lang.String format,
java.io.InputStream in,
OutputPrinter status) |
Pair<java.lang.String,ParserResult> |
importUnknownFormat(java.lang.String filename)
Tries to import a file by iterating through the available import filters,
and keeping the import that seems most promising.
|
static void |
purgeEmptyEntries(java.util.Collection<BibtexEntry> entries)
Receives an ArrayList of BibtexEntry instances, iterates through them, and
removes all entries that have no fields set.
|
void |
resetImportFormats() |
static void |
setIfNecessary(BibtexEntry be,
java.lang.String field,
java.lang.String content) |
public void resetImportFormats()
public ImportFormat getByCliId(java.lang.String cliId)
Will return the first format according to the default-order of format that matches the given ID.
cliId
- CLI-Idnull
if none matchespublic java.util.List<BibtexEntry> importFromStream(java.lang.String format, java.io.InputStream in, OutputPrinter status) throws java.io.IOException
java.io.IOException
public java.util.List<BibtexEntry> importFromFile(java.lang.String format, java.lang.String filename, OutputPrinter status) throws java.io.IOException
java.io.IOException
public java.util.List<BibtexEntry> importFromFile(ImportFormat importer, java.lang.String filename, OutputPrinter status) throws java.io.IOException
java.io.IOException
public static BibtexDatabase createDatabase(java.util.Collection<BibtexEntry> bibentries)
public java.util.SortedSet<ImportFormat> getCustomImportFormats()
Elements are in default order.
public java.util.SortedSet<ImportFormat> getBuiltInInputFormats()
Elements are in default order.
public java.util.SortedSet<ImportFormat> getImportFormats()
Elements are in default order.
public java.lang.String getImportFormatList()
List is in default-order.
public static java.lang.String expandAuthorInitials(java.lang.String name)
name
- public static java.lang.String expandAll(java.lang.String s)
public static void setIfNecessary(BibtexEntry be, java.lang.String field, java.lang.String content)
public static java.io.Reader getReader(java.io.File f, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static java.io.Reader getReaderDefaultEncoding(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static void purgeEmptyEntries(java.util.Collection<BibtexEntry> entries)
public Pair<java.lang.String,ParserResult> importUnknownFormat(java.lang.String filename)
java.io.IOException