public abstract class PropertyValueNodeTranslator<T> extends AbstractTranslator<T>
Helper which expects a property value in the data structure and throws an exception if one is not found. Also handles null checking.
Constructor and Description |
---|
PropertyValueNodeTranslator() |
Modifier and Type | Method and Description |
---|---|
T |
loadAbstract(Node node,
LoadContext ctx)
Implement loading
|
protected abstract T |
loadPropertyValue(Node node,
LoadContext ctx)
Implement this knowing that we have a proper property value node with a non-null value
|
Node |
saveAbstract(T pojo,
Path path,
boolean index,
SaveContext ctx)
Implement saving
|
protected abstract Node |
savePropertyValue(T pojo,
Path path,
boolean index,
SaveContext ctx)
Implement this, returning a property value node.
|
load, save
public final T loadAbstract(Node node, LoadContext ctx)
AbstractTranslator
loadAbstract
in class AbstractTranslator<T>
public final Node saveAbstract(T pojo, Path path, boolean index, SaveContext ctx)
AbstractTranslator
saveAbstract
in class AbstractTranslator<T>
protected abstract T loadPropertyValue(Node node, LoadContext ctx)
node
- will have a property value and will never be nullprotected abstract Node savePropertyValue(T pojo, Path path, boolean index, SaveContext ctx)
pojo
- will never be nullCopyright © 2014. All rights reserved.