Project structure
A basic driver should contain the following files and directories:
| build.xml | ant build file |
| src/ | all source code is below this directory in java packages |
| src/org/example/ | package directory, using your organizations name. a package directory org/example corresponds to an organization named example.org |
| src/org/example/ExampleMapper.java | Driver class |
| lib/ | optional: jar file dependencies |
The Driver template
Let's start writing ExampleMapper.java. Here is an empty template
package org.example;
public class ExampleMapper implements IDMapper
{
@Override
public void close() throws IDMapperException
{
return;
}
@Override
public Set<Xref> freeSearch(String text, int limit) throws IDMapperException
{
throw new UnsupportedOperationException();
}
@Override
public IDMapperCapabilities getCapabilities()
{
throw new UnsupportedOperationException();
}
@Override
public boolean isConnected()
{
return false;
}
@Override
public Map<Xref, Set<Xref>> mapID(Collection<Xref> srcXrefs, DataSource... tgtDataSources)
throws IDMapperException
{
throw new UnsupportedOperationException();
}
@Override
public Set<Xref> mapID(Xref ref, DataSource... tgtDataSources) throws IDMapperException
{
throw new UnsupportedOperationException();
}
@Override
public boolean xrefExists(Xref xref) throws IDMapperException
{
throw new UnsupportedOperationException();
}
}
The build file
TODO
Initializing the driver
TODO
Unit testing
TODO
writing the mapper function
TODO
testing
TODO
writing the capabilities function
TODO
optional improvements
TODO
