当前位置: 首页>>代码示例>>Java>>正文


Java ClassFilter.TRUE属性代码示例

本文整理汇总了Java中org.springframework.aop.ClassFilter.TRUE属性的典型用法代码示例。如果您正苦于以下问题:Java ClassFilter.TRUE属性的具体用法?Java ClassFilter.TRUE怎么用?Java ClassFilter.TRUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.aop.ClassFilter的用法示例。


在下文中一共展示了ClassFilter.TRUE属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AnnotationMatchingPointcut

/**
 * Create a new AnnotationMatchingPointcut for the given annotation type.
 * @param classAnnotationType the annotation type to look for at the class level
 * (can be {@code null})
 * @param methodAnnotationType the annotation type to look for at the method level
 * (can be {@code null})
 */
public AnnotationMatchingPointcut(
		Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType) {

	Assert.isTrue((classAnnotationType != null || methodAnnotationType != null),
			"Either Class annotation type or Method annotation type needs to be specified (or both)");

	if (classAnnotationType != null) {
		this.classFilter = new AnnotationClassFilter(classAnnotationType);
	}
	else {
		this.classFilter = ClassFilter.TRUE;
	}

	if (methodAnnotationType != null) {
		this.methodMatcher = new AnnotationMethodMatcher(methodAnnotationType);
	}
	else {
		this.methodMatcher = MethodMatcher.TRUE;
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:27,代码来源:AnnotationMatchingPointcut.java

示例2: equals

@Override
public boolean equals(Object other) {
	if (this == other) {
		return true;
	}
	if (!super.equals(other)) {
		return false;
	}
	ClassFilter otherCf1 = ClassFilter.TRUE;
	ClassFilter otherCf2 = ClassFilter.TRUE;
	if (other instanceof ClassFilterAwareUnionMethodMatcher) {
		ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher) other;
		otherCf1 = cfa.cf1;
		otherCf2 = cfa.cf2;
	}
	return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:MethodMatchers.java

示例3: testUnionMethodMatcher

@Test
public void testUnionMethodMatcher() {
	// Matches the getAge() method in any class
	ComposablePointcut pc = new ComposablePointcut(ClassFilter.TRUE, GET_AGE_METHOD_MATCHER);
	assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
	assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null));

	pc.union(GETTER_METHOD_MATCHER);
	// Should now match all getter methods
	assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null));

	pc.union(ABSQUATULATE_METHOD_MATCHER);
	// Should now match absquatulate() as well
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_ABSQUATULATE, TestBean.class, null));
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_AGE, TestBean.class, null));
	assertTrue(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_GET_NAME, TestBean.class, null));
	// But it doesn't match everything
	assertFalse(Pointcuts.matches(pc, PointcutsTests.TEST_BEAN_SET_AGE, TestBean.class, null));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:22,代码来源:ComposablePointcutTests.java

示例4: MetaAnnotationMatchingPointcut

/**
 * Create a new MetaAnnotationMatchingPointcut for the given annotation type.
 *
 * @param classAnnotationType	the annotation type to look for at the class level
 *                             (can be <code>null</code>)
 * @param methodAnnotationType the annotation type to look for at the method level
 *                             (can be <code>null</code>)
 */
public MetaAnnotationMatchingPointcut(
		Class<? extends Annotation> classAnnotationType, Class<? extends Annotation> methodAnnotationType) {

	Assert.isTrue((classAnnotationType != null || methodAnnotationType != null),
			"Either Class annotation type or Method annotation type needs to be specified (or both)");

	if (classAnnotationType != null) {
		this.classFilter = new AnnotationClassFilter(classAnnotationType);
	} else {
		this.classFilter = ClassFilter.TRUE;
	}

	if (methodAnnotationType != null) {
		this.methodMatcher = new MetaAnnotationMethodMatcher(methodAnnotationType);
	} else {
		this.methodMatcher = MethodMatcher.TRUE;
	}
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:26,代码来源:MetaAnnotationMatchingPointcut.java

示例5: getAdvisedProxy

private ITestBean getAdvisedProxy(TestBean target) {
	ProxyFactory pf = new ProxyFactory(new Class<?>[]{ITestBean.class});
	pf.setProxyTargetClass(true);

	MethodInterceptor advice = new NopInterceptor();
	Pointcut pointcut = new Pointcut() {
		@Override
		public ClassFilter getClassFilter() {
			return ClassFilter.TRUE;
		}
		@Override
		public MethodMatcher getMethodMatcher() {
			return MethodMatcher.TRUE;
		}
		@Override
		public boolean equals(Object obj) {
			return true;
		}
		@Override
		public int hashCode() {
			return 0;
		}
	};
	pf.addAdvisor(new DefaultPointcutAdvisor(pointcut, advice));

	pf.setTarget(target);
	pf.setFrozen(true);
	pf.setExposeProxy(false);

	return (ITestBean) pf.getProxy();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:31,代码来源:CglibProxyTests.java

示例6: getClassFilter

@Override
public ClassFilter getClassFilter() {
	return ClassFilter.TRUE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:DynamicMethodMatcherPointcut.java

示例7: ComposablePointcut

/**
 * Create a default ComposablePointcut, with {@code ClassFilter.TRUE}
 * and {@code MethodMatcher.TRUE}.
 */
public ComposablePointcut() {
	this.classFilter = ClassFilter.TRUE;
	this.methodMatcher = MethodMatcher.TRUE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:ComposablePointcut.java

示例8: getClassFilter

/**
 * @return a class filter that lets all class through.
 */
@Override
public ClassFilter getClassFilter() {
	return ClassFilter.TRUE;
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:7,代码来源:MonitoredSpringAsyncAndScheduledPointcut.java

示例9: getClassFilter

public ClassFilter getClassFilter() {
	return ClassFilter.TRUE;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:3,代码来源:DynamicMethodMatcherPointcut.java

示例10: getClassFilter

/**
 * Returns a class filter that lets all class through.
 *
 * @return a class filter that lets all class through
 */
@Override
public ClassFilter getClassFilter() {
	return ClassFilter.TRUE;
}
 
开发者ID:virgo47,项目名称:javasimon,代码行数:9,代码来源:MonitoredMeasuringPointcut.java


注:本文中的org.springframework.aop.ClassFilter.TRUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。