當前位置: 首頁>>代碼示例>>Java>>正文


Java Matchers.any方法代碼示例

本文整理匯總了Java中com.google.inject.matcher.Matchers.any方法的典型用法代碼示例。如果您正苦於以下問題:Java Matchers.any方法的具體用法?Java Matchers.any怎麽用?Java Matchers.any使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.inject.matcher.Matchers的用法示例。


在下文中一共展示了Matchers.any方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testBindIntercepor

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
public void testBindIntercepor() {
  final Matcher<Class> classMatcher = Matchers.subclassesOf(List.class);
  final Matcher<Object> methodMatcher = Matchers.any();
  final org.aopalliance.intercept.MethodInterceptor methodInterceptor =
      new org.aopalliance.intercept.MethodInterceptor() {
        @Override
        public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) {
          return null;
        }
      };

  checkModule(
      new AbstractModule() {
        @Override
        protected void configure() {
          bindInterceptor(classMatcher, methodMatcher, methodInterceptor);
        }
      },
      new FailingElementVisitor() {
        @Override
        public Void visit(InterceptorBinding command) {
          assertSame(classMatcher, command.getClassMatcher());
          assertSame(methodMatcher, command.getMethodMatcher());
          assertEquals(Arrays.asList(methodInterceptor), command.getInterceptors());
          return null;
        }
      });
}
 
開發者ID:google,項目名稱:guice,代碼行數:29,代碼來源:ElementsTest.java

示例2: testBindIntercepor

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
public void testBindIntercepor() {
  final Matcher<Class> classMatcher = Matchers.subclassesOf(List.class);
  final Matcher<Object> methodMatcher = Matchers.any();
  final org.aopalliance.intercept.MethodInterceptor methodInterceptor
      = new org.aopalliance.intercept.MethodInterceptor() {
    public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) {
      return null;
    }
  };

  checkModule(
      new AbstractModule() {
        protected void configure() {
          bindInterceptor(classMatcher, methodMatcher, methodInterceptor);
        }
      },

      new FailingElementVisitor() {
        @Override public Void visit(InterceptorBinding command) {
          assertSame(classMatcher, command.getClassMatcher());
          assertSame(methodMatcher, command.getMethodMatcher());
          assertEquals(Arrays.asList(methodInterceptor), command.getInterceptors());
          return null;
        }
      }
  );
}
 
開發者ID:cgruber,項目名稱:guice-old,代碼行數:28,代碼來源:ElementsTest.java

示例3: configure

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
@Override
protected void configure() {
  final Matcher<Object> matcher = Matchers.any();
  bindListener(matcher, new ServerEndpointListener());
}
 
開發者ID:jkiddo,項目名稱:ccow,代碼行數:6,代碼來源:WebSocketsModule.java

示例4: LogModule

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
public LogModule() {
    this(Matchers.any());
}
 
開發者ID:vbauer,項目名稱:herald,代碼行數:4,代碼來源:LogModule.java

示例5: ObjectConverterModule

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
public ObjectConverterModule() {
    this(Matchers.any());
}
 
開發者ID:vbauer,項目名稱:houdini,代碼行數:4,代碼來源:ObjectConverterModule.java

示例6: PackageSchemeInitializer

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
@Inject
public PackageSchemeInitializer(@Named("orient.model.package") final String modelPkgs,
                                final Provider<OObjectDatabaseTx> dbProvider,
                                final ObjectSchemeInitializer schemeInitializer) {
    super(dbProvider, schemeInitializer, Matchers.any(), modelPkgs.split(","));
}
 
開發者ID:xvik,項目名稱:guice-persist-orient,代碼行數:7,代碼來源:PackageSchemeInitializer.java

示例7: ExtAnnotationsModule

import com.google.inject.matcher.Matchers; //導入方法依賴的package包/類
/**
 * Default module constructor to check annotations on all beans.
 */
public ExtAnnotationsModule() {
    this(Matchers.any());
}
 
開發者ID:xvik,項目名稱:guice-ext-annotations,代碼行數:7,代碼來源:ExtAnnotationsModule.java


注:本文中的com.google.inject.matcher.Matchers.any方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。