|
db4o 7.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.db4o.reflect.generic.GenericReflector
public class GenericReflector
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
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:
Constructor Summary | |
---|---|
GenericReflector(Reflector delegateReflector)
|
|
GenericReflector(com.db4o.internal.Transaction trans,
Reflector delegateReflector)
Creates an instance of GenericReflector |
Method Summary | |
---|---|
ReflectArray |
array()
returns an ReflectArray object, the equivalent to java.lang.reflect.Array. |
int |
collectionUpdateDepth(ReflectClass candidate)
Determines collection update depth for the specified class |
void |
configuration(ReflectorConfiguration config)
|
java.lang.Object |
deepClone(java.lang.Object obj)
Creates a clone of provided object |
ReflectClass |
forClass(java.lang.Class clazz)
Returns a ReflectClass instance for the specified class |
ReflectClass |
forName(java.lang.String className)
Returns a ReflectClass instance for the specified class name |
ReflectClass |
forObject(java.lang.Object obj)
Returns a ReflectClass instance for the specified class object |
Reflector |
getDelegate()
Returns delegate reflector |
boolean |
hasTransaction()
If there is a transaction assosiated with the current refector. |
boolean |
isCollection(ReflectClass candidate)
Determines if a candidate ReflectClass is a collection |
ReflectClass[] |
knownClasses()
Returns an array of classes known to the reflector |
void |
register(com.db4o.reflect.generic.GenericClass clazz)
Register a class |
void |
registerCollection(java.lang.Class clazz)
Register a class as a collection |
void |
registerCollection(ReflectClassPredicate predicate)
Register a predicate as a collection |
void |
registerCollectionUpdateDepth(java.lang.Class clazz,
int depth)
Register update depth for a collection class |
void |
registerCollectionUpdateDepth(ReflectClassPredicate predicate,
int depth)
Register update depth for a collection class |
void |
registerPrimitiveClass(int id,
java.lang.String name,
com.db4o.reflect.generic.GenericConverter converter)
Registers primitive class |
void |
setParent(Reflector reflector)
method stub: generic reflector does not have a parent |
void |
setTransaction(com.db4o.internal.Transaction trans)
Associated a transaction with the current reflector. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericReflector(com.db4o.internal.Transaction trans, Reflector delegateReflector)
trans
- transactiondelegateReflector
- delegate reflector,
providing specific reflector functionality. For examplepublic GenericReflector(Reflector delegateReflector)
Method Detail |
---|
public java.lang.Object deepClone(java.lang.Object obj)
deepClone
in interface com.db4o.foundation.DeepClone
obj
- object to copy
public boolean hasTransaction()
public void setTransaction(com.db4o.internal.Transaction trans)
trans
- public ReflectArray array()
Reflector
array
in interface Reflector
public int collectionUpdateDepth(ReflectClass candidate)
candidate
- candidate class
public ReflectClass forClass(java.lang.Class clazz)
forClass
in interface Reflector
clazz
- class
ReflectClass
public ReflectClass forName(java.lang.String className)
forName
in interface Reflector
className
- class name
ReflectClass
public ReflectClass forObject(java.lang.Object obj)
forObject
in interface Reflector
obj
- class object
ReflectClass
public Reflector getDelegate()
public boolean isCollection(ReflectClass candidate)
isCollection
in interface Reflector
candidate
- candidate ReflectClass
public void registerCollection(java.lang.Class clazz)
clazz
- class to be registeredpublic void registerCollection(ReflectClassPredicate predicate)
predicate
- predicate to be registeredpublic void registerCollectionUpdateDepth(java.lang.Class clazz, int depth)
clazz
- classdepth
- update depthpublic void registerCollectionUpdateDepth(ReflectClassPredicate predicate, int depth)
predicate
- class predicatedepth
- update depthpublic void register(com.db4o.reflect.generic.GenericClass clazz)
clazz
- classpublic ReflectClass[] knownClasses()
public void registerPrimitiveClass(int id, java.lang.String name, com.db4o.reflect.generic.GenericConverter converter)
id
- class idname
- class nameconverter
- class converterpublic void setParent(Reflector reflector)
setParent
in interface Reflector
public void configuration(ReflectorConfiguration config)
configuration
in interface Reflector
|
db4o 7.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |