Package org.aspectj.asm.internal

Examples of org.aspectj.asm.internal.ProgramElement


    if (buildConfig.getConfigFile() != null) {
      rootLabel = buildConfig.getConfigFile().getName();
      model.setConfigFile(buildConfig.getConfigFile().getAbsolutePath());
      kind = IProgramElement.Kind.FILE_LST;
    }
    model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList()));

    model.setFileMap(new HashMap<String, IProgramElement>());
    // setStructureModel(model);
    state.setStructureModel(structureModel);
    // state.setRelationshipMap(AsmManager.getDefault().getRelationshipMap());
View Full Code Here


        // AMC - use the source start and end from the compilation unit decl
        int startLine = getStartLine(unit);
        int endLine = getEndLine(unit);
        SourceLocation sourceLocation = new SourceLocation(file, startLine, endLine);
        sourceLocation.setOffset(unit.sourceStart);
        cuNode = new ProgramElement(structureModel, new String(file.getName()), IProgramElement.Kind.FILE_JAVA,
            sourceLocation, 0, null, null);
      }

      // container for import declarations - this may move to position 1 in the child list, if there
      // is a package declaration
      cuNode.addChild(new ProgramElement(structureModel, "", IProgramElement.Kind.IMPORT_REFERENCE, null, 0, null, null));

      final IProgramElement addToNode = genAddToNode(file, unit, structureModel);

      // -- remove duplicates before adding (XXX use them instead?)
      if (addToNode != null && addToNode.getChildren() != null) {
View Full Code Here

        sourceFolderNode = child;
        break;
      }
    }
    if (sourceFolderNode == null) {
      sourceFolderNode = new ProgramElement(structureModel, sourceFolder, IProgramElement.Kind.SOURCE_FOLDER, new ArrayList());
      root.addChild(sourceFolderNode);
    }
    return sourceFolderNode;
  }
View Full Code Here

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

            }

            // Create the ImportReference needed to add a
            // ProgramElement
            ImportReference importRef = new ImportReference(path, new long[] { 0 }, false, 0);
            IProgramElement ceNode = new ProgramElement(activeStructureModel, importRef.toString(),
                IProgramElement.Kind.IMPORT_REFERENCE, makeLocation(importRef), 0, null, null);
            ceNode.setSourceSignature(genSourceSignature(importRef));
            // Add Element to Imports of Current Class
            ProgramElement imports = getImportReferencesRoot();// (ProgramElement) ((IProgramElement)
            // stack.peek()).getChildren().get(0);
            imports.addChild(0, ceNode);
          }
        }
      }
    }

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

    IProgramElement peNode = new ProgramElement(activeStructureModel, name, kind, makeLocation(typeDeclaration), typeModifiers,
        null, null);
    peNode.setSourceSignature(genSourceSignature(typeDeclaration));
    peNode.setFormalComment(generateJavadocComment(typeDeclaration));
    peNode.setAnnotationStyleDeclaration(isAnnotationStyleAspect);

    ((IProgramElement) stack.peek()).addChild(peNode);
    stack.push(peNode);
    return true;
  }
View Full Code Here

      int dotIndex = packageDecl.toString().lastIndexOf('.');
      String packageString = packageDecl.toString();
      if (dotIndex != -1) {
        packageString = packageDecl.toString().substring(0, dotIndex);
      }
      ProgramElement packageDeclaration = new ProgramElement(activeStructureModel, packageString,
          IProgramElement.Kind.PACKAGE_DECLARATION, makeLocation(packageDecl), 0, null, null);
      StringBuffer packageSourceDeclaration = new StringBuffer();
      packageSourceDeclaration.append("package ");
      packageSourceDeclaration.append(packageString);
      packageSourceDeclaration.append(";");
      packageDeclaration.setSourceSignature(packageSourceDeclaration.toString());
      stack.pop();
      ProgramElement containingTypeElement = (ProgramElement) stack.peek();
      containingTypeElement.addChild(0, packageDeclaration);
      packageDecl = null;
    } else {
      stack.pop();
    }
  }
View Full Code Here

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

    IProgramElement peNode = new ProgramElement(activeStructureModel, name, kind, makeLocation(memberTypeDeclaration),
        typeModifiers, null, null);
    peNode.setSourceSignature(genSourceSignature(memberTypeDeclaration));
    peNode.setFormalComment(generateJavadocComment(memberTypeDeclaration));
    peNode.setAnnotationStyleDeclaration(isAnnotationStyleAspect);

    ((IProgramElement) stack.peek()).addChild(peNode);
    stack.push(peNode);
    return true;
  }
View Full Code Here

          break;
        }
      }
    }

    IProgramElement peNode = new ProgramElement(activeStructureModel, fullName, kind, makeLocation(memberTypeDeclaration),
        memberTypeDeclaration.modifiers, null, null);
    peNode.setSourceSignature(genSourceSignature(memberTypeDeclaration));
    peNode.setFormalComment(generateJavadocComment(memberTypeDeclaration));
    peNode.setAnnotationStyleDeclaration(isAnnotationStyleAspect);
    // 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

    // not the generated method

    if (methodDeclaration instanceof InterTypeDeclaration) {
      InterTypeDeclaration itd = (InterTypeDeclaration) methodDeclaration;
      ResolvedMember sig = itd.getSignature();
      peNode = new ProgramElement(activeStructureModel, null, IProgramElement.Kind.ERROR, makeLocation(methodDeclaration),
          (sig != null ? sig.getModifiers() : 0), null, null);

    } else {
      peNode = new ProgramElement(activeStructureModel, null, IProgramElement.Kind.ERROR, makeLocation(methodDeclaration),
          methodDeclaration.modifiers, null, null);
    }
    formatter.genLabelAndKind(methodDeclaration, peNode); // will set the
    // name
    genBytecodeInfo(methodDeclaration, peNode);
View Full Code Here

    }
    if (((IProgramElement) stack.peek()).getPackageName().equals(currPackageImport)) {
      packageDecl = importRef;
    } else {

      ProgramElement peNode = new ProgramElement(activeStructureModel, new String(importRef.toString()),
          IProgramElement.Kind.IMPORT_REFERENCE, makeLocation(importRef), 0,// could set static here, but for
          // some reason the info is
          // private
          null, null);
      // set it here instead
      if (importRef.isStatic()) {
        peNode.addModifiers(IProgramElement.Modifiers.STATIC);
      }
      // create Source signature for import
      peNode.setSourceSignature(genSourceSignature(importRef));

      IProgramElement containingTypeElement = (IProgramElement) stack.peek();
      ProgramElement imports = getImportReferencesRoot();
      imports.addChild(0, peNode);
      stack.push(peNode);
    }
    return true;
  }
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.