|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.googlecode.objectify.impl.conv.Conversions
public class Conversions
Manages all the converters used to translate between POJO fields and the types that the Datastore can actually persist. Essentially acts as an aggregator for all the Converter objects.
Note that this does NOT implement Converter; the return values of the methods are not the same when a conversion is not found.
THIS API IS EXPERIMENTAL. It may change significantly in minor point releases.
Constructor Summary | |
---|---|
Conversions(ObjectifyFactory fact)
Initialize the default set of converters. |
Method Summary | |
---|---|
void |
add(Converter cvt)
Add a new converter to the list. |
java.lang.Object |
forDatastore(java.lang.Object value,
ConverterSaveContext ctx)
Run the value through all the converters; the first converter that returns a non-null value produces the response for this method. |
java.lang.Object |
forPojo(java.lang.Object value,
java.lang.Class<?> fieldType,
ConverterLoadContext ctx,
java.lang.Object onPojo)
Run the value through all the converters; the first converter that returns a non-null value produces the response for this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Conversions(ObjectifyFactory fact)
Method Detail |
---|
public void add(Converter cvt)
public java.lang.Object forDatastore(java.lang.Object value, ConverterSaveContext ctx)
public java.lang.Object forPojo(java.lang.Object value, java.lang.Class<?> fieldType, ConverterLoadContext ctx, java.lang.Object onPojo)
fieldType
- if null will simply return the value as-is; we can't do any conversion if we don't know the type!
java.lang.IllegalArgumentException
- if we weren't able to find a proper conversion
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |