public Object copy() { return new BasicPrettyPrinter(); } }
/** {@inheritDoc} */ public String prettify(Object o) { try { knownObjects = new IdentityHashMap(); knownObjectsCount = 0; return super.prettify(o); } finally { knownObjects = null; knownObjectsCount = 0; } }
protected void internalPrettify(Object o) { if (o == null) { trace.writeNull(); } else if (o instanceof String) { String string = (String)o; if (string.startsWith("<?xml")) { trace.write(StringUtils.prettifyXML(string)); } else { trace.write(string); } } else if (o instanceof Number || o instanceof Boolean || o instanceof Date || o instanceof Calendar || o instanceof Character) { trace.write(o); } else { prettifyComplexType(o); } }
/** * Prettifies the representation of an Object as a String. * <ul> * <li>Simple types are simply toString'ed.</li> * <li>XML strings are formatted with line feeds and indentations.</li> * <li>Complex types report their class names.</li> * <li>Collections, Maps and native Arrays also report their size/length.</li> * </ul> * @return A prettified version of an Object as a String. */ public String prettify(Object o) { try { trace = new ObjectTrace(); internalPrettify(o); return trace.toString(); } catch (Throwable t) { return trace.toString(); } finally { trace = null; } }
protected void internalPrettify(Object o) { if (o == null) { trace.writeNull(); } else if (o instanceof String) { String string = (String)o; if (string.startsWith("<?xml")) { trace.write(StringUtils.prettifyXML(string)); } else { trace.write(string); } } else if (o instanceof Number || o instanceof Boolean || o instanceof Date || o instanceof Calendar || o instanceof Character) { trace.write(o); } else { prettifyComplexType(o); } }
/** * Prettifies the representation of an Object as a String. * <ul> * <li>Simple types are simply toString'ed.</li> * <li>XML strings are formatted with line feeds and indentations.</li> * <li>Complex types report their class names.</li> * <li>Collections, Maps and native Arrays also report their size/length.</li> * </ul> * @return A prettified version of an Object as a String. */ public String prettify(Object o) { try { trace = new ObjectTrace(); internalPrettify(o); return trace.toString(); } catch (Throwable t) { return trace.toString(); } finally { trace = null; } }
public Object copy() { return new BasicPrettyPrinter(); } }
/** {@inheritDoc} */ public String prettify(Object o) { try { knownObjects = new IdentityHashMap(); knownObjectsCount = 0; return super.prettify(o); } finally { knownObjects = null; knownObjectsCount = 0; } }
protected void internalPrettify(Object o) { if (o == null) { trace.writeNull(); } else if (o instanceof String) { String string = (String)o; if (string.startsWith("<?xml")) { trace.write(StringUtils.prettifyXML(string)); } else { trace.write(string); } } else if (o instanceof Number || o instanceof Boolean || o instanceof Date || o instanceof Calendar || o instanceof Character) { trace.write(o); } else { prettifyComplexType(o); } }
/** * Prettifies the representation of an Object as a String. * <ul> * <li>Simple types are simply toString'ed.</li> * <li>XML strings are formatted with line feeds and indentations.</li> * <li>Complex types report their class names.</li> * <li>Collections, Maps and native Arrays also report their size/length.</li> * </ul> * @return A prettified version of an Object as a String. */ public String prettify(Object o) { try { trace = new ObjectTrace(); internalPrettify(o); return trace.toString(); } catch (Throwable t) { return trace.toString(); } finally { trace = null; } }
public Object copy() { return new BasicPrettyPrinter(); } }
/** {@inheritDoc} */ public String prettify(Object o) { try { knownObjects = new IdentityHashMap(); knownObjectsCount = 0; return super.prettify(o); } finally { knownObjects = null; knownObjectsCount = 0; } }