public class TranslatableProperty<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected Property |
property |
protected Translator<T> |
translator |
Constructor and Description |
---|
TranslatableProperty(Property prop,
Translator<T> trans) |
Modifier and Type | Method and Description |
---|---|
void |
executeLoad(Node node,
Object onPojo,
LoadContext ctx)
Gets the appropriate value from the node and sets it on the appropriate field of the pojo.
|
void |
executeSave(Object onPojo,
Node node,
boolean index,
SaveContext ctx)
Gets the appropriate field value from the pojo and puts it in the node with the appropriate key for this
property.
|
Property |
getProperty() |
Object |
getValue(Object pojo)
Comes out in datastore format
|
void |
setValue(Object pojo,
Object value,
LoadContext ctx) |
String |
toString()
This is easier to debug if we have a string value
|
protected Property property
protected Translator<T> translator
public TranslatableProperty(Property prop, Translator<T> trans)
public Property getProperty()
public String toString()
public void executeLoad(Node node, Object onPojo, LoadContext ctx)
node
- is the container node for the propertyonPojo
- is the container object for the propertypublic void setValue(Object pojo, Object value, LoadContext ctx)
public void executeSave(Object onPojo, Node node, boolean index, SaveContext ctx)
onPojo
- is the parent pojo which holds the property we representnode
- is the node that corresponds to the parent pojo; we create a new node and put it in hereindex
- is the default state of indexing up to this pointCopyright © 2014. All rights reserved.