KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > xml > nuts > optional > AspectjNut


1 package jfun.yan.xml.nuts.optional;
2
3 import jfun.yan.Component;
4 import jfun.yan.xml.nuts.MethodNut;
5
6 /**
7  * The <aspectj> tag that declares an aspect.
8  * <p>
9  * This tag will automatically call the "aspectOf" method, and also registers the
10  * aspect to be eagerly instantiated.
11  * </p>
12  * @author Ben Yu
13  * Dec 16, 2005 3:36:17 PM
14  */

15 public class AspectjNut extends MethodNut {
16   public Component eval(){
17     if(super.getName()==null){
18       super.setName("aspectOf");
19     }
20     
21     final Component result = super.eval();
22     this.registerEagerInstantiation(result);
23     return result;
24   }
25 }
26
Popular Tags