Package org.bridgedb
Class BridgeDb
- java.lang.Object
-
- org.bridgedb.BridgeDb
-
public final class BridgeDb extends Object
Central access point for connecting to IDMappers.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IDMapperconnect(String connectionString)Finds the correct implementation of theIDMapperinterface and instantiates it.static voidregister(String protocol, Driver driver)Used byDriverimplementations to register themselves and make themselves available to the world.
-
-
-
Method Detail
-
connect
public static IDMapper connect(String connectionString) throws IDMapperException
Finds the correct implementation of theIDMapperinterface and instantiates it.- Parameters:
connectionString- used to configure a mapping resource. The connectionString has the form "protocol:location", where protocol can be e.g. "idmapper-text" or "idmapper-pgdb", and location is for example an url or a file, depending on the protocol.
Note that you need to load the driver that implements the protocol first by loading its class with Class.forName(). E.g. for idmapper-pgdb, the class "org.bridgedb.rdb.IDMapperRdb" needs to be loaded.- Returns:
- the newly instantiated IDMapper
- Throws:
IDMapperException- when the right IDMapper implementation could not be instantiated, or when the connection string is not formatted correctly
-
register
public static void register(String protocol, Driver driver)
Used byDriverimplementations to register themselves and make themselves available to the world.- Parameters:
protocol- The protocol (part before ":" in connection string) that this Driver is for.driver- An instance of the Driver.
-
-