Package com.db4o.config
Interface ObjectConstructor
-
- All Superinterfaces:
ObjectTranslator
- All Known Implementing Classes:
TClass
,TSerializable
,TTransient
,TTreeMap
,TTreeSet
public interface ObjectConstructor extends ObjectTranslator
interface to allow instantiating objects by calling specific constructors.
By writing classes that implement this interface, it is possible to define which constructor is to be used during the instantiation of a stored object.
Before starting a db4o session, translator classes that implement the ObjectConstructor orObjectTranslator
need to be registered.
Example:
EmbeddedConfiguration config = Db4oEmbedded.newConfiguration();
ObjectClass oc = config.common().objectClass("package.className");
oc.translate(new FooTranslator());
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
onInstantiate(ObjectContainer container, java.lang.Object storedObject)
db4o calls this method when a stored object needs to be instantiated.-
Methods inherited from interface com.db4o.config.ObjectTranslator
onActivate, onStore, storedClass
-
-
-
-
Method Detail
-
onInstantiate
java.lang.Object onInstantiate(ObjectContainer container, java.lang.Object storedObject)
db4o calls this method when a stored object needs to be instantiated.- Parameters:
container
- the ObjectContainer usedstoredObject
- the object stored withObjectTranslator.onStore
.- Returns:
- the instantiated object.
-
-