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: ParamProperty.java 3687 2007-03-09 23:13:07Z gbevin $
07: */
08: package com.uwyn.rife.engine.annotations;
09:
10: import java.lang.annotation.Documented;
11: import java.lang.annotation.ElementType;
12: import java.lang.annotation.Retention;
13: import java.lang.annotation.RetentionPolicy;
14: import java.lang.annotation.Target;
15:
16: /**
17: * Declares that the bean property that corresponds to the annotated setter
18: * will be used as a submission parameter. The name of the parameter will be
19: * the name of the property, and the parameter will be added to the previous
20: * submission that has been declared.
21: * <p>If no submission has been declared beforehand, either through {@link Submission}
22: * or {@link SubmissionHandler}, an exception will be thrown when the
23: * annotations of this element are evaluated.
24: * <p>When the element is processed, the value of the parameter will be
25: * injected into the element through the setter and RIFE's type conversion will
26: * try to convert the parameter's string value into the property type. A
27: * {@link com.uwyn.rife.engine.exceptions.ParameterInjectionException} exception will be thrown if the
28: * conversion failed.
29: *
30: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
31: * @version $Revision: 3687 $
32: * @since 1.5
33: * @see Param
34: * @see ParamRegexp
35: * @see Submission
36: * @see SubmissionHandler
37: */
38: @Retention(RetentionPolicy.RUNTIME)
39: @Target({ElementType.METHOD})
40: @Documented
41: public @interface ParamProperty {
42: /**
43: * The expected name of the property.
44: * <p>
45: * This hasn't got any influence on the actual name that is being used
46: * for the property, but is used instead to ensure that the property name
47: * is the same as the one specified here. This is typically used to create
48: * a single point of declaration for the property name that can be
49: * referenced elsewhere and that is ensured to be correct.
50: *
51: * @since 1.6
52: */
53: String name() default "";
54:
55: /**
56: * The default values of the parameter.
57: * @since 1.5
58: */
59: String[] defaultValues() default {};
60: }
|