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


Java ShadowMatch.alwaysMatches方法代码示例

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


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

示例1: matchers

import org.aspectj.weaver.tools.ShadowMatch; //导入方法依赖的package包/类
/**
 * 使用 AspectJ Expression 匹配方法
 * @param method
 * @param targetClass
 * @return 成功匹配返回 true,否则返回 false
 */
@Override
public Boolean matchers(Method method, Class targetClass) {
    checkReadyToMatche();
    ShadowMatch shadowMatch = pointcutExpression.matchesMethodExecution(method);

    // Special handling for this, target, @this, @target, @annotation
    // in Spring - we can optimize since we know we have exactly this class,
    // and there will never be matching subclass at runtime.
    // https://github.com/spring-projects/spring-framework/blob/master/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
    if (shadowMatch.alwaysMatches()) {
        return true;
    }
    else if (shadowMatch.neverMatches()) {
        return false;
    }

    return false;
}
 
开发者ID:code4wt,项目名称:toy-spring,代码行数:25,代码来源:AspectJExpressionPointcut.java

示例2: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入方法依赖的package包/类
@Override
public boolean matches(Method method, Class<?> targetClass, boolean beanHasIntroductions) {
	checkReadyToMatch();
	Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
	ShadowMatch shadowMatch = getShadowMatch(targetMethod, method);

	// Special handling for this, target, @this, @target, @annotation
	// in Spring - we can optimize since we know we have exactly this class,
	// and there will never be matching subclass at runtime.
	if (shadowMatch.alwaysMatches()) {
		return true;
	}
	else if (shadowMatch.neverMatches()) {
		return false;
	}
	else {
		// the maybe case
		if (beanHasIntroductions) {
			return true;
		}
		// A match test returned maybe - if there are any subtype sensitive variables
		// involved in the test (this, target, at_this, at_target, at_annotation) then
		// we say this is not a match as in Spring there will never be a different
		// runtime subtype.
		RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch);
		return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass));
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:AspectJExpressionPointcut.java

示例3: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入方法依赖的package包/类
@Override
public boolean matches(Method method, Class targetClass) {
	checkReadyToMatch();
	ShadowMatch shadowMatch = pointcutExpression.matchesMethodExecution(method);
	if (shadowMatch.alwaysMatches()) {
		return true;
	} else if (shadowMatch.neverMatches()) {
		return false;
	}
	// TODO:其他情况不判断了!见org.springframework.aop.aspectj.RuntimeTestWalker
	return false;
}
 
开发者ID:greyireland,项目名称:tiny-spring,代码行数:13,代码来源:AspectJExpressionPointcut.java

示例4: matches

import org.aspectj.weaver.tools.ShadowMatch; //导入方法依赖的package包/类
public boolean matches(Method method, Class<?> targetClass, boolean beanHasIntroductions) {
	checkReadyToMatch();
	Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
	ShadowMatch shadowMatch = getShadowMatch(targetMethod, method);

	// Special handling for this, target, @this, @target, @annotation
	// in Spring - we can optimize since we know we have exactly this class,
	// and there will never be matching subclass at runtime.
	if (shadowMatch.alwaysMatches()) {
		return true;
	}
	else if (shadowMatch.neverMatches()) {
		return false;
	}
	else {
		// the maybe case
		if (beanHasIntroductions) {
			return true;
		}
		// A match test returned maybe - if there are any subtype sensitive variables
		// involved in the test (this, target, at_this, at_target, at_annotation) then
		// we say this is not a match as in Spring there will never be a different
		// runtime subtype.
		RuntimeTestWalker walker = getRuntimeTestWalker(shadowMatch);
		return (!walker.testsSubtypeSensitiveVars() || walker.testTargetInstanceOfResidue(targetClass));
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:28,代码来源:AspectJExpressionPointcut.java


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