Class RISConverter


  • public class RISConverter
    extends java.lang.Object
    Converts RIS references to CSL citation items
    Author:
    Michel Kraemer
    • Constructor Detail

      • RISConverter

        public RISConverter()
    • Method Detail

      • loadLibrary

        public RISLibrary loadLibrary​(java.io.InputStream is)
                               throws java.io.IOException,
                                      org.jbibtex.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 - the input stream to read from
        Returns:
        the RIS library
        Throws:
        java.io.IOException - if the library could not be read
        org.jbibtex.ParseException - if the library is invalid
      • toItemData

        public java.util.Map<java.lang.String,​CSLItemData> toItemData​(RISLibrary lib)
        Converts the given library to a map of CSL citation items
        Parameters:
        lib - the library
        Returns:
        a map consisting of citation keys and citation items
      • toItemData

        public CSLItemData toItemData​(RISReference ref)
        Converts an RIS reference to a citation item
        Parameters:
        ref - the reference to convert
        Returns:
        the citation item
      • toType

        public CSLType toType​(RISType type)
        Converts a RIS reference type to a CSL type
        Parameters:
        type - the type to convert
        Returns:
        the converted type (never null, falls back to CSLType.ARTICLE)