use of org.apache.tapestry5.plastic.ComputedValue in project tapestry-5 by apache.
the class InjectContainerWorker method transformField.
private void transformField(PlasticField field) {
InjectContainer annotation = field.getAnnotation(InjectContainer.class);
field.claim(annotation);
ComputedValue<FieldConduit<Object>> provider = createFieldValueConduitProvider(field);
field.setComputedConduit(provider);
}
use of org.apache.tapestry5.plastic.ComputedValue 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