db4o 7.4

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.
 
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 used
storedObject - the object stored with ObjectTranslator.onStore.
Returns:
the instantiated object.

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.