Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## org.apache.tapestry5.annotations
Annotation Type Cached

    @Target(value=METHOD)
    @Retention(value=RUNTIME)
    @Documented
    @UseWith(value={COMPONENT,MIXIN,PAGE})
    public @interface Cached

Indicates that a method should only be evaluated once and the result cached. All further calls to the method will return the cached result. Note that this annotation is inheritence-safe; if a subclass calls a superclass method that has \@Cached then the value the subclass method gets is the cached value.

The watch parameter can be passed a binding expression which will be evaluated each time the method is called. The method will then only be executed the first time it is called and after that only when the value of the binding changes. This can be used, for instance, to have the method only evaluated once per iteration of a loop by setting watch to the value or index of the loop.

Optional Element Summary
`java.lang.String` | `watch` The optional binding to watch (default binding prefix is "prop").

### watch

    public abstract java.lang.String watch

  The optional binding to watch (default binding prefix is "prop").

  Default:
    ""

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

Copyright © 2003-2012 The Apache Software Foundation.