Package org.biojava.bio.program.formats
Class FormatTools
- java.lang.Object
-
- org.biojava.bio.program.formats.FormatTools
-
public class FormatTools extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeTable.Changer
EC_FROM_STRING
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Format
getFormat(String formatName)
Attempt to find aformat for a format identifer string.
-
-
-
Field Detail
-
EC_FROM_STRING
public static final ChangeTable.Changer EC_FROM_STRING
-
-
Method Detail
-
getFormat
public static Format getFormat(String formatName) throws BioException
Attempt to find aformat for a format identifer string.The string will be resolved in the following way:
- Treat the name as an LSID and search for a format class with that LSID.
- Load a class of that name
- Load a class in the package
org.biojava.bio.program.formats
with that name - Load a class in that package after replacing each '.' in the name with "$" so that a search is made of inner classes.
It is not specified if the format returned is a new instance or not.
This method uses the service providor framework to find format providers. If you add formats to the core biojava distribution, you must add the class name to the filebiojava-live/resources/META-INF/services/org.biojava.bio.program.formats.Format
/ If you implement formats and place them in your own .jar files, you should put the class name in a similarly named file in your jar. This should mean that the format becomes automatically registered with the system.- Parameters:
formatName
- the Stirng to use to find the format name- Returns:
- a Format for that name
- Throws:
BioException
- if the format could not be resolved for some reason
-
-