Package org.aspectj.bridge

Examples of org.aspectj.bridge.SourceLocation


    }

    public void showError(String message) {
      ISourceLocation location = null;
      if (buildConfig.getConfigFile() != null) {
        location = new SourceLocation(buildConfig.getConfigFile(), 0);
      }
      IMessage errorMessage = new Message(CONFIG_MSG + message, IMessage.ERROR, null, location);
      handler.handleMessage(errorMessage);
      // MessageUtil.error(handler, CONFIG_MSG + message);
    }
View Full Code Here


    }

    protected void showWarning(String message) {
      ISourceLocation location = null;
      if (buildConfig.getConfigFile() != null) {
        location = new SourceLocation(buildConfig.getConfigFile(), 0);
      }
      IMessage errorMessage = new Message(CONFIG_MSG + message, IMessage.WARNING, null, location);
      handler.handleMessage(errorMessage);
      // MessageUtil.warn(handler, message);
    }
View Full Code Here

      final IProgramElement cuNode;
      {
        // 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
View Full Code Here

      fileName = filename;
    }
    // AMC - different strategies based on node kind
    int startLine = getStartLine(node);
    int endLine = getEndLine(node);
    SourceLocation loc = null;
    if (startLine <= endLine) {
      // found a valid end line for this node...
      loc = new SourceLocation(new File(fileName), startLine, endLine);
      loc.setOffset(node.sourceStart);
    } else {
      loc = new SourceLocation(new File(fileName), startLine);
      loc.setOffset(node.sourceStart);
    }
    return loc;
  }
View Full Code Here

    }
    return bindings;
  }

  public ISourceLocation makeSourceLocation(IHasPosition location) {
    return new SourceLocation(ISourceLocation.NO_FILE, 0);
  }
View Full Code Here

  public static ISourceLocation makeSourceLocation(ICompilationUnit unit, IProblem problem, IProgressListener progressListener) {
    int line = problem.getSourceLineNumber();
    File file = new File(new String(problem.getOriginatingFileName()));
    // cheat here...269912 - don't build the context if under IDE control
    if (progressListener!=null) {
      return new SourceLocation(file, line, line, 0, null);
    } else {
      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

    }
    ISourceLocation[] seeAlsoLocations = new ISourceLocation[validPlaces];
    int pos = 0;
    for (int i = 0; i < seeAlso.length; i++) {
      if (seeAlso[i].getSourceLineNumber() >= 0) {
        seeAlsoLocations[pos++] = 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

    }
    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

    // rest of the process.
    myGen = new ClassGen(myGen.getClassName(), myGen.getSuperclassName(), myGen.getFileName(), myGen.getModifiers(),
        myGen.getInterfaceNames());
    // raise an error against this compilation unit.
    getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.CLASS_TOO_BIG, this.getClassName()),
        new SourceLocation(new File(myGen.getFileName()), 0), null);
  }
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.