com.db4o.config
Interface ObjectConstructor
- All Superinterfaces:
- ObjectTranslator
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
or
ObjectTranslator
need to be registered.
Example:
Configuration config = Db4o.configure();
ObjectClass oc = config.objectClass("package.className");
oc.translate(new FooTranslator());
Method Summary |
java.lang.Object |
onInstantiate(ObjectContainer container,
java.lang.Object storedObject)
db4o calls this method when a stored object needs to be instantiated. |
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 with
ObjectTranslator.onStore
.
- Returns:
- the instantiated object.
Copyright 2007 db4objects Inc. All rights reserved.