Class DataFormatRegistry
- java.lang.Object
-
- fr.ens.biologie.genomique.eoulsan.data.DataFormatRegistry
-
public class DataFormatRegistry extends Object
this class register DataFormat to allow get the DataFormat of a file from its filename.- Since:
- 1.0
- Author:
- Laurent Jourdren
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<DataFormat>
getAllFormats()
Get all the registered formats.DataFormat
getDataFormatForDesignMetadata(String key)
Get the DataFormat that define a metadata entry in the design file.DataFormat
getDataFormatForSampleMetadata(String key)
Get the DataFormat that define a metadata entry of a sample in the design file.DataFormat
getDataFormatFromAlias(String dataFormatAlias)
Get a DataFormat from its alias.DataFormat
getDataFormatFromFilename(String filename)
Get the DataFormat of a file from its filenameDataFormat
getDataFormatFromFilename(String prefix, String extension)
Get a DataFormat From a file prefix and extensionDataFormat
getDataFormatFromGalaxyFormatName(String formatName)
Get DataFormat from an Galaxy format name.DataFormat
getDataFormatFromGalaxyFormatNameOrNameOrAlias(String name)
Get a DataFormat from its Galaxy format name or its name or alias.DataFormat
getDataFormatFromName(String dataFormatName)
Get a DataFormat from its name.DataFormat
getDataFormatFromNameOrAlias(String name)
Get a DataFormat from its alias.Set<DataFormat>
getDataFormatsFromExtension(String extension)
Get DataFormats from an extension.String
getDesignMetadataKeyForDataFormat(Design design, DataFormat dataformat)
Get the field name in a Design object that correspond to a dataformat.static DataFormatRegistry
getInstance()
Get the singleton instance of DataFormatRegistryString
getSampleMetadataKeyForDataFormat(Sample sample, DataFormat dataformat)
Get the field name in a Sample object that correspond to a dataformat.void
register(DataFormat df)
Register a DataFormat.void
register(DataFormat[] array)
Register DataFormats.void
reload()
Reload the list of the available data types.
-
-
-
Method Detail
-
register
public void register(DataFormat df) throws EoulsanException
Register a DataFormat.- Parameters:
df
- the DataFormat to register- Throws:
EoulsanException
- if the DataFormat is not valid
-
register
public void register(DataFormat[] array) throws EoulsanException
Register DataFormats.- Parameters:
array
- Array with DataFormats to register- Throws:
EoulsanException
- if the DataFormat is not valid
-
getDataFormatFromFilename
public DataFormat getDataFormatFromFilename(String prefix, String extension)
Get a DataFormat From a file prefix and extension- Parameters:
prefix
- the prefix of the fileextension
- the extension of the file without compression extension- Returns:
- a DataFormat or null if the DataFormat was not found
-
getDataFormatFromFilename
public DataFormat getDataFormatFromFilename(String filename)
Get the DataFormat of a file from its filename- Parameters:
filename
- the filename of the file- Returns:
- a DataFormat or null if the DataFormat was not found
-
getDataFormatFromName
public DataFormat getDataFormatFromName(String dataFormatName)
Get a DataFormat from its name.- Parameters:
dataFormatName
- the name of the DataFormat to get- Returns:
- a DataFormat if found or null
-
getDataFormatFromAlias
public DataFormat getDataFormatFromAlias(String dataFormatAlias)
Get a DataFormat from its alias.- Parameters:
dataFormatAlias
- the name of the DataFormat to get- Returns:
- a DataFormat if found or null
-
getDataFormatFromGalaxyFormatName
public DataFormat getDataFormatFromGalaxyFormatName(String formatName)
Get DataFormat from an Galaxy format name.- Parameters:
formatName
- Galaxy name extension.- Returns:
- DataFormat
-
getDataFormatFromNameOrAlias
public DataFormat getDataFormatFromNameOrAlias(String name)
Get a DataFormat from its alias.- Parameters:
name
- the name of the DataFormat to get- Returns:
- a DataFormat if found or null
-
getDataFormatFromGalaxyFormatNameOrNameOrAlias
public DataFormat getDataFormatFromGalaxyFormatNameOrNameOrAlias(String name)
Get a DataFormat from its Galaxy format name or its name or alias.- Parameters:
name
- the name of the DataFormat to get- Returns:
- a DataFormat if found or null
-
getDataFormatsFromExtension
public Set<DataFormat> getDataFormatsFromExtension(String extension)
Get DataFormats from an extension.- Parameters:
extension
- the extension of the file without compression extension- Returns:
- a set of DataFormat
-
getAllFormats
public Set<DataFormat> getAllFormats()
Get all the registered formats.- Returns:
- a set with all the registered formats
-
getDataFormatForDesignMetadata
public DataFormat getDataFormatForDesignMetadata(String key)
Get the DataFormat that define a metadata entry in the design file.- Parameters:
key
- the name of the metadata key- Returns:
- a DataFormat
-
getDataFormatForSampleMetadata
public DataFormat getDataFormatForSampleMetadata(String key)
Get the DataFormat that define a metadata entry of a sample in the design file.- Parameters:
key
- the name of the metadata key- Returns:
- a DataFormat
-
getDesignMetadataKeyForDataFormat
public String getDesignMetadataKeyForDataFormat(Design design, DataFormat dataformat)
Get the field name in a Design object that correspond to a dataformat.- Parameters:
design
- design objectdataformat
- dataformat to search- Returns:
- the field name if found or null
-
getSampleMetadataKeyForDataFormat
public String getSampleMetadataKeyForDataFormat(Sample sample, DataFormat dataformat)
Get the field name in a Sample object that correspond to a dataformat.- Parameters:
sample
- sample objectdataformat
- dataformat to search- Returns:
- the field name if found or null
-
reload
public void reload()
Reload the list of the available data types.
-
getInstance
public static DataFormatRegistry getInstance()
Get the singleton instance of DataFormatRegistry- Returns:
- the DataFormatRegistry singleton
-
-