com.google.inject.matcher.Matchers#annotatedWith ( )源码实例Demo

下面列出了com.google.inject.matcher.Matchers#annotatedWith ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: guice-validator   文件: ValidationModule.java
@SuppressWarnings("unchecked")
protected Matcher<? super Class<?>> getClassMatcher(final Class<? extends Annotation> annotation) {
    final Matcher<AnnotatedElement> res = Matchers.annotatedWith(annotation);
    return classMatcher == Matchers.any()
            // combine custom filter with annotation
            ? res : res.and((Matcher<? super AnnotatedElement>) classMatcher);
}
 
源代码2 项目: guice-validator   文件: ValidationModule.java
@SuppressWarnings({"unchecked", "PMD.CompareObjectsWithEquals"})
protected Matcher<? super Method> getMethodMatcher(final Class<? extends Annotation> annotation) {
    final Matcher<AnnotatedElement> res = Matchers.annotatedWith(annotation);
    return methodMatcher == DECLARED_METHOD_MATCHER
            // combine custom filter with annotation
            ? res : res.and((Matcher<? super AnnotatedElement>) methodMatcher);
}
 
@Inject
public AutoScanSchemeInitializer(@Named("orient.model.package") final String appPkgs,
                                 final Provider<ODatabaseObject> dbProvider,
                                 final ObjectSchemeInitializer schemeInitializer) {
    super(dbProvider, schemeInitializer, Matchers.annotatedWith(Persistent.class), appPkgs.split(","));
}
 
 同类方法