Package org.aspectj.asm

Examples of org.aspectj.asm.IProgramElement$Kind


    if (packageSeparator != -1) {
      pkg = affectedTypeName.substring(0, packageSeparator);
      type = affectedTypeName.substring(packageSeparator + 1);
    }
    IHierarchy hierarchy = model.getHierarchy();
    IProgramElement typeElem = hierarchy.findElementForType(pkg, type);
    if (typeElem == null) {
      return;
    }

    IProgramElement fieldElem = hierarchy.findElementForSignature(typeElem, IProgramElement.Kind.FIELD,
        affectedFieldName.getName());
    if (fieldElem == null) {
      return;
    }

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

    IProgramElement sourceNode = hierarchy.findElementForSourceLine(declareLocation);
    String sourceHandle = sourceNode.getHandleIdentifier();
    if (sourceHandle == null) {
      return;
    }

    IRelationshipMap relmap = model.getRelationshipMap();
View Full Code Here


            // Might be the case the declaring aspect is generic and thisAspect is parameterizing it. In that case
            // record the actual parameterizations

            ResolvedType target = weaver.getLazyClassGen().getType();
            ResolvedType newParent = nptMunger.getNewParent();
            IProgramElement thisAspectNode = model.getHierarchy().findElementForType(thisAspect.getPackageName(),
                thisAspect.getClassName());
            Map<String, List<String>> declareParentsMap = thisAspectNode.getDeclareParentsMap();
            if (declareParentsMap == null) {
              declareParentsMap = new HashMap<String, List<String>>();
              thisAspectNode.setDeclareParentsMap(declareParentsMap);
            }
            String tname = target.getName();
            String pname = newParent.getName();
            List<String> newparents = declareParentsMap.get(tname);
            if (newparents == null) {
View Full Code Here

      if (handle.equals(nodeHid)) {
        return node;
      } else {
        if (handle.startsWith(nodeHid)) {
          // it must be down here if it is anywhere
          IProgramElement childSearch = findElementForHandle(node, handle);
          if (childSearch != null) {
            return childSearch;
          }
        }
      }
View Full Code Here

    List<String> forRemoval = new ArrayList<String>();
    Set<String> k = null;
    synchronized (this) {
      k = handleMap.keySet();
      for (String handle : k) {
        IProgramElement ipe = handleMap.get(handle);
        if (ipe == null) {
          System.err.println("handleMap expectation not met, where is the IPE for " + handle);
        }
        if (ipe == null || deletedFiles.contains(getCanonicalFilePath(ipe))) {
          forRemoval.add(handle);
        }
      }
      for (String handle : forRemoval) {
        handleMap.remove(handle);
      }
      forRemoval.clear();
      k = typeMap.keySet();
      for (String typeName : k) {
        IProgramElement ipe = typeMap.get(typeName);
        if (deletedFiles.contains(getCanonicalFilePath(ipe))) {
          forRemoval.add(typeName);
        }
      }
      for (String typeName : forRemoval) {
View Full Code Here

    Ajde.getDefault().getModel().addListener(VIEW_LISTENER);
  }

  public void fireNavigateBackAction(StructureView view) {
    IProgramElement backNode = historyModel.navigateBack();

    if (backNode == null) {
      Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("No node to navigate back to in history");
    } else {
      navigationAction(backNode, false);
View Full Code Here

      navigationAction(backNode, false);
    }
  }

  public void fireNavigateForwardAction(StructureView view) {
    IProgramElement forwardNode = historyModel.navigateForward();

    if (forwardNode == null) {
      Ajde.getDefault().getIdeUIAdapter().displayStatusInformation("No node to navigate forward to in history");
    } else {
      navigationAction(forwardNode, false);
View Full Code Here

   * Only navigations of the default view are registered with the history.
   *
   * @param newFilePath the canonicalized path to the new file
   */
  public void fireNavigationAction(String newFilePath, int lineNumber) {
    IProgramElement currNode = Ajde.getDefault().getModel().getHierarchy().findElementForSourceLine(newFilePath, lineNumber);

    if (currNode != null) {
      navigationAction(currNode, true);
    }
  }
View Full Code Here

    for (Iterator it = structureViews.iterator(); it.hasNext();) {
      StructureView view = (StructureView) it.next();
      if (!(view instanceof GlobalStructureView) || !recordHistory || defaultFileView == null) {
        if (node.getKind().equals(IProgramElement.Kind.CODE)) {
          IProgramElement parentNode = node.getParent();
          if (parentNode != null) {
            IStructureViewNode currNode = view.findCorrespondingViewNode(parentNode);
            int lineOffset = node.getSourceLocation().getLine() - parentNode.getSourceLocation().getLine();
            if (currNode != null)
              view.setActiveNode(currNode, lineOffset);
          }
        } else {
          IStructureViewNode currNode = view.findCorrespondingViewNode(node);
View Full Code Here

   * @param struct
   */
  private static void setDeclareErrorOrWarningLocation(AsmManager model, DeclareErrorOrWarning deow, AjAttributeFieldStruct struct) {
    IHierarchy top = (model == null ? null : model.getHierarchy());
    if (top != null && top.getRoot() != null) {
      IProgramElement ipe = top.findElementForLabel(top.getRoot(), IProgramElement.Kind.FIELD, struct.field.getName());
      if (ipe != null && ipe.getSourceLocation() != null) {
        ISourceLocation sourceLocation = ipe.getSourceLocation();
        int start = sourceLocation.getOffset();
        int end = start + struct.field.getName().length();
        deow.setLocation(struct.context, start, end);
        return;
      }
View Full Code Here

    try {
      // Set fileSet = StructureModelManager.INSTANCE.getStructureModel().getFileMap().entrySet();
      Set fileSet = model.getHierarchy().getFileMapEntrySet();
      for (Iterator it = fileSet.iterator(); it.hasNext();) {
        IProgramElement peNode = (IProgramElement) ((Map.Entry) it.next()).getValue();
        dumpStructureToFile(peNode);
      }
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of org.aspectj.asm.IProgramElement$Kind

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.