Top Description Constructors Methods
de.undercouch.citeproc.ris

public Class RISConverter

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .InputStreamReader, .Reader, java.nio.charset.StandardCharsets, java.util.ArrayList, .Arrays, .HashMap, .List, .Map, org.apache.commons.lang3.StringUtils, org.jbibtex.ParseException, de.undercouch.citeproc.bibtex.DateParser, .NameParser, de.undercouch.citeproc.csl.CSLDate, .CSLItemData, .CSLItemDataBuilder, .CSLName, .CSLType

Converts RIS references to CSL citation items
Author
Michel Kraemer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public RISLibrary

Returns:

the RIS library
loadLibrary
(InputStream
the input stream to read from
is
)

Loads a RIS library from a stream.

private static CSLName[]
toAuthors(String[] authors)

public Map<String, CSLItemData>

Returns:

a map consisting of citation keys and citation items
toItemData
(RISLibrary
the library
lib
)

Converts the given library to a map of CSL citation items

public CSLItemData

Returns:

the citation item
toItemData
(RISReference
the reference to convert
ref
)

Converts an RIS reference to a citation item

public CSLType

Returns:

the converted type (never null, falls back to CSLType#ARTICLE)
toType
(RISType
the type to convert
type
)

Converts a RIS reference type to a CSL type

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RISConverterback to summary
public RISConverter()

Method Detail

loadLibraryback to summary
public RISLibrary loadLibrary(InputStream is) throws IOException, ParseException

Loads a RIS library from a stream.

This method does not close the given stream. The caller is responsible for closing it.

Parameters
is:InputStream

the input stream to read from

Returns:RISLibrary

the RIS library

Exceptions
IOException:
if the library could not be read
ParseException:
if the library is invalid
toAuthorsback to summary
private static CSLName[] toAuthors(String[] authors)
toItemDataback to summary
public Map<String, CSLItemData> toItemData(RISLibrary lib)

Converts the given library to a map of CSL citation items

Parameters
lib:RISLibrary

the library

Returns:Map<String, CSLItemData>

a map consisting of citation keys and citation items

toItemDataback to summary
public CSLItemData toItemData(RISReference ref)

Converts an RIS reference to a citation item

Parameters
ref:RISReference

the reference to convert

Returns:CSLItemData

the citation item

toTypeback to summary
public CSLType toType(RISType type)

Converts a RIS reference type to a CSL type

Parameters
type:RISType

the type to convert

Returns:CSLType

the converted type (never null, falls back to CSLType#ARTICLE)