Yes, in the ElementMatchers
class, you find a long row of predefined matchers, also such that deal with annotations. Do however know that annotations on interfaces are not inherited. You'd need to wrap the matcher in a ElementMatchers.hasSuperType
to check the entire hierarchy.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…