public int getColumNumber() { if (!diagnostic.getData().isEmpty()) { if (diagnostic.getData().get(0) instanceof SAXParseException) { return ((SAXParseException) diagnostic.getData().get(0)).getColumnNumber(); } if (diagnostic.getData().get(0) instanceof Resource.Diagnostic) { return ((Resource.Diagnostic) diagnostic.getData().get(0)).getColumn(); } } return -1; }
/** * Returns a string representation of the given diagnostic object. * * @param diagnostic * The diagnostic * @return a string representation of the given diagnostic object. */ private static String diagnosticString(Diagnostic diagnostic) { StringBuffer buffer = new StringBuffer(); buffer.append(AcceleoCommonMessages .getString("ModelUtils.DiagnosticMessage", diagnostic.getMessage())); //$NON-NLS-1$ buffer.append('\n'); buffer.append(AcceleoCommonMessages.getString("ModelUtils.DiagnosticLocation", diagnostic //$NON-NLS-1$ .getLocation(), Integer.valueOf(diagnostic.getLine()), Integer .valueOf(diagnostic.getColumn()))); return buffer.toString(); }
criticalErrors .append(MessageFormat.format("[{0},{1}]: {2}\n", Integer.toString(diagnostic.getLine()), Integer.toString(diagnostic.getColumn()), diagnostic.getMessage()));
criticalErrors .append(MessageFormat.format("[{0},{1}]: {2}\n", Integer.toString(diagnostic.getLine()), Integer.toString(diagnostic.getColumn()), diagnostic.getMessage()));