public CharBuf indent(int i) { return multiply(' ', i); }
public CharBuf indent(int i) { return multiply(' ', i); }
public CharBuf indent(int i) { return multiply(' ', i); }
public void printStackTrace( CharBuf charBuf) { charBuf.puts("MESSAGE:", this.getMessage()); if (this.getRootCause() !=null) { charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage()); } else if (this.getCause()!=null) { charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage()); } StackTraceElement[] stackTrace = this.getFilteredStackTrace(); if (stackTrace.length > 0) { charBuf.indent(5).addLine("This happens around this area in your code."); Exceptions.printStackTrace(charBuf, stackTrace); } if ( getRootCause() != null ) { charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName()); stackTrace = this.getRootCause().getStackTrace(); Exceptions.printStackTrace(charBuf, stackTrace); } charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine(); StringWriter writer = new StringWriter(); super.printStackTrace( new PrintWriter(writer) ); charBuf.add(writer); charBuf.addLine().multiply('-', 50).addLine(); }
public static void stackTraceToJson(CharBuf buffer, StackTraceElement[] stackTrace) { if (stackTrace.length==0) { buffer.addLine("[]"); return; } buffer.multiply(' ', 16).addLine('['); for ( int index = 0; index < stackTrace.length; index++ ) { StackTraceElement element = stackTrace[ index ]; if (element.getClassName().contains("org.boon.Exceptions")) { continue; } buffer.indent(17).add("[ ").asJsonString(element.getMethodName()) .add(','); buffer.indent(3).asJsonString(element.getClassName()); if (element.getLineNumber()>0) { buffer.add(","); buffer.indent(3).asJsonString(""+element.getLineNumber()) .addLine(" ],"); } else { buffer.addLine(" ],"); } } buffer.removeLastChar(); //trailing \n buffer.removeLastChar(); //trailing , buffer.addLine().multiply(' ', 15).add(']'); }
public void printStackTrace( CharBuf charBuf) { charBuf.puts("MESSAGE:", this.getMessage()); if (this.getRootCause() !=null) { charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage()); } else if (this.getCause()!=null) { charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage()); } StackTraceElement[] stackTrace = this.getFilteredStackTrace(); if (stackTrace.length > 0) { charBuf.indent(5).addLine("This happens around this area in your code."); Exceptions.printStackTrace(charBuf, stackTrace); } if ( getRootCause() != null ) { charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName()); stackTrace = this.getRootCause().getStackTrace(); Exceptions.printStackTrace(charBuf, stackTrace); } charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine(); StringWriter writer = new StringWriter(); super.printStackTrace( new PrintWriter(writer) ); charBuf.add(writer); charBuf.addLine().multiply('-', 50).addLine(); }
public void printStackTrace( CharBuf charBuf) { charBuf.puts("MESSAGE:", this.getMessage()); if (this.getRootCause() !=null) { charBuf.puts("ROOT CAUSE MESSAGE:", this.getRootCause().getMessage()); } else if (this.getCause()!=null) { charBuf.puts("CAUSE MESSAGE:", this.getCause().getMessage()); } StackTraceElement[] stackTrace = this.getFilteredStackTrace(); if (stackTrace.length > 0) { charBuf.indent(5).addLine("This happens around this area in your code."); Exceptions.printStackTrace(charBuf, stackTrace); } if ( getRootCause() != null ) { charBuf.addLine().puts("Caused by:", "message:", this.getRootCause().getMessage(), "type", this.getRootCause().getClass().getName()); stackTrace = this.getRootCause().getStackTrace(); Exceptions.printStackTrace(charBuf, stackTrace); } charBuf.addLine().multiply('-', 50).addLine().multiply('-', 50).addLine(); StringWriter writer = new StringWriter(); super.printStackTrace( new PrintWriter(writer) ); charBuf.add(writer); charBuf.addLine().multiply('-', 50).addLine(); }
public static void stackTraceToJson(CharBuf buffer, StackTraceElement[] stackTrace) { if (stackTrace.length==0) { buffer.addLine("[]"); return; } buffer.multiply(' ', 16).addLine('['); for ( int index = 0; index < stackTrace.length; index++ ) { StackTraceElement element = stackTrace[ index ]; if (element.getClassName().contains("org.boon.Exceptions")) { continue; } buffer.indent(17).add("[ ").asJsonString(element.getMethodName()) .add(','); buffer.indent(3).asJsonString(element.getClassName()); if (element.getLineNumber()>0) { buffer.add(","); buffer.indent(3).asJsonString(""+element.getLineNumber()) .addLine(" ],"); } else { buffer.addLine(" ],"); } } buffer.removeLastChar(); //trailing \n buffer.removeLastChar(); //trailing , buffer.addLine().multiply(' ', 15).add(']'); }
public static void stackTraceToJson(CharBuf buffer, StackTraceElement[] stackTrace) { if (stackTrace.length==0) { buffer.addLine("[]"); return; } buffer.multiply(' ', 16).addLine('['); for ( int index = 0; index < stackTrace.length; index++ ) { StackTraceElement element = stackTrace[ index ]; if (element.getClassName().contains("org.boon.Exceptions")) { continue; } buffer.indent(17).add("[ ").asJsonString(element.getMethodName()) .add(','); buffer.indent(3).asJsonString(element.getClassName()); if (element.getLineNumber()>0) { buffer.add(","); buffer.indent(3).asJsonString(""+element.getLineNumber()) .addLine(" ],"); } else { buffer.addLine(" ],"); } } buffer.removeLastChar(); //trailing \n buffer.removeLastChar(); //trailing , buffer.addLine().multiply(' ', 15).add(']'); }
/** * Create load all keys SQL. * @param table table */ protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllVersionDataByKeysSQL = buf.toString(); }
/** * Create load all keys SQL. * @param table */ protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllByKeysSQL = buf.toString(); }
protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllKeysSQL = buf.toString(); }
protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllKeysSQL = buf.toString(); }
protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllKeysSQL = buf.toString(); }
buf.multiply('-', 10).add("FINAL ARGUMENTS").multiply('-', 10).addLine(); if (finalArgs!=null) { for (Object o : finalArgs) { buf.multiply('-', 10).add("INVOKE METHOD").add(methodAccess).multiply('-', 10).addLine(); buf.multiply('-', 10).add("INVOKE METHOD PARAMS").multiply('-', 10).addLine(); for (Class<?> c : methodAccess.parameterTypes()) { buf.puts("constructor type ", c); buf.multiply('-', 35).addLine();
/** * Create load all keys SQL. * @param table table */ protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllVersionDataByKeysSQL = buf.toString(); }
/** * Create load all keys SQL. * @param table */ protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllByKeysSQL = buf.toString(); }
/** * Create load all keys SQL. * @param table */ protected void createLoadAllKeysSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, kv_value, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllByKeysSQL = buf.toString(); }
/** * Create load all keys SQL. * @param table table */ protected void createLoadAllVersionDataSQL(String table) { CharBuf buf = CharBuf.create(100); buf.add("select kv_key, 1, version, update_timestamp, create_timestamp from `"); buf.add(table); buf.add("` where kv_key in ("); buf.multiply("?,", this.loadKeyCount); buf.removeLastChar(); buf.add(");"); this.loadAllVersionDataByKeysSQL = buf.toString(); }