Package com.puppetlabs.geppetto.diagnostic

Examples of com.puppetlabs.geppetto.diagnostic.DetailedFileDiagnostic


   * @param diagnostics
   * @param p
   */
  private void formatDignostics(BasicDiagnostic diagnostics, PrintStream p) {
    for(Diagnostic d : diagnostics.getChildren()) {
      DetailedFileDiagnostic detail = getDetail(d);
      if(detail == null)
        formatExceptionDiagnostic(d, p);
      else
        formatDetail(d, detail, p);

View Full Code Here


        builder.append(" file=");
        builder.append(fd.getFile());
        builder.append(" line=");
        builder.append(fd.getLineNumber());
        if(fd instanceof DetailedFileDiagnostic) {
          DetailedFileDiagnostic dfd = (DetailedFileDiagnostic) fd;
          builder.append(" offset=");
          builder.append(dfd.getOffset());
          builder.append(" length=");
          builder.append(dfd.getLength());
        }
      }
      else
        builder.append(d.toString());
      builder.append("\n");
View Full Code Here

   * @param issueId
   */
  private static void addFileDiagnostic(Diagnostic diagnostics, int severity, File file, File rootDirectory,
      String message, String issueId) {

    DetailedFileDiagnostic dft = new DetailedFileDiagnostic(severity, UNKNOWN, message, pathToFile(
      file.getAbsolutePath(), rootDirectory));
    dft.setLineNumber(-1);
    dft.setLength(-1);
    dft.setOffset(-1);
    dft.setIssue(issueId);
    dft.setIssueData(new String[] {});
    dft.setNode("");
    diagnostics.addChild(dft);
  }
View Full Code Here

   */
  private static void addIssueDiagnostic(Diagnostic diagnostics, Issue issue, File processedFile, File rootDirectory) {
    DiagnosticType type = issue.isSyntaxError()
        ? GEPPETTO_SYNTAX
        : GEPPETTO;
    DetailedFileDiagnostic dft = new DetailedFileDiagnostic(
      translateIssueSeverity(issue.getSeverity()), type, issue.getMessage(), uriToFile(
        issue.getUriToProblem(), rootDirectory));
    dft.setLineNumber(issue.getLineNumber());
    dft.setLength(issue.getLength());
    dft.setOffset(issue.getOffset());
    dft.setIssue(issue.getCode());
    dft.setIssueData(issue.getData());
    dft.setNode("");
    diagnostics.addChild(dft);
  }
View Full Code Here

        : Diagnostic.WARNING;
    DiagnosticType type = issue.isSyntaxError()
        ? RUBY_SYNTAX
        : RUBY;

    DetailedFileDiagnostic dft = new DetailedFileDiagnostic(severity, type, issue.getMessage(), pathToFile(
      issue.getFileName(), rootDirectory));
    dft.setLineNumber(issue.getLine());
    dft.setLength(issue.getLength());
    dft.setOffset(issue.getStartOffset());
    dft.setIssue(issue.getIdString());
    dft.setIssueData(new String[] {}); // TODO: the Ruby issue passes // Object[]
    dft.setNode("");
    diagnostics.addChild(dft);
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.diagnostic.DetailedFileDiagnostic

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.