diff --git a/src/java/org/apache/commons/lang/builder/ToStringStyle.java b/src/java/org/apache/commons/lang/builder/ToStringStyle.java index 03a4f9831..266e77821 100644 --- a/src/java/org/apache/commons/lang/builder/ToStringStyle.java +++ b/src/java/org/apache/commons/lang/builder/ToStringStyle.java @@ -43,12 +43,26 @@ import org.apache.commons.lang.SystemUtils; *
For example, the detail version of the array based methods will * output the whole array, whereas the summary method will just output * the array length.
+ * + *If you want to format the output of certain objects, such as dates, you + * must create a subclass and override a method. + *
+ * public class MyStyle extends ToStringStyle { + * protected void appendDetail(StringBuffer buffer, String fieldName, Object value) { + * if (value instanceof Date) { + * value = new SimpleDateFormat("yyyy-MM-dd").format(value); + * } + * buffer.append(value); + * } + * } + *+ * * * @author Stephen Colebourne * @author Gary Gregory * @author Pete Gieser * @since 1.0 - * @version $Id: ToStringStyle.java,v 1.34 2004/10/16 18:13:34 scolebourne Exp $ + * @version $Id: ToStringStyle.java,v 1.35 2004/10/16 18:20:46 scolebourne Exp $ */ public abstract class ToStringStyle implements Serializable {