Package org.pathvisio.libgpml.io
Interface PathwayModelImporter
- All Superinterfaces:
PathwayModelIO
- All Known Implementing Classes:
AbstractPathwayModelFormat
,GPMLFormat
public interface PathwayModelImporter extends PathwayModelIO
Implemented by classes that can import a pathway from various different
types.
- Author:
- unknown
-
Method Summary
Modifier and Type Method Description PathwayModel
doImport(java.io.File file)
Imports the pathway model from given file.boolean
isCorrectType(java.io.File f)
Inspects the file and determine if the file is suitable for import using this importer.Methods inherited from interface org.pathvisio.libgpml.io.PathwayModelIO
getExtensions, getName, getWarnings
-
Method Details
-
isCorrectType
boolean isCorrectType(java.io.File f)Inspects the file and determine if the file is suitable for import using this importer. For example, files ending in .xml could be examined for the local name and namespace of the root element. This function is invoked when multiple importers apply to a given file.Implementations should check the file only superficially if at all. This function is merely a "tie-breaker" in case there are conflicting importers. A return value of true doesn't automatically mean that the file is guaranteed to be valid, so no complex validation is required. For naive implementations, it's always OK to simply return "true".
- Parameters:
f
- the file to check- Returns:
- true if the file appears superficially to be of the correct file type.
-
doImport
Imports the pathway model from given file.- Parameters:
file
- the file that contains pathway model information- Returns:
- the result of the import, a fresh Pathway instance
- Throws:
ConverterException
- if the input file could not be read or parsed, or doesn't contain correct pathway information.
-