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: Priority.java 3634 2007-01-08 21:42:24Z 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: * Specifies a declaration priority for an element method.
18: * <p>The main reason is to be able to group {@link SubmissionHandler} annotations
19: * together with the related {@link FileProperty}, {@link ParamProperty} and {@link SubmissionBeanProperty} annotations.
20: * <p>The priority is provided as an array of integers. Each array element is
21: * compared in the natural order of the integer values, but a rightmost array
22: * element is less important than a leftmost array element.
23: * <p>For example:<br />
24: * <pre>{1} < {1,1} < {1,2} < {2} < {3} < {3,1}</pre>
25: * <p>This allows you to for example use the first array element to identify
26: * the submissions, and the secone one to indicate which other methods belong
27: * to those submissions.
28: * <p>When two methods have the same priority, they will be ordered
29: * alphabetically according to their method name.
30: * <p>Methods without a priority are always processed before methods that have
31: * one. This is important because it allows methods without a priority to be
32: * added to a {@link Submission} annotation that has been provided for the class.
33: *
34: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
35: * @version $Revision: 3634 $
36: * @since 1.5
37: */
38: @Retention(RetentionPolicy.RUNTIME)
39: @Target({ElementType.METHOD})
40: @Documented
41: public @interface Priority {
42: /**
43: * The priority of the method that is annotated.
44: * @since 1.5
45: */
46: int[] value();
47: }
|