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: SubmissionHandler.java 3701 2007-03-18 12:24:23Z 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 annotated method will be used as a submission handler.
18: * The method should be in the format "<code>doSubmissionName</code>". The
19: * "<code>do</code>" prefix indicates that it's a submission handler and
20: * the rest of the method name will be used as the name of the submission
21: * (with a lower-cased initial character).
22: * <p>When the element is processed and a submission was received with the
23: * same name as the handler, the handler method will be executed instead of
24: * the "<code>processElement</code>" method.
25: *
26: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
27: * @version $Revision: 3701 $
28: * @since 1.5
29: * @see Submission
30: */
31: @Retention(RetentionPolicy.RUNTIME)
32: @Target({ElementType.METHOD})
33: @Documented
34: public @interface SubmissionHandler {
35: /**
36: * A <code>LOCAL</code> submission scope means that only the submission
37: * with the same name in the same element will be able to receive the
38: * data that was submitted.
39: * <p>A <code>GLOBAL</code> submission scope means that any submission
40: * with the same name (even if it belongs to another element) will be
41: * able to receive the data that was submitted.
42: * @since 1.5
43: */
44: public enum Scope {
45: LOCAL, GLOBAL
46: }
47:
48: /**
49: * The submission's scope.
50: * @since 1.5
51: */
52: Scope scope() default Scope.LOCAL;
53:
54: /**
55: * The submission's parameters.
56: * @since 1.5
57: */
58: Param[] params() default {};
59:
60: /**
61: * The submission's regular expression parameters.
62: * @since 1.5
63: */
64: ParamRegexp[] paramRegexps() default {};
65:
66: /**
67: * The submission's beans.
68: * @since 1.5
69: */
70: SubmissionBean[] beans() default {};
71:
72: /**
73: * The submission's uploaded files.
74: * @since 1.5
75: */
76: File[] files() default {};
77:
78: /**
79: * The submission's regular expression file uploads.
80: * @since 1.5
81: */
82: FileRegexp[] fileRegexps() default {};
83:
84: /**
85: * Indicates whether the continuations should be
86: * preserved or cancelled when this submission is sent.
87: * @since 1.6
88: */
89: Continuations continuations() default Continuations.PRESERVE;
90:
91: public enum Continuations {
92: PRESERVE, CANCEL
93: }
94: }
|