Package org.aspectj.asm

Examples of org.aspectj.asm.IRelationshipMap


      shadow.getSourceLocation().getSourceFile(),
      shadow.getSourceLocation().getLine(),
      shadow.getSourceLocation().getColumn(),
      shadow.getSourceLocation().getOffset());

    IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
    if (sourceHandle != null && targetHandle != null) {
      IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE, MATCHED_BY,false,true);
      foreward.addTarget(targetHandle);
//      foreward.getTargets().add(targetHandle);
       
      IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, MATCHES_DECLARE,false,true);
      if (back != null && back.getTargets() != null) {
        back.addTarget(sourceHandle);
        //back.getTargets().add(sourceHandle);  
      }
    }
View Full Code Here


        onType.getSourceLocation().getSourceFile(),
        onType.getSourceLocation().getLine(),
        onType.getSourceLocation().getColumn(),
        onType.getSourceLocation().getOffset());
       
      IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
      if (sourceHandle != null && targetHandle != null) {
        IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARES,false,true);
        foreward.addTarget(targetHandle);
//        foreward.getTargets().add(targetHandle);
       
        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARED_BY,false,true);
        back.addTarget(sourceHandle);
//        back.getTargets().add(sourceHandle); 
      }
    }
  }
View Full Code Here

        targetType.getSourceLocation().getSourceFile(),
        targetType.getSourceLocation().getLine(),
        targetType.getSourceLocation().getColumn(),
        targetType.getSourceLocation().getOffset());
       
    IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
    if (sourceHandle != null && targetHandle != null) {
      IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARES,false,true);
      foreward.addTarget(targetHandle);
       
      IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, INTER_TYPE_DECLARED_BY,false,true);
      back.addTarget(sourceHandle);
    }
   
  }
View Full Code Here

        annotatedLocation.getSourceFile(),
        annotatedLocation.getLine(),
        annotatedLocation.getColumn(),
        annotatedLocation.getOffset());
       
    IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
    if (sourceHandle != null && targetHandle != null) {
      IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES,false,true);
      foreward.addTarget(targetHandle);
       
      IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY,false,true);
      back.addTarget(sourceHandle);
    }
  }
View Full Code Here

        // TODO: might want to show these in the future
        return;
      }
     

      IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
      IProgramElement targetNode = getNode(AsmManager.getDefault().getHierarchy(), shadow);
      boolean runtimeTest = ((BcelAdvice)munger).hasDynamicTests();
     
      // Work out extra info to inform interested UIs !
      IProgramElement.ExtraInformation ai = new IProgramElement.ExtraInformation();

      String adviceHandle = advice.getHandle();
     
      // What kind of advice is it?
      // TODO: Prob a better way to do this but I just want to
      // get it into CVS !!!
      AdviceKind ak = ((Advice)munger).getKind();
      ai.setExtraAdviceInformation(ak.getName());
      IProgramElement adviceElement = AsmManager.getDefault().getHierarchy().findElementForHandle(adviceHandle);
      adviceElement.setExtraInfo(ai);   
     
      if (adviceHandle != null && targetNode != null) {
   
        if (targetNode != null) {
                    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);//foreward.getTargets().add(targetHandle);
                       
                        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, SOFTENED_BY,runtimeTest,true);
                        if (back != null)     back.addTarget(adviceHandle);//back.getTargets().add(adviceHandle);
                    } else {
              IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES,runtimeTest,true);
              if (foreward != null) foreward.addTarget(targetHandle);//foreward.getTargets().add(targetHandle);
             
              IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY,runtimeTest,true);
              if (back != null)     back.addTarget(adviceHandle);//back.getTargets().add(adviceHandle);
                    }
                }
      }
View Full Code Here

      String sourceHandle =
            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
       sourceLocation.getColumn(),sourceLocation.getOffset());
         
      String targetHandle = methodElem.getHandleIdentifier();
      IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
    if (sourceHandle != null && targetHandle != null) {
        IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES,false,true);
        foreward.addTarget(targetHandle);
         
        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY,false,true);
        back.addTarget(sourceHandle);
    }
        } catch (Throwable t) { // I'm worried about that code above, this will make sure we don't explode if it plays up
          t.printStackTrace(); // I know I know .. but I don't want to lose it!
        }
View Full Code Here

            AsmManager.getDefault().getHandleProvider().createHandleIdentifier(sourceLocation.getSourceFile(),sourceLocation.getLine(),
        sourceLocation.getColumn(),sourceLocation.getOffset());
       
    String targetHandle = fieldElem.getHandleIdentifier();
   
        IRelationshipMap mapper = AsmManager.getDefault().getRelationshipMap();
    if (sourceHandle != null && targetHandle != null) {
      IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES,false,true);
      foreward.addTarget(targetHandle);
       
      IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY,false,true);
      back.addTarget(sourceHandle);
    }
  }
View Full Code Here

TOP

Related Classes of org.aspectj.asm.IRelationshipMap

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.