类 AspectJPrecedenceComparator
java.lang.Object
infra.aop.aspectj.autoproxy.AspectJPrecedenceComparator
- 所有已实现的接口:
Comparator<Advisor>
Orders AspectJ advice/advisors by precedence (not invocation order).
Given two pieces of advice, A and B:
- If
AandBare defined in different aspects, then the advice in the aspect with the lowest order value has the highest precedence. - If
AandBare defined in the same aspect, if one ofAorBis a form of after advice, then the advice declared last in the aspect has the highest precedence. If neitherAnorBis a form of after advice, then the advice declared first in the aspect has the highest precedence.
Important: This comparator is used with AspectJ's
PartialOrder sorting utility. Thus, unlike
a normal Comparator, a return value of 0 from this comparator
means we don't care about the ordering, not that the two elements must be sorted
identically.
- 从以下版本开始:
- 4.0
- 作者:
- Adrian Colyer, Juergen Hoeller
-
字段概要
字段修饰符和类型字段说明private final Comparator<? super Advisor>private static final intprivate static final intprivate static final int -
构造器概要
构造器构造器说明Create a defaultAspectJPrecedenceComparator.AspectJPrecedenceComparator(Comparator<? super Advisor> advisorComparator) -
方法概要
修饰符和类型方法说明intprivate intcomparePrecedenceWithinAspect(Advisor advisor1, Advisor advisor2) private booleandeclaredInSameAspect(Advisor advisor1, Advisor advisor2) private intgetAspectDeclarationOrder(Advisor advisor) private StringgetAspectName(Advisor advisor) private booleanhasAspectName(Advisor advisor) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
字段详细资料
-
构造器详细资料
-
AspectJPrecedenceComparator
public AspectJPrecedenceComparator()Create a defaultAspectJPrecedenceComparator. -
AspectJPrecedenceComparator
- 参数:
advisorComparator- theComparatorto use for advisors
-
-
方法详细资料
-
compare
- 指定者:
compare在接口中Comparator<Advisor>
-
comparePrecedenceWithinAspect
-
declaredInSameAspect
-
hasAspectName
-
getAspectName
-
getAspectDeclarationOrder
-