本文整理汇总了Java中org.aspectj.lang.annotation.Pointcut类的典型用法代码示例。如果您正苦于以下问题:Java Pointcut类的具体用法?Java Pointcut怎么用?Java Pointcut使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Pointcut类属于org.aspectj.lang.annotation包,在下文中一共展示了Pointcut类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loggingPointcut
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
/**
* Pointcut that matches all repositories, services and Web REST endpoints.
*/
@Pointcut("(within(com.springio.store.repository..*) && @annotation(org.springframework.stereotype.Repository))"+
" || (within(com.springio.store.service..*) && @annotation(org.springframework.stereotype.Service))"+
" || (within(com.springio.store.web.rest..*) && @annotation(org.springframework.web.bind.annotation.RestController))")
public void loggingPointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
示例2: within
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
/**
* Pointcut that matches all repositories, services and Web REST endpoints.
*/
@Pointcut("within(@org.springframework.stereotype.Repository *)" +
" || within(@org.springframework.stereotype.Service *)" +
" || within(@org.springframework.web.bind.annotation.RestController *)")
public void springBeanPointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
示例3: publicMethod
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(public * *(..))"
+ " && !execution(String *.toString())"
+ " && !execution(int *.hashCode())"
+ " && !execution(boolean *.canEqual(Object))"
+ " && !execution(boolean *.equals(Object))")
protected void publicMethod() {
}
示例4: within
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
/**
* Pointcut that matches all Spring beans in the application's main packages.
*/
@Pointcut("within(io.github.pascalgrimaud.qualitoast.repository..*)"+
" || within(io.github.pascalgrimaud.qualitoast.service..*)"+
" || within(io.github.pascalgrimaud.qualitoast.web.rest..*)")
public void applicationPackagePointcut() {
// Method is empty as this is just a Pointcut, the implementations are in the advices.
}
示例5: getAdvisorMethods
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
private List<Method> getAdvisorMethods(Class<?> aspectClass) {
final List<Method> methods = new LinkedList<Method>();
ReflectionUtils.doWithMethods(aspectClass, new ReflectionUtils.MethodCallback() {
@Override
public void doWith(Method method) throws IllegalArgumentException {
// Exclude pointcuts
if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
methods.add(method);
}
}
});
Collections.sort(methods, METHOD_COMPARATOR);
return methods;
}
示例6: findAspectJAnnotationOnMethod
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
/**
* Find and return the first AspectJ annotation on the given method
* (there <i>should</i> only be one anyway...)
*/
@SuppressWarnings("unchecked")
protected static AspectJAnnotation<?> findAspectJAnnotationOnMethod(Method method) {
Class<?>[] classesToLookFor = new Class<?>[] {
Before.class, Around.class, After.class, AfterReturning.class, AfterThrowing.class, Pointcut.class};
for (Class<?> c : classesToLookFor) {
AspectJAnnotation<?> foundAnnotation = findAnnotation(method, (Class<Annotation>) c);
if (foundAnnotation != null) {
return foundAnnotation;
}
}
return null;
}
示例7: anyMethod
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(* *.*(..))")
public void anyMethod() {
//pointcut
}
示例8: methodAnnotated
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(@com.app.annotation.aspect.DbRealm * *(..))")//方法切入点
public void methodAnnotated() {
}
示例9: methodLoggingNotDisabledPointcut
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("[email protected](io.github.logger.controller.annotation.NoLogging)")
public void methodLoggingNotDisabledPointcut() {
}
示例10: webLog
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(public * com.mi.module.*.controller..*.*(..))")
public void webLog(){}
示例11: methodAnnotated
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(@com.app.annotation.aspect.MemoryCache * *(..))")//方法切入点
public void methodAnnotated() {
}
示例12: methodAnnotated
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(@com.app.annotation.aspect.SingleClick * *(..))")//方法切入点
public void methodAnnotated() {
}
示例13: methodAnnotated
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut("execution(@com.app.annotation.aspect.CheckLogin * *(..))")//方法切入点
public void methodAnnotated() {
}
示例14: anyMethod
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
/**
* Matches any execution of a method
*/
@Pointcut("execution(* *(..))")
public void anyMethod() {
}
示例15: methodAnnotatedWithHookMethod
import org.aspectj.lang.annotation.Pointcut; //导入依赖的package包/类
@Pointcut(POINTCUT_METHOD)
public void methodAnnotatedWithHookMethod() {
}