| java.lang.Object com.db4o.reflect.generic.GenericReflector
GenericReflector | public class GenericReflector implements Reflector,DeepClone(Code) | | db4o provides GenericReflector as a wrapper around specific
reflector (delegate). GenericReflector is set when an
ObjectContainer is opened. All subsequent reflector
calls are routed through this interface.
An instance of GenericReflector can be obtained through
com.db4o.ext.ExtObjectContainer.reflector .
GenericReflector keeps list of known classes in memory.
When the GenericReflector is called, it first checks its list of
known classes. If the class cannot be found, the task is
transferred to the delegate reflector. If the delegate fails as
well, generic objects are created, which hold simulated
"field values" in an array of objects.
Generic reflector makes possible the following usecases:
- running a db4o server without deploying application classes;
- running db4o on Java dialects without reflection (J2ME CLDC, MIDP);
- easier access to stored objects where classes or fields are not available;
- running refactorings in the reflector;
- building interfaces to db4o from any programming language.
One of the live usecases is ObjectManager, which uses GenericReflector
to read C# objects from Java.
|
Constructor Summary | |
public | GenericReflector(Transaction trans, Reflector delegateReflector) Creates an instance of GenericReflector
Parameters: trans - transaction Parameters: delegateReflector - delegate reflector, providing specific reflector functionality. |
GenericReflector | public GenericReflector(Transaction trans, Reflector delegateReflector)(Code) | | Creates an instance of GenericReflector
Parameters: trans - transaction Parameters: delegateReflector - delegate reflector, providing specific reflector functionality. For example |
collectionUpdateDepth | public int collectionUpdateDepth(ReflectClass candidate)(Code) | | Determines collection update depth for the specified class
Parameters: candidate - candidate class collection update depth for the specified class |
deepClone | public Object deepClone(Object obj)(Code) | | Creates a clone of provided object
Parameters: obj - object to copy copy of the submitted object |
getDelegate | public Reflector getDelegate()(Code) | | Returns delegate reflector
delegate reflector |
hasTransaction | public boolean hasTransaction()(Code) | | If there is a transaction assosiated with the current refector.
true if there is a transaction assosiated with the current refector. |
isCollection | public boolean isCollection(ReflectClass candidate)(Code) | | Determines if a candidate ReflectClass is a collection
Parameters: candidate - candidate ReflectClass true if a candidate ReflectClass is a collection. |
knownClasses | public ReflectClass[] knownClasses()(Code) | | Returns an array of classes known to the reflector
an array of classes known to the reflector |
register | public void register(GenericClass clazz)(Code) | | Register a class
Parameters: clazz - class |
registerCollection | public void registerCollection(Class clazz)(Code) | | Register a class as a collection
Parameters: clazz - class to be registered |
registerCollection | public void registerCollection(ReflectClassPredicate predicate)(Code) | | Register a predicate as a collection
Parameters: predicate - predicate to be registered |
registerCollectionUpdateDepth | public void registerCollectionUpdateDepth(Class clazz, int depth)(Code) | | Register update depth for a collection class
Parameters: clazz - class Parameters: depth - update depth |
registerCollectionUpdateDepth | public void registerCollectionUpdateDepth(ReflectClassPredicate predicate, int depth)(Code) | | Register update depth for a collection class
Parameters: predicate - class predicate Parameters: depth - update depth |
registerPrimitiveClass | public void registerPrimitiveClass(int id, String name, GenericConverter converter)(Code) | | Registers primitive class
Parameters: id - class id Parameters: name - class name Parameters: converter - class converter |
setParent | public void setParent(Reflector reflector)(Code) | | method stub: generic reflector does not have a parent
|
setTransaction | public void setTransaction(Transaction trans)(Code) | | Associated a transaction with the current reflector.
Parameters: trans - |
|
|