本文整理汇总了Java中org.aspectj.weaver.tools.PointcutExpression类的典型用法代码示例。如果您正苦于以下问题:Java PointcutExpression类的具体用法?Java PointcutExpression怎么用?Java PointcutExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointcutExpression类属于org.aspectj.weaver.tools包,在下文中一共展示了PointcutExpression类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildPointcutExpression
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
/**
* Build the underlying AspectJ pointcut expression.
*/
private PointcutExpression buildPointcutExpression(ClassLoader classLoader) {
PointcutParser parser = initializePointcutParser(classLoader);
PointcutParameter[] pointcutParameters = new PointcutParameter[this.pointcutParameterNames.length];
for (int i = 0; i < pointcutParameters.length; i++) {
pointcutParameters[i] = parser.createPointcutParameter(
this.pointcutParameterNames[i], this.pointcutParameterTypes[i]);
}
return parser.parsePointcutExpression(
replaceBooleanOperators(getExpression()),
this.pointcutDeclarationScope, pointcutParameters);
}
示例2: getFallbackPointcutExpression
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
/**
* Get a new pointcut expression based on a target class's loader rather than the default.
*/
private PointcutExpression getFallbackPointcutExpression(Class<?> targetClass) {
try {
ClassLoader classLoader = targetClass.getClassLoader();
if (classLoader != null && classLoader != this.pointcutClassLoader) {
return buildPointcutExpression(classLoader);
}
}
catch (Throwable ex) {
logger.debug("Failed to create fallback PointcutExpression", ex);
}
return null;
}
示例3: buildPointcutExpression
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
/**
* Build the underlying AspectJ pointcut expression.
*/
private PointcutExpression buildPointcutExpression(ClassLoader classLoader) {
PointcutParser parser = initializePointcutParser(classLoader);
PointcutParameter[] pointcutParameters = new PointcutParameter[this.pointcutParameterNames.length];
for (int i = 0; i < pointcutParameters.length; i++) {
pointcutParameters[i] = parser.createPointcutParameter(
this.pointcutParameterNames[i], this.pointcutParameterTypes[i]);
}
return parser.parsePointcutExpression(replaceBooleanOperators(getExpression()),
this.pointcutDeclarationScope, pointcutParameters);
}
示例4: testAndSubstitution
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
@Test
public void testAndSubstitution() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String)");
PointcutExpression expr =
((AspectJExpressionPointcut) pc).getPointcutExpression();
assertEquals("execution(* *(..)) && args(String)",expr.getPointcutExpression());
}
示例5: testMultipleAndSubstitutions
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
@Test
public void testMultipleAndSubstitutions() {
Pointcut pc = getPointcut("execution(* *(..)) and args(String) and this(Object)");
PointcutExpression expr =
((AspectJExpressionPointcut) pc).getPointcutExpression();
assertEquals("execution(* *(..)) && args(String) && this(Object)",expr.getPointcutExpression());
}
示例6: getPointcutExpression
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
/**
* Return the underlying AspectJ pointcut expression.
*/
public PointcutExpression getPointcutExpression() {
checkReadyToMatch();
return this.pointcutExpression;
}
示例7: buildPointcutExpression
import org.aspectj.weaver.tools.PointcutExpression; //导入依赖的package包/类
private PointcutExpression buildPointcutExpression() {
return pointcutParser.parsePointcutExpression(expression);
}