Package org.bridgedb

Class BridgeDb


  • public final class BridgeDb
    extends Object
    Central access point for connecting to IDMappers.
    • Method Detail

      • connect

        public static IDMapper connect​(String connectionString)
                                throws IDMapperException
        Finds the correct implementation of the IDMapper interface 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 by Driver implementations 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.