public Object prettyPrint(Object sqlObject) { if (!multiLine) { return prettyPrintLine(sqlObject); } else { StringBuilder sql = new StringBuilder(sqlObject.toString()); StringBuilder buf = new StringBuilder(sql.length()); while (sql.length() > 0) { String line = null; int index = Math.max(sql.toString().indexOf(";\n"), sql.toString().indexOf(";\r")); if (index == -1) line = sql.toString(); else line = sql.substring(0, index + 2); // remove the current line from the sql buffer sql.delete(0, line.length()); buf.append(prettyPrintLine(line)); for (int i = 0; i < 1 + (getDoubleSpace() ? 1 : 0); i++) buf.append(J2DoPrivHelper.getLineSeparator()); } return buf.toString(); } }
public Object prettyPrint(Object sqlObject) { if (!multiLine) { return prettyPrintLine(sqlObject); } else { StringBuilder sql = new StringBuilder(sqlObject.toString()); StringBuilder buf = new StringBuilder(sql.length()); while (sql.length() > 0) { String line = null; int index = Math.max(sql.toString().indexOf(";\n"), sql.toString().indexOf(";\r")); if (index == -1) line = sql.toString(); else line = sql.substring(0, index + 2); // remove the current line from the sql buffer sql.delete(0, line.length()); buf.append(prettyPrintLine(line)); for (int i = 0; i < 1 + (getDoubleSpace() ? 1 : 0); i++) buf.append(J2DoPrivHelper.getLineSeparator()); } return buf.toString(); } }
public Object prettyPrint(Object sqlObject) { if (!multiLine) { return prettyPrintLine(sqlObject); } else { StringBuilder sql = new StringBuilder(sqlObject.toString()); StringBuilder buf = new StringBuilder(sql.length()); while (sql.length() > 0) { String line = null; int index = Math.max(sql.toString().indexOf(";\n"), sql.toString().indexOf(";\r")); if (index == -1) line = sql.toString(); else line = sql.substring(0, index + 2); // remove the current line from the sql buffer sql.delete(0, line.length()); buf.append(prettyPrintLine(line)); for (int i = 0; i < 1 + (getDoubleSpace() ? 1 : 0); i++) buf.append(J2DoPrivHelper.getLineSeparator()); } return buf.toString(); } }
public Object prettyPrint(Object sqlObject) { if (!multiLine) { return prettyPrintLine(sqlObject); } else { StringBuffer sql = new StringBuffer(sqlObject.toString()); StringBuffer buf = new StringBuffer(sql.length()); while (sql.length() > 0) { String line = null; int index = Math.max(sql.toString().indexOf(";\n"), sql.toString().indexOf(";\r")); if (index == -1) line = sql.toString(); else line = sql.substring(0, index + 2); // remove the current line from the sql buffer sql.delete(0, line.length()); buf.append(prettyPrintLine(line)); for (int i = 0; i < 1 + (getDoubleSpace() ? 1 : 0); i++) buf.append(J2DoPrivHelper.getLineSeparator()); } return buf.toString(); } }