KickJava   Java API By Example, From Geeks To Geeks.

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


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.ClassPointcut;
13
14 /**
15  * Adapts a <code>dynaop.ClassPointcut</code> to the
16  * <code>org.nanocontainer.aop.ClassPointcut</code> interface.
17  *
18  * @author Stephen Molitor
19  * @version $Revision: 3144 $
20  */

21 class DynaopClassPointcut implements dynaop.ClassPointcut, ClassPointcut {
22
23     private final dynaop.ClassPointcut delegate;
24
25     /**
26      * Creates a new <code>DynaoClassPointcut</code> that will delegate to the
27      * given <code>dyanop.ClassPointcut</code>.
28      *
29      * @param delegate the <code>dyanop.ClassPointcut</code> to delegate to.
30      */

31     DynaopClassPointcut(dynaop.ClassPointcut delegate) {
32         this.delegate = delegate;
33     }
34
35     /**
36      * Returns true if the <code>dynaop.ClassPointcut</code> delegate passed
37      * to the constructor picks <code>clazz</code>.
38      *
39      * @param clazz the class to match against.
40      * @return true if this pointcut picks <code>clazz</code>, else false.
41      */

42     public boolean picks(Class JavaDoc clazz) {
43         return delegate.picks(clazz);
44     }
45
46 }
Popular Tags