Package org.aspectj.asm

Examples of org.aspectj.asm.IRelationshipMap


    String nodeHandle = node.getHandleIdentifier();
    // Don't put relationships on fields as they can then appear twice when building the outline -
    // once under clinit field-set nodes and once under the field declaration.
    if (nodeHandle != null && !node.getKind().equals(IProgramElement.Kind.FIELD)) {
      AsmManager manager = Ajde.getDefault().getModel();
      IRelationshipMap relMap = (manager == null ? null : manager.getRelationshipMap());
      List relationships = (relMap == null ? null : relMap.get(nodeHandle));
      if (relationships != null) {
        for (Iterator it = relationships.iterator(); it.hasNext();) {
          IRelationship rel = (IRelationship) it.next();
          if (rel != null && rel.getTargets().size() > 0) {
            IStructureViewNode relNode = createRelationship(rel, iconRegistry.getIcon(rel.getKind()));
View Full Code Here


    String sourceHandle = sourceNode.getHandleIdentifier();
    if (sourceHandle == null) {
      return;
    }

    IRelationshipMap relmap = model.getRelationshipMap();
    IRelationship foreward = relmap.get(sourceHandle, IRelationship.Kind.DECLARE, MATCHED_BY, false, true);
    foreward.addTarget(targetHandle);

    IRelationship back = relmap.get(targetHandle, IRelationship.Kind.DECLARE, MATCHES_DECLARE, false, true);
    if (back != null && back.getTargets() != null) {
      back.addTarget(sourceHandle);
    }
    if (sourceNode.getSourceLocation() != null) {
      model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
View Full Code Here

      }
      String targetHandle = findOrFakeUpNode(model, onType);
      if (targetHandle == null) {
        return;
      }
      IRelationshipMap mapper = model.getRelationshipMap();
      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);
      if (sourceNode != null && sourceNode.getSourceLocation() != null) {
        // May have been a bug in the compiled aspect - so it didn't get put in the model
        model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
View Full Code Here

    String targetHandle = targetNode.getHandleIdentifier();
    if (targetHandle == null) {
      return;
    }

    IRelationshipMap mapper = model.getRelationshipMap();
    // if (isRemove) {
    // IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, REMOVES_ANNOTATION, false,
    // true);
    // foreward.addTarget(targetHandle);
    //
    // IRelationship back = mapper
    // .get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATION_REMOVED_BY, false, true);
    // back.addTarget(sourceHandle);
    // if (sourceNode.getSourceLocation() != null) {
    // model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
    // }
    // } else {
    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);
    if (sourceNode.getSourceLocation() != null) {
      model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
    }
    // }
View Full Code Here

      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);
        }

        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.DECLARE, SOFTENED_BY, runtimeTest, true);
        if (back != null) {
          back.addTarget(adviceHandle);
        }
      } else {
        IRelationship foreward = mapper.get(adviceHandle, IRelationship.Kind.ADVICE, ADVISES, runtimeTest, true);
        if (foreward != null) {
          foreward.addTarget(targetHandle);
        }

        IRelationship back = mapper.get(targetHandle, IRelationship.Kind.ADVICE, ADVISED_BY, runtimeTest, true);
        if (back != null) {
          back.addTarget(adviceHandle);
        }
      }
      if (adviceElement.getSourceLocation() != null) {
View Full Code Here

      String sourceHandle = sourceNode.getHandleIdentifier();
      if (sourceHandle == null) {
        return;
      }

      IRelationshipMap mapper = model.getRelationshipMap();
      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

    String sourceHandle = sourceNode.getHandleIdentifier();
    if (sourceHandle == null) {
      return;
    }

    IRelationshipMap relmap = model.getRelationshipMap();
    // if (isRemove) {
    // IRelationship foreward = relmap.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, REMOVES_ANNOTATION, false,
    // true);
    // foreward.addTarget(targetHandle);
    // IRelationship back = relmap
    // .get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATION_REMOVED_BY, false, true);
    // back.addTarget(sourceHandle);
    // } else {
    IRelationship foreward = relmap.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATES, false, true);
    foreward.addTarget(targetHandle);
    IRelationship back = relmap.get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATED_BY, false, true);
    back.addTarget(sourceHandle);
    // }
  }
View Full Code Here

    String sourceHandle = sourceNode.getHandleIdentifier();
    if (sourceHandle == null) {
      return;
    }

    IRelationshipMap relmap = model.getRelationshipMap();
    IRelationship foreward = relmap.get(sourceHandle, IRelationship.Kind.DECLARE, MATCHED_BY, false, true);
    foreward.addTarget(targetHandle);

    IRelationship back = relmap.get(targetHandle, IRelationship.Kind.DECLARE, MATCHES_DECLARE, false, true);
    if (back != null && back.getTargets() != null) {
      back.addTarget(sourceHandle);
    }
    if (sourceNode.getSourceLocation() != null) {
      model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
View Full Code Here

      }
      String targetHandle = findOrFakeUpNode(model, onType);
      if (targetHandle == null) {
        return;
      }
      IRelationshipMap mapper = model.getRelationshipMap();
      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);
      if (sourceNode != null && sourceNode.getSourceLocation() != null) {
        // May have been a bug in the compiled aspect - so it didn't get put in the model
        model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
View Full Code Here

    String targetHandle = targetNode.getHandleIdentifier();
    if (targetHandle == null) {
      return;
    }

    IRelationshipMap mapper = model.getRelationshipMap();
    // if (isRemove) {
    // IRelationship foreward = mapper.get(sourceHandle, IRelationship.Kind.DECLARE_INTER_TYPE, REMOVES_ANNOTATION, false,
    // true);
    // foreward.addTarget(targetHandle);
    //
    // IRelationship back = mapper
    // .get(targetHandle, IRelationship.Kind.DECLARE_INTER_TYPE, ANNOTATION_REMOVED_BY, false, true);
    // back.addTarget(sourceHandle);
    // if (sourceNode.getSourceLocation() != null) {
    // model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
    // }
    // } else {
    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);
    if (sourceNode.getSourceLocation() != null) {
      model.addAspectInEffectThisBuild(sourceNode.getSourceLocation().getSourceFile());
    }
    // }
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.