/** * Returns a String for displaying this compiler problem in a console window. * * This is for debugging purposes, therefore no non-test code should call this. * * There are typically four lines output for each problem: * location (file and line number) * description * * For example: * * C:\Faramir\compiler\trunk\tests\resources\milestones\m1\M1.as:4 * Syntax error: '+' not allowed here. */ @Override public String toString() { return ProblemFormatter.DEFAULT_FORMATTER.format(this); } }
/** * Get a localized string for a parameterized message. * * @param id the id of the message. * @param parameters map that contains key/value pairs used to resolve the * tokens in the specified message. * @return resolved, token-free message */ public static String getString(String id, Map<String, Object> parameters) { return ProblemFormatter.substitute(getString(id), parameters); }
String problemMessage = getMessage(c.getSimpleName()); return substitute(problemMessage, map);
public int mainNoExit(final String[] args, OutputStream stderr) { int exitCode = -1; try { exitCode = _mainNoExit(args); } catch (Exception e) { PrintWriter writer = new PrintWriter(stderr); writer.println(e.toString()); } finally { final ProblemFormatter formatter = new ProblemFormatter(); final ProblemPrinter printer = new ProblemPrinter(formatter, stderr); printer.printProblems(problems.getFilteredProblems()); } return exitCode; }
String problemMessage = getMessage(c.getSimpleName()); return substitute(problemMessage, map);
public int mainNoExit(final String[] args, OutputStream stderr) { int exitCode = -1; try { exitCode = _mainNoExit(args); } catch (Exception e) { PrintWriter writer = new PrintWriter(stderr); writer.println(e.toString()); } finally { final ProblemFormatter formatter = new ProblemFormatter(); final ProblemPrinter printer = new ProblemPrinter(formatter, stderr); printer.printProblems(problems.getFilteredProblems()); } return exitCode; }
/** * Returns a String for displaying this compiler problem in a console window. * * This is for debugging purposes, therefore no non-test code should call this. * * There are typically four lines output for each problem: * location (file and line number) * description * * For example: * * C:\Faramir\compiler\trunk\tests\resources\milestones\m1\M1.as:4 * Syntax error: '+' not allowed here. */ @Override public String toString() { return ProblemFormatter.DEFAULT_FORMATTER.format(this); } }
/** * Get a localized string for a parameterized message. * * @param id the id of the message. * @param parameters map that contains key/value pairs used to resolve the * tokens in the specified message. * @return resolved, token-free message */ public static String getString(String id, Map<String, Object> parameters) { return ProblemFormatter.substitute(getString(id), parameters); }
/** * Print a pre-filtered sequence of problems. * * @param problems compiler problems * @return count of printed problems */ public int printProblems(final Iterable<ICompilerProblem> problems) { int problemCount = 0; PrintWriter writer = new PrintWriter(new PrintStream(outputStream)); for (final ICompilerProblem problem : problems) { writer.println(formatter.format(problem)); problemCount++; } writer.flush(); return problemCount; }
/** * Print a pre-filtered sequence of problems. * * @param problems compiler problems * @return count of printed problems */ public int printProblems(final Iterable<ICompilerProblem> problems) { int problemCount = 0; PrintWriter writer = new PrintWriter(new PrintStream(outputStream)); for (final ICompilerProblem problem : problems) { writer.println(formatter.format(problem)); problemCount++; } writer.flush(); return problemCount; }
public String getProblems() { StringBuffer problems = new StringBuffer(); if (problemQuery != null && problemQuery.hasFilteredProblems()) { for (final ICompilerProblem problem : problemQuery.getFilteredProblems()) { problems.append(problemFormatter.format(problem)); } } return problems.toString().trim(); }
public String getProblems() { StringBuffer problems = new StringBuffer(); if (problemQuery != null && problemQuery.hasFilteredProblems()) { for (final ICompilerProblem problem : problemQuery.getFilteredProblems()) { problems.append(problemFormatter.format(problem)); } } return problems.toString().trim(); }
String description = super.format(problem);
String description = super.format(problem);
try String errText = ProblemFormatter.DEFAULT_FORMATTER.format(prob); msg.setMessage(errText);
try String errText = ProblemFormatter.DEFAULT_FORMATTER.format(prob); msg.setMessage(errText);