01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: InCookieProperty.java 3687 2007-03-09 23:13:07Z gbevin $
07: */
08: package com.uwyn.rife.engine.annotations;
09:
10: import java.lang.annotation.*;
11:
12: import com.uwyn.rife.engine.exceptions.IncookieInjectionException;
13:
14: /**
15: * Declares that the bean property that corresponds to the annotated setter
16: * will be used as an incookie. The name of the incookie will be the name of
17: * the property.
18: * <p>When the element is processed, the value of the cookie will be injected
19: * into the element through the setter and RIFE's type conversion will try to
20: * convert the cookie's string value into the property type. A
21: * {@link IncookieInjectionException} exception will be thrown if the
22: * conversion failed.
23: *
24: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
25: * @version $Revision: 3687 $
26: * @since 1.5
27: * @see InCookie
28: */
29: @Retention(RetentionPolicy.RUNTIME)
30: @Target({ElementType.METHOD})
31: @Documented
32: public @interface InCookieProperty {
33: /**
34: * The expected name of the property.
35: * <p>
36: * This hasn't got any influence on the actual name that is being used
37: * for the property, but is used instead to ensure that the property name
38: * is the same as the one specified here. This is typically used to create
39: * a single point of declaration for the property name that can be
40: * referenced elsewhere and that is ensured to be correct.
41: *
42: * @since 1.6
43: */
44: String name() default "";
45:
46: /**
47: * The default value of the incookie.
48: * @since 1.5
49: */
50: String defaultValue() default "";
51: }
|