Package psidev.psi.mi.jami.datasource
Interface MIFileDataSource
-
- All Superinterfaces:
MIDataSource
- All Known Subinterfaces:
CsvSource<I>
,CsvStreamSource<I>
,MitabSource<I>
,MitabStreamSource<I>
,PsiXmlSource<I>
,PsiXmlStreamSource<I>
- All Known Implementing Classes:
AbstractCsvSource
,AbstractCsvStreamSource
,AbstractMitabSource
,AbstractMitabStreamSource
,AbstractPsiXmlBinarySource
,AbstractPsiXmlBinaryStream
,AbstractPsiXmlSource
,AbstractPsiXmlStream
,CsvBinaryEvidenceSource
,CsvBinaryEvidenceStreamSource
,CsvEvidenceSource
,CsvEvidenceStreamSource
,CsvMixedEvidenceSource
,CsvNaryEvidenceSource
,DefaultMitabSource
,DefaultMitabStreamSource
,DefaultPsiXmlSource
,DefaultPsiXmlStreamSource
,LightMitabBinarySource
,LightMitabBinaryStreamSource
,LightMitabSource
,LightMitabStreamSource
,LightXmlBinarySource
,LightXmlBinaryStreamSource
,LightXmlSource
,LightXmlStreamSource
,MitabBinaryEvidenceSource
,MitabBinaryEvidenceStreamSource
,MitabEvidenceSource
,MitabEvidenceStreamSource
,MitabModelledBinarySource
,MitabModelledBinaryStreamSource
,MitabModelledSource
,MitabModelledStreamSource
,XmlBinaryEvidenceSource
,XmlBinaryEvidenceStreamSource
,XmlBinarySource
,XmlBinaryStreamSource
,XmlComplexSource
,XmlComplexStreamSource
,XmlEvidenceSource
,XmlEvidenceStreamSource
,XmlModelledBinarySource
,XmlModelledBinaryStreamSource
,XmlModelledSource
,XmlModelledStreamSource
,XmlSource
,XmlStreamSource
public interface MIFileDataSource extends MIDataSource
Interface for MIDataSource coming from a file. These dataSources need to be closed when they are not used anymore. A MIFileParserListener can be provided to listen to parsing events. A MIFileDataSource provides a method to know if the file syntax is valid- Since:
26/03/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
Fields Modifier and Type Field Description static String
FILE_URI_PREFIX
ConstantFILE_URI_PREFIX="file://"
static Pattern
URL_PREFIX_REGEXP
ConstantURL_PREFIX_REGEXP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MIFileParserListener
getFileParserListener()
The MIFileParserListener can be null if not initialisedvoid
setFileParserListener(MIFileParserListener listener)
setFileParserListenerboolean
validateSyntax()
Validate the syntax of this MIFileDataSource.boolean
validateSyntax(MIFileParserListener listener)
Validate the syntax of this MIFileDataSource and uses the provided MIFileParserListener to listen to the events.-
Methods inherited from interface psidev.psi.mi.jami.datasource.MIDataSource
close, initialiseContext, reset
-
-
-
-
Field Detail
-
FILE_URI_PREFIX
static final String FILE_URI_PREFIX
ConstantFILE_URI_PREFIX="file://"
- See Also:
- Constant Field Values
-
URL_PREFIX_REGEXP
static final Pattern URL_PREFIX_REGEXP
ConstantURL_PREFIX_REGEXP
-
-
Method Detail
-
getFileParserListener
MIFileParserListener getFileParserListener()
The MIFileParserListener can be null if not initialised- Returns:
- the file parser listener that listen to the different parsing events
-
setFileParserListener
void setFileParserListener(MIFileParserListener listener)
setFileParserListener
- Parameters:
listener
- aMIFileParserListener
object.
-
validateSyntax
boolean validateSyntax() throws MIIOException
Validate the syntax of this MIFileDataSource. It returns true if the file syntax is valid, false otherwise. When the file syntax is invalid, the syntax errors are fired and should be retrieved using a proper MIFileParserListener- Returns:
- a boolean.
- Throws:
MIIOException
- if any.
-
validateSyntax
boolean validateSyntax(MIFileParserListener listener) throws MIIOException
Validate the syntax of this MIFileDataSource and uses the provided MIFileParserListener to listen to the events. The provided listener will be set as the MIFileParserListener of this datasource- Parameters:
listener
- : the listener for parsing events- Returns:
- true if the file syntax is valid
- Throws:
MIIOException
- : if some severe syntax errors are found in the file and it stops the parsing
-
-