本文整理了Java中com.google.inject.matcher.Matcher.and()
方法的一些代码示例,展示了Matcher.and()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matcher.and()
方法的具体详情如下:
包路径:com.google.inject.matcher.Matcher
类名称:Matcher
方法名:and
[英]Returns a new matcher which returns true if both this and the given matcher return true.
[中]返回一个新的匹配器,如果该匹配器和给定的匹配器都返回true,则该匹配器将返回true。
代码示例来源:origin: eclipse/kapua
@Override
protected void bindInterceptor(Matcher<? super Class<?>> classMatcher, Matcher<? super Method> methodMatcher, MethodInterceptor... interceptors) {
super.bindInterceptor(classMatcher, Matchers.not(SyntheticMethodMatcher.getInstance()).and(methodMatcher), interceptors);
}
}
代码示例来源:origin: dhanji/sitebricks
@Override
protected void configure() {
Key<Persister> persisterKey = module.selectorKey(Persister.class);
WorkInterceptor workInterceptor = new WorkInterceptor(persisterKey);
TransactionInterceptor transactionInterceptor = new TransactionInterceptor(persisterKey);
requestInjection(workInterceptor);
requestInjection(transactionInterceptor);
Matcher<AnnotatedElement> workMatcher = annotatedWith(Work.class);
Matcher<AnnotatedElement> txnMatcher = annotatedWith(Transactional.class);
// Visible persistence APIs.
if (module.selector != null) {
workMatcher = workMatcher.and(annotatedWith(module.selector));
txnMatcher = txnMatcher.and(annotatedWith(module.selector));
}
bindInterceptor(any(), workMatcher, workInterceptor);
bindInterceptor(any(), txnMatcher, transactionInterceptor);
}
}
代码示例来源:origin: caelum/vraptor
bindListener(not(isApplication).and(not(isSession)), new ScopeLifecycleListener(GuiceProvider.REQUEST));
内容来源于网络,如有侵权,请联系作者删除!