本文整理匯總了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() {
}