1 package net.sf.tacos.annotations; 2 3 import java.lang.annotation.Target; 4 import java.lang.annotation.ElementType; 5 import java.lang.annotation.Retention; 6 import java.lang.annotation.RetentionPolicy; 7 import java.lang.annotation.Documented; 8 9 /** 10 * Annotation used on any (non-abstract) page or component method that returns a value. 11 * <p/> 12 * It caches the method result during the current request cycle, meaning that subsequent calls 13 * do not reevaluate the method's body. 14 * 15 * @author Andreas Andreou 16 */ 17 @Target( 18 { ElementType.METHOD }) 19 @Retention(RetentionPolicy.RUNTIME) 20 @Documented 21 public @interface Cached { 22 23 /** 24 * Set to true if you want to reset the cached value when 25 * the rewind ends (and normal rendering starts).<p/> 26 * 27 * This can be helpful when new values should be calculated for the 28 * new rendering (which perhaps didn't exist while rewinding). 29 * @return 30 */ 31 boolean resetAfterRewind() default false; 32 33 } 34