public class BibTeXConverter extends Object
Converts BibTeX items to CSL citation items
The class maps BibTeX attributes to CSL attributes. The mapping is based on the one used in Docear as presented by Joeran Beel.
Docear is released under the GPLv2 but its code may also be reused in projects licensed under Apache License 2.0 (see http://www.docear.org/software/licence/, last visited 2013-09-06). The mapping here is released under the Apache License 2.0 by permission of Joaran Beel, Docear.
| Constructor and Description |
|---|
BibTeXConverter()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
org.jbibtex.BibTeXDatabase |
loadDatabase(InputStream is)
Loads a BibTeX database from a stream.
|
Map<String,CSLItemData> |
toItemData(org.jbibtex.BibTeXDatabase db)
Converts the given database to a map of CSL citation items
|
CSLItemData |
toItemData(org.jbibtex.BibTeXEntry e)
Converts a BibTeX entry to a citation item
|
CSLType |
toType(org.jbibtex.Key type)
Converts a BibTeX type to a CSL type
|
public org.jbibtex.BibTeXDatabase loadDatabase(InputStream is) throws IOException, org.jbibtex.ParseException
Loads a BibTeX database from a stream.
This method does not close the given stream. The caller is responsible for closing it.
is - the input stream to read fromIOException - if the database could not be readorg.jbibtex.ParseException - if the database is invalidpublic Map<String,CSLItemData> toItemData(org.jbibtex.BibTeXDatabase db)
db - the databasepublic CSLItemData toItemData(org.jbibtex.BibTeXEntry e)
e - the BibTeX entry to convertpublic CSLType toType(org.jbibtex.Key type)
type - the type to convertCSLType.ARTICLE)