当前位置: 首页>>代码示例>>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;未经允许,请勿转载。