Java Code Examples for

Following code examples demonstrate how to use spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use various code implementation of this class.

    public static final Pointcut getPointcut() {
        NameMatchMethodPointcut result = new NameMatchMethodPointcut();
        result.setClassFilter(new AnnotationClassFilter(Uri.class));
        return result;

    public AuthorizationAnnotationMatchingPointcut() {
        this.classFilter = new AnnotationClassFilter(Controller.class, true);
        this.methodMatcher = new AnnotationMethodMatcher(Authorization.class);

    public void setClassAnnotations(Class<? extends Annotation>[] classAnnotations) {
        ClassFilter[] filters = new ClassFilter[classAnnotations.length];
        for (int i = 0; i < classAnnotations.length; i++) {
            filters[i] = new AnnotationClassFilter(classAnnotations[i]);
        this.classFilter = andClassFilter ? CompositeClassFilter.AND(filters)
                                         : CompositeClassFilter.OR(filters);

    public PermissionAnnotationMatchingPointcut() {
        this.classFilter = new AnnotationClassFilter(Controller.class, true);
        this.methodMatcher = new AnnotationMethodMatcher(Permission.class);

    public void testAnnotationClassFilter(){
        AnnotationClassFilter classFilter=new AnnotationClassFilter(Time.class);

Simple ClassFilter that looks for a specific Java 5 annotation being present on a class. @author Jue

rgen Hoeller @since 2.0 @see AnnotationMatchingPointcut

Read More