package jfun.yan.xml.nuts.optional;
import jfun.yan.Component;
import jfun.yan.Components;
import jfun.yan.etc.injection.Injection;
import jfun.yan.etc.injection.InjectionUtils;
import jfun.yan.xml.nuts.Prop;
/**
* This class declares an aspect and enables the setting of {@link Injection}
* to the property "injection".
* <p>
* @author Ben Yu
* Dec 16, 2005 3:37:44 PM
*/
public class InjectorAspectNut extends AspectjNut {
public void setInjection(Component inj){
final Prop prop = new Prop();
prop.initGloballyDefined(this.isGloballyDefined());
prop.initNutEnvironment(this.getNutEnvironment());
prop.initSequenceNumber(0);
prop.initTagLocation(this.getTagLocation());
prop.initTagName("injection");
prop.setKey("injection");
prop.setVal(InjectionUtils.toInjection(inj));
super.addProp(prop);
}
}