Class Translator
- java.lang.Object
-
- org.intermine.objectstore.translating.Translator
-
- Direct Known Subclasses:
ItemToObjectTranslator
public abstract class Translator extends java.lang.ObjectInterface specifying operations required for inline translation of queries and data objects by a translating ObjectStore.- Author:
- Andrew Varley, Mark Woodbridge
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectStoreos
-
Constructor Summary
Constructors Constructor Description Translator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidsetObjectStore(ObjectStore os)Set this Translator's ObjectStore.abstract java.lang.ObjecttranslateFromDbObject(java.lang.Object o)Translate an object exiting the ObjectStore.abstract java.lang.ObjecttranslateIdToIdentifier(java.lang.Integer id)Translate an object id into a native identifier.abstract QuerytranslateQuery(Query query)Translate a query.abstract java.lang.ObjecttranslateToDbObject(java.lang.Object o)Translate an object entering the ObjectStore.
-
-
-
Field Detail
-
os
protected ObjectStore os
-
-
Method Detail
-
setObjectStore
public void setObjectStore(ObjectStore os)
Set this Translator's ObjectStore.- Parameters:
os- the ObjectStore
-
translateQuery
public abstract Query translateQuery(Query query) throws ObjectStoreException
Translate a query.- Parameters:
query- the Query to translate- Returns:
- the translated query
- Throws:
ObjectStoreException- if the query cannot be translated
-
translateToDbObject
public abstract java.lang.Object translateToDbObject(java.lang.Object o)
Translate an object entering the ObjectStore.- Parameters:
o- the Object to translate- Returns:
- the translated object
-
translateFromDbObject
public abstract java.lang.Object translateFromDbObject(java.lang.Object o) throws MetaDataExceptionTranslate an object exiting the ObjectStore.- Parameters:
o- the object to translate- Returns:
- the translated object
- Throws:
MetaDataException- if item has a field that isn't in InterMine model
-
translateIdToIdentifier
public abstract java.lang.Object translateIdToIdentifier(java.lang.Integer id)
Translate an object id into a native identifier.- Parameters:
id- the object id- Returns:
- an object that represents the underlying object's identifier
-
-