Exemplo n.º 1
0
        public override void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
        {
            var exceptions = model.Descendants <UnifiedCatch>();

            foreach (var e in exceptions)
            {
                var regex = new Regex("^" + target.GetTargetName().ElementAt(1) + "$");
                var type  = e.Types[0].BasicTypeName as UnifiedIdentifier;
                if (type == null)
                {
                    continue;
                }
                var m = regex.Match(type.Name);
                if (m.Success)
                {
                    //アドバイスを対象関数に合成する
                    e.Body.Insert(0, advice.DeepCopy());
                }
            }
        }
Exemplo n.º 2
0
 public override void After(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtAfterCallByName(model, target.GetTargetName().ElementAt(1), advice);
 }
Exemplo n.º 3
0
 public override void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     InsertAtBeforeGetByName(model, target.GetTargetName().ElementAt(1), advice);
 }
Exemplo n.º 4
0
 public override void After(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
 {
     throw new NotImplementedException();
 }
        // 指定されたポイントカット(名)に対応するafterの織り込み処理を与えられたmodelに適用します
        public static void WeavingAfter(string name, UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice)
        {
            var aspect = GetProcessorFromName(name);

            aspect.After(model, target, advice);
        }
Exemplo n.º 6
0
 // TODO Pointcutの名前が競合しないようにする
 public abstract void Before(UnifiedElement model, AspectElement.Pointcut target, UnifiedBlock advice);