Package org.aspectj.bridge

Examples of org.aspectj.bridge.ISourceLocation


        ((sl.getColumn() == 0) ? ISourceLocation.NO_COLUMN : sl.getColumn()), sl.getContext(), sourceFileName);
    return sLoc;
  }

  private static ISourceLocation createSourceLocation(String sourcefilename, ResolvedType aspect, ISourceLocation sl) {
    ISourceLocation sLoc = new SourceLocation(getBinaryFile(aspect), sl.getLine(), sl.getEndLine(),
        ((sl.getColumn() == 0) ? ISourceLocation.NO_COLUMN : sl.getColumn()), sl.getContext(), sourcefilename);
    return sLoc;
  }
View Full Code Here


    if (!filenode.getKind().equals(IProgramElement.Kind.FILE_JAVA)) {
      return;
    }

    // create the class file node
    ISourceLocation binLocation = getBinarySourceLocation(aspect, aspect.getSourceLocation());
    String f = getBinaryFile(aspect).getName();
    IProgramElement classFileNode = new ProgramElement(model, f, IProgramElement.Kind.FILE, binLocation, 0, null, null);

    // create package ipe if one exists....
    IProgramElement root = model.getHierarchy().getRoot();
View Full Code Here

    for (int i = 0; i < pointcuts.length; i++) {
      ResolvedMember pointcut = pointcuts[i];
      if (pointcut instanceof ResolvedPointcutDefinition) {
        ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pointcut;
        Pointcut p = rpcd.getPointcut();
        ISourceLocation sLoc = (p == null ? null : p.getSourceLocation());
        if (sLoc == null) {
          sLoc = rpcd.getSourceLocation();
        }
        ISourceLocation pointcutLocation = (sLoc == null ? null : createSourceLocation(sourcefilename, aspect, sLoc));
        ProgramElement pointcutElement = new ProgramElement(model, pointcut.getName(), IProgramElement.Kind.POINTCUT,
            pointcutLocation, pointcut.getModifiers(), NO_COMMENT, Collections.<IProgramElement>emptyList());
        containingAspect.addChild(pointcutElement);
      }
    }
View Full Code Here

    for (int i = 0; i < children.length; i++) {
      ResolvedMember pcd = children[i];
      if (pcd instanceof ResolvedPointcutDefinition) {
        ResolvedPointcutDefinition rpcd = (ResolvedPointcutDefinition) pcd;
        Pointcut p = rpcd.getPointcut();
        ISourceLocation sLoc = (p == null ? null : p.getSourceLocation());
        if (sLoc == null) {
          sLoc = rpcd.getSourceLocation();
        }
        parent.addChild(new ProgramElement(asm, pcd.getName(), IProgramElement.Kind.POINTCUT, getBinarySourceLocation(
            aspect, sLoc), pcd.getModifiers(), null, Collections.<IProgramElement>emptyList()));
View Full Code Here

    decpElement.setParentTypes(parents);
  }

  public static String getHandle(AsmManager asm, Advice advice) {
    if (null == advice.handle) {
      ISourceLocation sl = advice.getSourceLocation();
      if (sl != null) {
        IProgramElement ipe = asm.getHierarchy().findElementForSourceLine(sl);
        advice.handle = ipe.getHandleIdentifier();
      }
    }
View Full Code Here

          && sourceLinesMatch(node.getSourceLocation(), shadow.getSourceLocation())) {
        return node;
      }
    }

    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(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
View Full Code Here

    writeSourceLocation(s);
    writeOutTypeAliases(s);
  }

  public static ResolvedTypeMunger readConstructor(VersionedDataInputStream s, ISourceContext context) throws IOException {
    ISourceLocation sloc = null;
    ResolvedMember sig = ResolvedMemberImpl.readResolvedMember(s, context);
    ResolvedMember syntheticCtor = ResolvedMemberImpl.readResolvedMember(s, context);
    ResolvedMember explicitCtor = ResolvedMemberImpl.readResolvedMember(s, context);
    Set superMethodsCalled = readSuperMethodsCalled(s);
    sloc = readSourceLocation(s);
View Full Code Here

  /**
   * Get a source location for the munger. Until intertype mungers remember where they came from, the source location for the
   * munger itself is null. In these cases use the source location for the aspect containing the ITD.
   */
  private ISourceLocation getMungerLocation(ConcreteTypeMunger munger) {
    ISourceLocation sloc = munger.getSourceLocation();
    if (sloc == null) {
      sloc = munger.getAspectType().getSourceLocation();
    }
    return sloc;
  }
View Full Code Here

              if (!isDuplicateOfPreviousITD) {
                // b275032 - this is OK if it is the default ctor and that default ctor was generated
                // at compile time, otherwise we cannot overwrite it
                if (!(typeTransformerSignature.getName().equals("<init>") && existingMember.isDefaultConstructor())) {
                  String aspectName = typeTransformer.getAspectType().getName();
                  ISourceLocation typeTransformerLocation = typeTransformer.getSourceLocation();
                  ISourceLocation existingMemberLocation = existingMember.getSourceLocation();
                  String msg = WeaverMessages.format(WeaverMessages.ITD_MEMBER_CONFLICT, aspectName,
                      existingMember);

                  // this isn't quite right really... as I think the errors should only be recorded against
                  // what is currently being processed or they may get lost or reported twice
View Full Code Here

      getAllStructureChildren(fileNode, peNodes, showSubMember, showMemberAndType);
      for (Iterator<IProgramElement> it = peNodes.iterator(); it.hasNext();) {
        IProgramElement peNode = it.next();
        List<IProgramElement> entries = new ArrayList<IProgramElement>();
        entries.add(peNode);
        ISourceLocation sourceLoc = peNode.getSourceLocation();
        if (null != sourceLoc) {
          Integer hash = new Integer(sourceLoc.getLine());
          List<IProgramElement> existingEntry = annotations.get(hash);
          if (existingEntry != null) {
            entries.addAll(existingEntry);
          }
          annotations.put(hash, entries);
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.ISourceLocation

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.