@Retention(value=RUNTIME) @Target(value=TYPE) public @interface ListenerPriority
BeforeEnterListeners, BeforeLeaveListeners and
AfterNavigationListeners. Listeners will be sorted by their
respective priority value in a descending order before they are executed.
Listeners that are not annotated with @ListenerPriority have a
default priority of zero.
// will be executed first
@ListenerPriority(5)
class HighPriorityListener implements BeforeEnterListener {
}
// will be executed second, default priority is 0
class YetAnotherListener implements BeforeEnterListener {
}
// will be executed third
@ListenerPriority(-5)
class LowPriorityListener implements BeforeEnterListener {
}
| Modifier and Type | Required Element and Description |
|---|---|
int |
value
The priority of the annotated listener, can be any integer.
|
Copyright © 2025. All rights reserved.