001 package net.sf.tacos.annotations;
002
003 import java.lang.annotation.Target;
004 import java.lang.annotation.ElementType;
005 import java.lang.annotation.Retention;
006 import java.lang.annotation.RetentionPolicy;
007 import java.lang.annotation.Documented;
008
009 /**
010 * Annotation used on any (non-abstract) page or component method that returns a value.
011 * <p/>
012 * It caches the method result during the current request cycle, meaning that subsequent calls
013 * do not reevaluate the method's body.
014 *
015 * @author Andreas Andreou
016 */
017 @Target(
018 { ElementType.METHOD })
019 @Retention(RetentionPolicy.RUNTIME)
020 @Documented
021 public @interface Cached {
022
023 /**
024 * Set to true if you want to reset the cached value when
025 * the rewind ends (and normal rendering starts).<p/>
026 *
027 * This can be helpful when new values should be calculated for the
028 * new rendering (which perhaps didn't exist while rewinding).
029 * @return
030 */
031 boolean resetAfterRewind() default false;
032
033 }
034