KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > aop > dynaop > DynaopMethodPointcut


1 /*****************************************************************************
2  * Copyright (c) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Idea by Rachel Davies, Original code by various *
9  *****************************************************************************/

10 package org.nanocontainer.aop.dynaop;
11
12 import org.nanocontainer.aop.MethodPointcut;
13
14 import java.lang.reflect.Method JavaDoc;
15
16 /**
17  * Adapts a <code>dynaop.MethodPointcut</code> to the
18  * <code>org.nanocontainer.aop.MethodPointcut</code> interface.
19  *
20  * @author Stephen Molitor
21  * @version $Revision: 3144 $
22  */

23 class DynaopMethodPointcut implements dynaop.MethodPointcut, MethodPointcut {
24
25     private final dynaop.MethodPointcut delegate;
26
27     /**
28      * Creates a new <code>DynaopMethodPointcut</code> that will delegate to
29      * the given <code>dynaop.MethodPointcut</code>.
30      *
31      * @param delegate the <code>dynaop.MethodPointcut</code> to delegate to.
32      */

33     DynaopMethodPointcut(dynaop.MethodPointcut delegate) {
34         this.delegate = delegate;
35     }
36
37     /**
38      * Returns true if the delegate <code>dynaop.MethodPointcut</code> passed
39      * to the constructor picks <code>method</code>.
40      *
41      * @param method the method to match against.
42      * @return true if this pointcut picks <code>method</code>, else false.
43      */

44     public boolean picks(Method JavaDoc method) {
45         return delegate.picks(method);
46     }
47
48 }
Popular Tags