com.google.inject.matcher.Matcher.and()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中com.google.inject.matcher.Matcher.and()方法的一些代码示例,展示了Matcher.and()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Matcher.and()方法的具体详情如下:
包路径:com.google.inject.matcher.Matcher
类名称:Matcher
方法名:and

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));

相关文章