All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.aop.MethodAnnotationPointcut Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.aop;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import org.springframework.aop.Pointcut;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;

/**
 * {@link Pointcut} that matches methods with a given annotation.
 * 

* This implementation uses {@link AnnotationUtils#findAnnotation(Method, Class)} to detect annotations on methods. * * @author Laurens Fridael * */ class MethodAnnotationPointcut extends StaticMethodMatcherPointcut { private final Class annotationType; MethodAnnotationPointcut(final Class annotationType) { Assert.notNull(annotationType); this.annotationType = annotationType; } @Override public boolean matches(final Method method, final Class targetClass) { return AnnotationUtils.findAnnotation(method, annotationType) != null; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy