Package org.apache.tapestry.annotations

Examples of org.apache.tapestry.annotations.Cached


           
      // 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();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.annotations.Cached

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.