Package org.aspectj.asm.internal

Examples of org.aspectj.asm.internal.ProgramElement


      // String name = rtMunger.getSignature().toString();
      String name = sig.getDeclaringType().getClassName() + "." + sig.getName();
      if (name.indexOf("$") != -1) {
        name = name.substring(name.indexOf("$") + 1);
      }
      IProgramElement pe = new ProgramElement(model, name, IProgramElement.Kind.INTER_TYPE_FIELD, getBinarySourceLocation(
          aspect, itd.getSourceLocation()), rtMunger.getSignature().getModifiers(), null, Collections.EMPTY_LIST);
      pe.setCorrespondingType(sig.getReturnType().getName());
      return pe;
    } else if (kind == ResolvedTypeMunger.Method) { // ITD
      // METHOD
      String name = sig.getDeclaringType().getClassName() + "." + sig.getName();
      if (name.indexOf("$") != -1) {
        name = name.substring(name.indexOf("$") + 1);
      }
      IProgramElement pe = new ProgramElement(model, name, IProgramElement.Kind.INTER_TYPE_METHOD, getBinarySourceLocation(
          aspect, itd.getSourceLocation()), rtMunger.getSignature().getModifiers(), null, Collections.EMPTY_LIST);
      setParams(pe, sig);
      return pe;
    } else if (kind == ResolvedTypeMunger.Constructor) {
      String name = sig.getDeclaringType().getClassName() + "." + sig.getDeclaringType().getClassName();
      if (name.indexOf("$") != -1) {
        name = name.substring(name.indexOf("$") + 1);
      }
      IProgramElement pe = new ProgramElement(model, name, IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR,
          getBinarySourceLocation(aspect, itd.getSourceLocation()), rtMunger.getSignature().getModifiers(), null,
          Collections.EMPTY_LIST);
      setParams(pe, sig);
      return pe;
      // } else if (kind == ResolvedTypeMunger.MethodDelegate2) {
View Full Code Here


    }
    pe.setCorrespondingType(sig.getReturnType().getName());
  }

  private static IProgramElement createDeclareParentsChild(AsmManager model, DeclareParents decp) {
    IProgramElement decpElement = new ProgramElement(model, "declare parents", IProgramElement.Kind.DECLARE_PARENTS,
        getBinarySourceLocation(decp.getDeclaringType(), decp.getSourceLocation()), Modifier.PUBLIC, null,
        Collections.EMPTY_LIST);
    return decpElement;
  }
View Full Code Here

    // XXX why not use shadow file? new SourceLocation(sl.getSourceFile(),
    // sl.getLine()),
    SourceLocation peLoc = new SourceLocation(enclosingNode.getSourceLocation().getSourceFile(), sl.getLine());
    peLoc.setOffset(sl.getOffset());
    IProgramElement peNode = new ProgramElement(asm, shadow.toString(), IProgramElement.Kind.CODE, peLoc, 0, null, null);

    // check to see if the enclosing shadow already has children with the
    // same name. If so we want to add a counter to the byteCodeName
    // otherwise
    // we wont get unique handles
    int numberOfChildrenWithThisName = 0;
    for (Iterator it = enclosingNode.getChildren().iterator(); it.hasNext();) {
      IProgramElement child = (IProgramElement) it.next();
      if (child.getName().equals(shadow.toString())) {
        numberOfChildrenWithThisName++;
      }
    }
    peNode.setBytecodeName(shadowSig.getName() + "!" + String.valueOf(numberOfChildrenWithThisName + 1));
    peNode.setBytecodeSignature(shadowSig.getSignature());
    enclosingNode.addChild(peNode);
    return peNode;
  }
View Full Code Here

        if (buildConfig.getConfigFile() != null) {
             rootLabel = buildConfig.getConfigFile().getName();
             model.setConfigFile(buildConfig.getConfigFile().getAbsolutePath());
             kind = IProgramElement.Kind.FILE_LST; 
        }
        model.setRoot(new ProgramElement(rootLabel, kind, new ArrayList()));
               
        model.setFileMap(new HashMap());
        setStructureModel(model);
    state.setStructureModel(model);
    state.setRelationshipMap(AsmManager.getDefault().getRelationshipMap());
View Full Code Here

    ISourceLocation sl = shadow.getSourceLocation();
   
