@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD,FIELD})
@Documented
public @interface Order
@Order
defines the sort order for an annotated component.
The value()
is optional and represents an order value as defined
in the Ordered
interface. Lower values have higher priority. The
default value is Ordered.LOWEST_PRECEDENCE
, indicating
lowest priority (losing to any other specified order value).
Since Spring 4.1, the standard javax.annotation.Priority
annotation can be used as a drop-in replacement for this annotation.
NOTE: Annotation-based ordering is supported for specific kinds
of components only — for example, for annotation-based AspectJ
aspects. Ordering strategies within the Spring container, on the other
hand, are typically based on the Ordered
interface in order to
allow for programmatically configurable ordering of each instance.
Consult the Javadoc for OrderComparator
for details on the sort semantics for non-ordered objects.
Ordered
,
AnnotationAwareOrderComparator
,
OrderUtils
,
javax.annotation.Priority
Modifier and Type | Optional Element and Description |
---|---|
int |
value
The order value.
|
public abstract int value
Default is Ordered.LOWEST_PRECEDENCE
.
Ordered.getOrder()