Class CrossLinkCsvOptionFactory


  • public class CrossLinkCsvOptionFactory
    extends Object
    The factory to populate the map of options for the DataSourceFactory for crosslink csv datasources
    Since:
    03/07/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Method Detail

      • getDefaultOptions

        public Map<String,​Object> getDefaultOptions​(File file)
                                                   throws IOException
        Create a map with the default options to retrieve the default MI datasource that will read the file content.
        Parameters:
        file - a File object.
        Returns:
        the default options for the MI datasource corresponding to this file
        Throws:
        IOException - if any.
      • getDefaultOptions

        public Map<String,​Object> getDefaultOptions​(URL url)
                                                   throws IOException
        Creates a map with the default options to retrieve MI datasource that will read the URL content
        Parameters:
        url - a URL object.
        Returns:
        the default options for the MI datasource corresponding to this url
        Throws:
        IOException - if any.
      • getDefaultOptions

        public Map<String,​Object> getDefaultOptions​(InputStream streamToAnalyse)
                                                   throws IOException
        Create a map with the default options to retrieve the default MI datasource that will read the inputstream content.
        Parameters:
        streamToAnalyse - : stream to be used to analyze the MIFileType
        Returns:
        the default options for the MI datasource corresponding to this source inputstream
        Throws:
        IOException - if any.
      • getDefaultCsvOptions

        public Map<String,​Object> getDefaultCsvOptions​(Reader readerToAnalyze)
                                                      throws IOException
        Create a map with the default options to retrieve the default MI datasource that will read the reader content.
        Parameters:
        readerToAnalyze - : reader to be used to analyze the MIFileType
        Returns:
        the default options for the MI datasource corresponding to this source reader
        Throws:
        IOException - if any.
      • getDefaultFileOptions

        public Map<String,​Object> getDefaultFileOptions​(CsvType csvType,
                                                              Object inputData)
        Create a map of default options depending on the provided sourceType. It can recognize mitab, psi-xml and other
        Parameters:
        csvType - a CsvType object.
        inputData - a Object object.
        Returns:
        the map of default options for this sourceType
      • getDefaultCsvOptions

        public Map<String,​Object> getDefaultCsvOptions​(Object inputData)
        Create the default options for the CSV datasource. It will read InteractionEvidence elements usingCsvType.mix. It will use the CsvParserLogger to listen to the CSV parsing events
        Parameters:
        inputData - a Object object.
        Returns:
        the default options for the CSV datasource
      • getCsvOptions

        public Map<String,​Object> getCsvOptions​(CsvType csvType,
                                                      ComplexType complexType,
                                                      Object inputData)
        Create the options for the CSV datasource using the provided csvtype. It will read elements from this objectCategory. It will use the CsvParserLogger to listen to the CSV parsing events
        Parameters:
        csvType - a CsvType object.
        complexType - : the kind of complex : n-ary or binary
        inputData - a Object object.
        Returns:
        the options for the CSV datasource using the provided objectCategory
      • getCsvOptions

        public Map<String,​Object> getCsvOptions​(boolean streaming,
                                                      Object inputData)
        Create the options for the CSV datasource and specify if we want a Streaming MIFileDatasource. It will read InteractionEvidence elements using CsvType.binary_only. It will use the CsvParserLogger to listen to the Csv parsing events
        Parameters:
        streaming - : tru if we want to read the interactions in a streaming way
        inputData - a Object object.
        Returns:
        the options for the MITAB datasource and specify if we want a Streaming MIFileDatasource
      • getCsvOptions

        public Map<String,​Object> getCsvOptions​(MIFileParserListener listener,
                                                      Object inputData)
        Create the options for the CSV datasource using the provided MIFileParserListener. It will read InteractionEvidence elements and use CsvType.mix by default.
        Parameters:
        listener - a MIFileParserListener object.
        inputData - is the mitab data to read
        Returns:
        the options for the MITAB datasource with the provided listener
      • getCsvOptions

        public Map<String,​Object> getCsvOptions​(CsvType csvType,
                                                      ComplexType complexType,
                                                      Boolean streaming,
                                                      MIFileParserListener listener,
                                                      Object input)
        Create a map of options
        Parameters:
        csvType - : Crosslink Csv type (mix, binary_only, single_nary, etc.)
        complexType - : the kind of complex : n-ary or binary
        streaming - : boolean value to know if we want to stream the interactions or load the full interaction dataset
        listener - : parser listener
        input - : the MI source containing data
        Returns:
        the map of options