//    XXX why not use shadow file? new SourceLocation(sl.getSourceFile(), sl.getLine()),
    SourceLocation peLoc = new SourceLocation(enclosingNode.getSourceLocation().getSourceFile(),sl.getLine());
    peLoc.setOffset(sl.getOffset());
    IProgramElement peNode = new ProgramElement(
      shadow.toString(),
      IProgramElement.Kind.CODE,
      peLoc,
      0,
      "",
      new ArrayList());
       
    peNode.setBytecodeName(shadowSig.getName());
    peNode.setBytecodeSignature(shadowSig.getSignature());
    enclosingNode.addChild(peNode);
    return peNode;
  }
View Full Code Here

            int startLine = getStartLine(unit);
            int endLine = getEndLine(unit);    
            SourceLocation sourceLocation
                = new SourceLocation(file, startLine, endLine);
            sourceLocation.setOffset(unit.sourceStart);
            cuNode = new ProgramElement(
                new String(file.getName()),
                IProgramElement.Kind.FILE_JAVA,
                sourceLocation,
                0,
                "",
                new ArrayList());
        }

    cuNode.addChild(new ProgramElement(
      "import declarations",
      IProgramElement.Kind.IMPORT_REFERENCE,
      null,
      0,
      "",
View Full Code Here

                  }
              }
        }
            if (pkgNode == null) {
                // note packages themselves have no source location
                pkgNode = new ProgramElement(
                    pkgName,
                    IProgramElement.Kind.PACKAGE,
                    new ArrayList()
                );
                structureModel.getRoot().addChild(pkgNode);
View Full Code Here

        int typeModifiers = typeDeclaration.modifiers;
        if (typeDeclaration instanceof AspectDeclaration) {
          typeModifiers = ((AspectDeclaration)typeDeclaration).getDeclaredModifiers();
        }

    IProgramElement peNode = new ProgramElement(
      name,
      kind,
      makeLocation(typeDeclaration),
      typeModifiers,     
      "",
      new ArrayList());
    peNode.setSourceSignature(genSourceSignature(typeDeclaration));
    peNode.setFormalComment(generateJavadocComment(typeDeclaration));
   
    ((IProgramElement)stack.peek()).addChild(peNode);
    stack.push(peNode);
    return true;
  }
View Full Code Here

        int typeModifiers = memberTypeDeclaration.modifiers;
        if (memberTypeDeclaration instanceof AspectDeclaration) {
          typeModifiers = ((AspectDeclaration)memberTypeDeclaration).getDeclaredModifiers();
        }

    IProgramElement peNode = new ProgramElement(
      name,
      kind,
      makeLocation(memberTypeDeclaration),
      typeModifiers,
      "",
      new ArrayList());
    peNode.setSourceSignature(genSourceSignature(memberTypeDeclaration));
    peNode.setFormalComment(generateJavadocComment(memberTypeDeclaration));
   
    ((IProgramElement)stack.peek()).addChild(peNode);
    stack.push(peNode);
    return true;
  }
View Full Code Here

                    break;
                }
            }
        }
       
    IProgramElement peNode = new ProgramElement(
      fullName,
      kind,
      makeLocation(memberTypeDeclaration),
      memberTypeDeclaration.modifiers,
      "",
      new ArrayList());
    peNode.setSourceSignature(genSourceSignature(memberTypeDeclaration));
    peNode.setFormalComment(generateJavadocComment(memberTypeDeclaration));
    // if we're something like 'new Runnable(){..}' then set the
    // bytecodeSignature to be the typename so we can match it later
    // when creating the structure model
    if (peNode.getBytecodeSignature() == null
        && memberTypeDeclaration.binding != null
        && memberTypeDeclaration.binding.constantPoolName() != null) {
      StringTokenizer st = new StringTokenizer(
          new String(memberTypeDeclaration.binding.constantPoolName()),"/");
      while(st.hasMoreTokens()) {
        String s = st.nextToken();
        if (!st.hasMoreTokens()) {
          peNode.setBytecodeSignature(s);
        }
      }
    }

    ((IProgramElement)stack.peek()).addChild(peNode);
View Full Code Here

TOP

Related Classes of org.aspectj.asm.internal.ProgramElement

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.