|
db4o 8.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.db4o.qlin.Prototypes
public class Prototypes
creates prototype objects for classes. Each field on prototype objects is set
to a newly created object or primitive that can be identified either by it's
identity or by an int ID that is generated by the system. Creation of fields
is recursed to the depth specified in the constructor.
Allows analyzing expressions called on prototype objects to find the
underlying field that delivers the return value of the expression. Passed
expressions should not have side effects on objects, otherwise the
"prototype world" will no longer work.
We plan to supply an ImmutableFieldClassLoader to instrument the code to
throw on every modification. This ClassLoader could also supply information
about all the method calls involved.
For now our approach only works if expressions are directly backed by a
single field.
We were inspired for this approach when we saw that Thomas Mueller managed to
map expressions to fields for his JaQu query interface, Kudos!
http://www.h2database.com/html/jaqu.html
We took the idea a bit further and made it work for all primitives except for
boolean and we plan to also get deeper expressions, collections and
interfaces working nicely.
Constructor Summary | |
---|---|
Prototypes()
|
|
Prototypes(Reflector reflector,
int recursionDepth,
boolean ignoreTransient)
|
Method Summary | ||
---|---|---|
|
backingFieldPath(java.lang.Class<T> clazz,
java.lang.Object expression)
analyzes the passed expression and tries to find the path to the backing field that is accessed. |
|
|
backingFieldPath(ReflectClass claxx,
java.lang.Object expression)
analyzes the passed expression and tries to find the path to the backing field that is accessed. |
|
|
backingFieldPath(java.lang.String className,
java.lang.Object expression)
analyzes the passed expression and tries to find the path to the backing field that is accessed. |
|
static Reflector |
defaultReflector()
|
|
|
prototypeForClass(java.lang.Class<T> clazz)
returns a prototype object for a specific class. |
|
Reflector |
reflector()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Prototypes(Reflector reflector, int recursionDepth, boolean ignoreTransient)
public Prototypes()
Method Detail |
---|
public <T> T prototypeForClass(java.lang.Class<T> clazz)
public <T> com.db4o.foundation.Iterator4<java.lang.String> backingFieldPath(java.lang.Class<T> clazz, java.lang.Object expression)
public <T> com.db4o.foundation.Iterator4<java.lang.String> backingFieldPath(ReflectClass claxx, java.lang.Object expression)
public <T> com.db4o.foundation.Iterator4<java.lang.String> backingFieldPath(java.lang.String className, java.lang.Object expression)
public Reflector reflector()
public static Reflector defaultReflector()
|
db4o 8.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |