@Override public void about() { JOptionPane.showMessageDialog(this, "DB Sanity GUI " + SystemInfo.getLineSeparator() + // include version info "(c) 2011 by Volker Bergmann"); }
private static void ensureXmlHeader(ConversionContext context) throws IOException { if (!context.xmlHeaderCreated) { context.writer.write("<?xml " + "version=\"1.0\" " + "encoding=\"" + context.encoding + "\"?>" + SystemInfo.getLineSeparator()); context.xmlHeaderCreated = true; } }
private static void ensureXmlHeader(ConversionContext context) throws IOException { if (!context.xmlHeaderCreated) { context.writer.write("<?xml " + "version=\"1.0\" " + "encoding=\"" + context.encoding + "\"?>" + SystemInfo.getLineSeparator()); context.xmlHeaderCreated = true; } }
@Override public void printLines(Object owner, String... lines) { for (String line : lines) buffer.append(line).append(SystemInfo.getLineSeparator()); }
protected String formatEndTag() { StringBuilder builder = new StringBuilder(); if (!inline) builder.append(SystemInfo.getLineSeparator()); builder.append("</").append(tagName).append('>'); if (!inline) builder.append(SystemInfo.getLineSeparator()); return builder.toString(); }
private static void appendTraceElement(StackTraceElement element, boolean first, StringBuilder builder) { builder.append(SystemInfo.getLineSeparator()); builder.append("\t"); if (!first) builder.append("at "); builder.append(element.getClassName()).append('.').append(element.getMethodName()); if (element.getLineNumber() > 0) builder.append(" (Line ").append(element.getLineNumber()).append(")"); }
@Override public String getDescription() { return "Sub identity of (" + ArrayFormat.format(parentTableNames) + "):" + SystemInfo.getLineSeparator() + subNkPkQuery; }
protected String formatStartTag() { StringBuilder builder = new StringBuilder(); builder.append('<').append(tagName); for (Map.Entry<String, String> att : attributes.entrySet()) builder.append(' ').append(att.getKey()).append("=\"").append(att.getValue()).append('"'); builder.append('>'); if (!inline) builder.append(SystemInfo.getLineSeparator()); return builder.toString(); }
@Override public String toString() { return "Monitored Object: " + resource.toString() + SystemInfo.getLineSeparator() + "Registration stack:" + toString(registrationTrace); }
public static PrintWriter getPrinterForURI(String uri, String encoding) throws FileNotFoundException, UnsupportedEncodingException { return getPrinterForURI(uri, encoding, false, SystemInfo.getLineSeparator(), false); }
public void write(Object bean) throws IOException { // Check preconditions Assert.notNull(bean, "bean"); FixedWidthRowTypeDescriptor cellFormats = rowDescriptors.get(bean.getClass().getSimpleName()); if (cellFormats == null) throw new IllegalArgumentException("Bean class not configured: " + bean.getClass().getSimpleName()); // format row out.write(cellFormats.formatBean(bean)); out.write(SystemInfo.getLineSeparator()); }
@Override public String toString() { String LF = SystemInfo.getLineSeparator(); StringBuilder builder = new StringBuilder("Aggregate diff:"); if (details.isEmpty()) { builder.append(" Empty"); } else { builder.append(LF); for (DiffDetail detail : details) builder.append("- ").append(StringUtil.normalizeSpace(detail.toString())).append(LF); } return builder.toString(); }
public void write(String rowTypeName, Object... values) throws IOException { // Check preconditions Assert.notNull(values, "array"); FixedWidthRowTypeDescriptor rowType = rowDescriptors.get(rowTypeName); if (rowType == null) throw new IllegalArgumentException("Illegal row type: " + rowTypeName); // format array out.write(rowType.formatArray(values)); out.write(SystemInfo.getLineSeparator()); }
public static void writeRow(Writer out, char separator, String... cells) throws IOException { if (cells.length > 0) out.write(renderCell(cells[0], separator)); for (int i = 1; i < cells.length; i++) { out.write(separator); out.write(renderCell(cells[i], separator)); } out.write(SystemInfo.getLineSeparator()); }
public static void writeRow(Writer out, char separator, String... cells) throws IOException { if (cells.length > 0) out.write(renderCell(cells[0], separator)); for (int i = 1; i < cells.length; i++) { out.write(separator); out.write(renderCell(cells[i], separator)); } out.write(SystemInfo.getLineSeparator()); }
@Override public void execute(Context context, Writer out) throws IOException, ScriptException { try { Object[] cellsOfCurrentRow = (Object[]) context.get("part"); out.write(descriptor.formatArray(cellsOfCurrentRow)); out.write(SystemInfo.getLineSeparator()); } catch (ConversionException e) { throw new ScriptException(e); } } }
@Override public void execute(Context context, Writer out) throws IOException, ScriptException { try { String[] cells = converter.convert(context.get("part")); for (int i = 0; i < cells.length; i++) out.write(cells[i]); out.write(SystemInfo.getLineSeparator()); } catch (ConversionException e) { throw new ScriptException(e); } } }
@Override public void execute(Context context, Writer out) throws IOException, ScriptException { try { String[] cells = converter.convert(context.get("part")); for (int i = 0; i < cells.length; i++) out.write(cells[i]); out.write(SystemInfo.getLineSeparator()); } catch (ConversionException e) { throw new ScriptException(e); } } }
@Override public void execute(Context context, Writer out) throws IOException, ScriptException { try { Object[] cellsOfCurrentRow = (Object[]) context.get("part"); for (int i = 0; i < cellsOfCurrentRow.length; i++) out.write(converters[i].convert(cellsOfCurrentRow[i])); out.write(SystemInfo.getLineSeparator()); } catch (ConversionException e) { throw new ScriptException(e); } } }
public void assertEquals(Document expected, Document actual) throws XPathExpressionException { AggregateDiff diffs = compare(expected, actual); if (diffs.getDetailCount() > 0) { String LF = SystemInfo.getLineSeparator(); StringBuilder message = new StringBuilder("Documents do not match. Found " + diffs.getDetailCount() + " difference"); if (diffs.getDetailCount() > 1) message.append('s'); for (DiffDetail diff : diffs.getDetails()) message.append(LF).append(diff); throw new AssertionError(message); } }