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: FileProperty.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.UploadedFile;
13:
14: /**
15: * Declares that the bean property that corresponds to the annotated setter
16: * will be used to inject an uploaded submission file. The property type
17: * should be {@link UploadedFile}, and the file will be added to the previous
18: * submission that has been declared.
19: * <p>If no submission has been declared beforehand, either through {@link Submission}
20: * or {@link SubmissionHandler}, an exception will be thrown when the
21: * annotations of this element are evaluated.
22: * <p>When the element is processed and the file was uploaded through its
23: * submission, the corresponding instance of {@link UploadedFile} will be injected
24: * into the element through the setter.
25: *
26: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
27: * @version $Revision: 3687 $
28: * @since 1.5
29: * @see File
30: * @see FileRegexp
31: */
32: @Retention(RetentionPolicy.RUNTIME)
33: @Target({ElementType.METHOD})
34: @Documented
35: public @interface FileProperty {
36: /**
37: * The expected name of the property.
38: * <p>
39: * This hasn't got any influence on the actual name that is being used
40: * for the property, but is used instead to ensure that the property name
41: * is the same as the one specified here. This is typically used to create
42: * a single point of declaration for the property name that can be
43: * referenced elsewhere and that is ensured to be correct.
44: *
45: * @since 1.6
46: */
47: String name() default "";
48: }
|