Package org.aspectj.weaver

Examples of org.aspectj.weaver.Advice


        } else {
          counter = dwCtr++;
        }
        parent.addChild(createDeclareErrorOrWarningChild(asm, aspect, decl, counter));
      } else if (element instanceof Advice) {
        Advice advice = (Advice) element;
        parent.addChild(createAdviceChild(asm, advice));
      } else if (element instanceof DeclareParents) {
        parent.addChild(createDeclareParentsChild(asm, (DeclareParents) element));
      } else if (element instanceof BcelTypeMunger) {
        IProgramElement newChild = createIntertypeDeclaredChild(asm, aspect, (BcelTypeMunger) element);
View Full Code Here


    if (model == null) {
      return;
    }

    if (munger instanceof Advice) {
      Advice advice = (Advice) munger;

      if (advice.getKind().isPerEntry() || advice.getKind().isCflow()) {
        // TODO: might want to show these in the future
        return;
      }

      if (World.createInjarHierarchy) {
        createHierarchyForBinaryAspect(model, advice);
      }

      IRelationshipMap mapper = model.getRelationshipMap();
      IProgramElement targetNode = getNode(model, matchedShadow);
      if (targetNode == null) {
        return;
      }
      boolean runtimeTest = advice.hasDynamicTests();

      IProgramElement.ExtraInformation extra = new IProgramElement.ExtraInformation();

      String adviceHandle = getHandle(model, advice);
      if (adviceHandle == null) {
        return;
      }

      extra.setExtraAdviceInformation(advice.getKind().getName());
      IProgramElement adviceElement = model.getHierarchy().findElementForHandle(adviceHandle);
      if (adviceElement != null) {
        adviceElement.setExtraInfo(extra);
      }
      String targetHandle = targetNode.getHandleIdentifier();
      if (advice.getKind().equals(AdviceKind.Softener)) {
        IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.DECLARE_SOFT, SOFTENS, runtimeTest, true);
        if (foreward != null) {
          foreward.addTarget(targetHandle);
        }
View Full Code Here

      Pointcut newP = rewriter.rewrite(p);
      // validateBindings now whilst we still have around the pointcut
      // that resembles what the user actually wrote in their program
        // text.
      if (munger instanceof Advice) {
        Advice advice = (Advice) munger;
        if (advice.getSignature() != null) {
          final int numFormals;
                    final String names[];
                    //ATAJ for @AJ aspect, the formal have to be checked according to the argument number
                    // since xxxJoinPoint presence or not have side effects
                    if (advice.getConcreteAspect().isAnnotationStyleAspect()) {
                        numFormals = advice.getBaseParameterCount();
                        int numArgs = advice.getSignature().getParameterTypes().length;
                        if (numFormals > 0) {
                            names = advice.getSignature().getParameterNames(world);
                            validateBindings(newP,p,numArgs,names);
                        }
                    } else {
                        numFormals = advice.getBaseParameterCount();
                        if (numFormals > 0) {
                            names = advice.getBaseParameterNames(world);
                            validateBindings(newP,p,numFormals,names);
                        }
                    }
        }
      }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.Advice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.