Modifier and Type | Field and Description |
---|---|
protected Property |
property |
protected Translator<P,D> |
translator |
Constructor and Description |
---|
PropertyPopulator(Property prop,
Translator<P,D> trans) |
Modifier and Type | Method and Description |
---|---|
LoadConditions |
getLoadConditions() |
Property |
getProperty() |
D |
getValue(Object pojo,
SaveContext ctx,
Path containerPath)
Get the value for the property and translate it into datastore format.
|
void |
load(com.google.appengine.api.datastore.PropertyContainer container,
LoadContext ctx,
Path containerPath,
Object intoPojo)
Gets the appropriate value from the container and sets it on the appropriate field of the pojo.
|
void |
save(Object onPojo,
boolean index,
SaveContext ctx,
Path containerPath,
com.google.appengine.api.datastore.PropertyContainer into)
Gets the appropriate field value from the pojo and puts it in the container at the appropriate prop name
and with the appropriate indexing.
|
void |
setValue(Object pojo,
D value,
LoadContext ctx,
Path containerPath)
Set this raw datastore value on the relevant property of the pojo, doing whatever translations are necessary.
|
String |
toString()
This is easier to debug if we have a string value
|
protected Property property
protected Translator<P,D> translator
public PropertyPopulator(Property prop, Translator<P,D> trans)
public Property getProperty()
public LoadConditions getLoadConditions()
public String toString()
public void load(com.google.appengine.api.datastore.PropertyContainer container, LoadContext ctx, Path containerPath, Object intoPojo)
load
in interface Populator<P>
container
- is the part of the native datastore entity tree we are transforming.ctx
- holds state information during an entity load.containerPath
- is the current path to this translatorintoPojo
- is an optional parameter; sometimes we need to create an object at a higher level and pass it
down through a stack of translators. Most translators will ignore this, but some will have special
behavior, for example, this allows collections to be recycled.public void setValue(Object pojo, D value, LoadContext ctx, Path containerPath) throws SkipException
SkipException
public void save(Object onPojo, boolean index, SaveContext ctx, Path containerPath, com.google.appengine.api.datastore.PropertyContainer into)
public D getValue(Object pojo, SaveContext ctx, Path containerPath)
Copyright © 2017. All rights reserved.