// add a property to store whether or not the method has been called
String fieldName = transformation.addField(PRIVATE, method.getReturnType(), propertyName);
String calledField = transformation.addField(PRIVATE, "boolean", fieldName + "$called");
Cached once = transformation.getMethodAnnotation(method, Cached.class);
String bindingField = null;
String bindingValueField = null;
boolean watching = once.watch().length() > 0;
if (watching) {
// add fields to store the binding and the value
bindingField = transformation.addField(PRIVATE, Binding.class.getCanonicalName(), fieldName + "$binding");
bindingValueField = transformation.addField(PRIVATE, "java.lang.Object", fieldName + "$bindingValue");
String bindingSourceField = transformation.addInjectedField(BindingSource.class, fieldName + "$bindingsource", _bindingSource);
String body = String.format("%s = %s.newBinding(\"Watch expression\", %s, \"%s\", \"%s\");",
bindingField,
bindingSourceField,
transformation.getResourcesFieldName(),
TapestryConstants.PROP_BINDING_PREFIX,
once.watch());
transformation.extendMethod(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE, body);
}
BodyBuilder b = new BodyBuilder();