Package org.aspectj.bridge

Examples of org.aspectj.bridge.SourceLocation


    UnwovenClassFile ucf = null;
    try {
      ucf = weaver.addClassFile(bsf.binSrc, bsf.fromInPathDirectory, buildConfig.getOutputDir());
    } catch(IOException ex) {
      IMessage msg = new Message("can't read class file " + bsf.binSrc.getPath(),
                     new SourceLocation(bsf.binSrc,0),false);
      buildManager.handler.handleMessage(msg);
    }
    return ucf;
  }
View Full Code Here


  public ISourceLocation makeSourceLocation(IHasPosition position) {
    if (lineBreaks != null) {
      int line = Arrays.binarySearch(lineBreaks, position.getStart());
      if (line < 0) line = -line;
      return new SourceLocation(getSourceFile(), line); //??? have more info
    } else {
      return new SourceLocation(getSourceFile(), 0);
    }
  }
View Full Code Here

    }
  }
 
  public ISourceLocation makeSourceLocation(int line, int offset) {
        if (line < 0) line = 0;
    SourceLocation sl = new SourceLocation(getSourceFile(), line);
        if (offset > 0) {
            sl.setOffset(offset);
        } else {
            if (lineBreaks != null) {
                int likelyOffset = 0;
                if (line > 0 && line < lineBreaks.length) {
                    //1st char of given line is next char after previous end of line
                    likelyOffset = lineBreaks[line-1] + 1;
                }
                sl.setOffset(likelyOffset);
            }
        }
        return sl;
  }
View Full Code Here

  public ISourceLocation makeSourceLocation(IHasPosition position) {
    return new EclipseSourceLocation(result, position.getStart(), position.getEnd());
  }

    public ISourceLocation makeSourceLocation(int line, int offset) {
    SourceLocation sl = new SourceLocation(getSourceFile(), line);

        if (offset > 0) {
            sl.setOffset(offset);
        } else {
            // compute the offset
            //TODO AV - should we do it lazily?
            int[] offsets = result.lineSeparatorPositions;
            int likelyOffset = 0;
            if (line > 0 && line < offsets.length) {
                //1st char of given line is next char after previous end of line
                likelyOffset = offsets[line-1];//FIXME may be need -2
            }
            sl.setOffset(likelyOffset);
        }
        return sl;
  }
View Full Code Here

    public static ISourceLocation makeSourceLocation(ICompilationUnit unit, IProblem problem) {
        int line = problem.getSourceLineNumber();
        File file = new File(new String(problem.getOriginatingFileName()));
        String context = makeLocationContext(unit, problem);
        // XXX 0 column is wrong but recoverable from makeLocationContext
        return new SourceLocation(file, line, line, 0, context);
    }
View Full Code Here

    public static IMessage makeMessage(ICompilationUnit unit, IProblem problem) {
        ISourceLocation sourceLocation = makeSourceLocation(unit, problem);
        IProblem[] seeAlso = problem.seeAlso();
        ISourceLocation[] seeAlsoLocations = new ISourceLocation[seeAlso.length];
        for (int i = 0; i < seeAlso.length; i++) {
          seeAlsoLocations[i] = new SourceLocation(new File(new String(seeAlso[i].getOriginatingFileName())),
                               seeAlso[i].getSourceLineNumber());
                          
    }
    // We transform messages from AJ types to eclipse IProblems
    // and back to AJ types.  During their time as eclipse problems,
View Full Code Here

                   problem.getSourceStart(),problem.getSourceEnd());
        return msg;
    }              

    public static IMessage makeErrorMessage(ICompilationUnit unit, String text, Exception ex) {
      ISourceLocation loc = new SourceLocation(new File(new String(unit.getFileName())),
                            0,0,0,"");
      IMessage msg = new Message(text,IMessage.ERROR,ex,loc);
      return msg;
    }
View Full Code Here

      IMessage msg = new Message(text,IMessage.ERROR,ex,loc);
      return msg;
    }

  public static IMessage makeErrorMessage(String srcFile, String text, Exception ex) {
    ISourceLocation loc = new SourceLocation(new File(srcFile),
                          0,0,0,"");
    IMessage msg = new Message(text,IMessage.ERROR,ex,loc);
    return msg;
  }
View Full Code Here

    new String[] { "java.lang.", };



  public ISourceLocation makeSourceLocation(IHasPosition location) {
    return new SourceLocation(ISourceLocation.NO_FILE, 0);
  }
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,
View Full Code Here

TOP

Related Classes of org.aspectj.bridge.SourceLocation

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.