Java Code Examples for com.google.inject.matcher.Matchers#annotatedWith()

The following examples show how to use com.google.inject.matcher.Matchers#annotatedWith() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ValidationModule.java    From guice-validator with MIT License 5 votes vote down vote up
@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);
}
 
Example 2
Source File: ValidationModule.java    From guice-validator with MIT License 5 votes vote down vote up
@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);
}
 
Example 3
Source File: AutoScanSchemeInitializer.java    From guice-persist-orient with MIT License 4 votes vote down vote up
@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(","));
}