|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.intermine.objectstore.translating.Translator
org.intermine.dataconversion.ItemToObjectTranslator
public class ItemToObjectTranslator
Translator that translates fulldata Items to business objects
| Field Summary | |
|---|---|
protected java.util.SortedMap<java.lang.Integer,java.lang.String> |
idToNamespace
|
protected Model |
model
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
namespaceToId
|
| Fields inherited from class org.intermine.objectstore.translating.Translator |
|---|
os |
| Constructor Summary | |
|---|---|
ItemToObjectTranslator(Model model,
ObjectStore os)
Constructor |
|
| Method Summary | |
|---|---|
java.lang.Integer |
identifierToId(java.lang.String identifier)
Turn an item identifier into an object id. |
java.lang.String |
idToIdentifier(java.lang.Integer id)
Turn an object id into an item identifier. |
protected java.util.Collection<java.lang.Integer> |
toIntegers(java.util.Collection<java.lang.String> strings)
Convert a set of Strings to a set of Integers using identifierToId() |
protected java.util.Collection<java.lang.String> |
toStrings(java.util.Collection<java.lang.Integer> integers)
Convert a set of Integers to a set of String using idToIdentifier() |
java.lang.Object |
translateFromDbObject(java.lang.Object o)
Translate an object exiting the ObjectStore. |
java.lang.Object |
translateIdToIdentifier(java.lang.Integer id)
Translate an object id into a native identifier. |
Query |
translateQuery(Query query)
Translate a query. |
java.lang.Object |
translateToDbObject(java.lang.Object o)
Translate an object entering the ObjectStore. |
| Methods inherited from class org.intermine.objectstore.translating.Translator |
|---|
setObjectStore |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Model model
protected java.util.SortedMap<java.lang.Integer,java.lang.String> idToNamespace
protected java.util.Map<java.lang.String,java.lang.Integer> namespaceToId
| Constructor Detail |
|---|
public ItemToObjectTranslator(Model model,
ObjectStore os)
throws ObjectStoreException
model - the Model used in business object creationos - an ObjectStore containing the Item data that we will be translating. Note that
the contents of the objectstore must remain constant for IDs to not clash - newly written
objects will not be accessible by their ID. This translator assumes that the Item identifier
field contains some string, an underscore, then some number with no leading zeros.
ObjectStoreException - if the initialisation query fails| Method Detail |
|---|
public java.lang.String idToIdentifier(java.lang.Integer id)
id - an InterMineObject id
public java.lang.Object translateIdToIdentifier(java.lang.Integer id)
translateIdToIdentifier in class Translatorid - the object id
public java.lang.Integer identifierToId(java.lang.String identifier)
identifier - an item identifier
public Query translateQuery(Query query)
throws ObjectStoreException
translateQuery in class Translatorquery - the Query to translate
ObjectStoreException - if the query cannot be translatedpublic java.lang.Object translateToDbObject(java.lang.Object o)
translateToDbObject in class Translatoro - the Object to translate
public java.lang.Object translateFromDbObject(java.lang.Object o)
throws MetaDataException
translateFromDbObject in class Translatoro - the object to translate
MetaDataException - if item has a field that isn't in InterMine modelprotected java.util.Collection<java.lang.String> toStrings(java.util.Collection<java.lang.Integer> integers)
integers - a set of Integers
protected java.util.Collection<java.lang.Integer> toIntegers(java.util.Collection<java.lang.String> strings)
strings - a set of Strings
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||