use of org.apache.tapestry5.plastic.FieldConduit in project tapestry-5 by apache.
the class PersistWorker method makeFieldPersistent.
private void makeFieldPersistent(PlasticField field, MutableComponentModel model) {
Persist annotation = field.getAnnotation(Persist.class);
field.claim(annotation);
final String logicalFieldName = model.setFieldPersistenceStrategy(field.getName(), annotation.value());
final Object defaultValue = determineDefaultValueFromFieldType(field);
ComputedValue<FieldConduit<Object>> computed = new ComputedValue<FieldConduit<Object>>() {
public FieldConduit<Object> get(InstanceContext context) {
InternalComponentResources resources = context.get(InternalComponentResources.class);
return new PersistentFieldConduit(resources, logicalFieldName, defaultValue);
}
};
field.setComputedConduit(computed);
}
Aggregations