Package psidev.psi.mi.jami.crosslink
Class CrossLinkCsvOptionFactory
- java.lang.Object
-
- psidev.psi.mi.jami.crosslink.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
getCsvOptions(boolean streaming, Object inputData)
Create the options for the CSV datasource and specify if we want a Streaming MIFileDatasource.Map<String,Object>
getCsvOptions(CsvType csvType, ComplexType complexType, Boolean streaming, MIFileParserListener listener, Object input)
Create a map of optionsMap<String,Object>
getCsvOptions(CsvType csvType, ComplexType complexType, Object inputData)
Create the options for the CSV datasource using the provided csvtype.Map<String,Object>
getCsvOptions(MIFileParserListener listener, Object inputData)
Create the options for the CSV datasource using the provided MIFileParserListener.Map<String,Object>
getDefaultCsvOptions(Reader readerToAnalyze)
Create a map with the default options to retrieve the default MI datasource that will read the reader content.Map<String,Object>
getDefaultCsvOptions(Object inputData)
Create the default options for the CSV datasource.Map<String,Object>
getDefaultFileOptions(CsvType csvType, Object inputData)
Create a map of default options depending on the provided sourceType.Map<String,Object>
getDefaultOptions(File file)
Create a map with the default options to retrieve the default MI datasource that will read the file content.Map<String,Object>
getDefaultOptions(InputStream streamToAnalyse)
Create a map with the default options to retrieve the default MI datasource that will read the inputstream content.Map<String,Object>
getDefaultOptions(URL url)
Creates a map with the default options to retrieve MI datasource that will read the URL contentstatic CrossLinkCsvOptionFactory
getInstance()
Getter for the fieldinstance
.
-
-
-
Method Detail
-
getInstance
public static CrossLinkCsvOptionFactory getInstance()
Getter for the field
instance
.- Returns:
- a
CrossLinkCsvOptionFactory
object.
-
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
- aFile
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
- aURL
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
-
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
- aObject
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
-
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 wayinputData
- aObject
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
- aMIFileParserListener
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 binarystreaming
- : boolean value to know if we want to stream the interactions or load the full interaction datasetlistener
- : parser listenerinput
- : the MI source containing data- Returns:
- the map of options
-
-