@Override public Binding<T> unqualified() { QualifierMatcher q = Qualifiers.matchNone(); return new BindingImpl<T>(context, sourceType, excludeTypes, q, cachePolicy, fixed); }
/** * @param annotType Annotation type class to match; {@code null} to match only the lack of a * qualifier. * @return A QualifierMatcher that matches any annotation of the given class * type. */ public static QualifierMatcher match(Class<? extends Annotation> annotType) { if (annotType == null) { return matchNone(); } else { return new AnnotationClassMatcher(annotType); } }
/** * @param annot Annotation instance to match, or {@code null} to match only the lack of a qualifier. * @return A QualifierMatcher that matches annotations equaling annot */ public static QualifierMatcher match(@Nonnull Annotation annot) { if (annot == null) { return matchNone(); } else if (annot.annotationType().getDeclaredMethods().length == 0) { logger.debug("using type matcher for nullary annotation {}", annot); // Instances of the same nullary annotation are all equal to each other, so just do // type checking. This makes aliasing work with annotation value matchers, b/c we // do not allow aliases to have parameters. The matcher still has value priority. return new AnnotationClassMatcher(annot.annotationType(), DefaultMatcherPriority.MATCH_VALUE); } else { return new AnnotationMatcher(annot); } }