From bbab0a4b4c06ce798c163c72e493e16092f443a2 Mon Sep 17 00:00:00 2001 From: Stephen Colebourne Date: Mon, 26 Oct 2009 22:06:13 +0000 Subject: [PATCH] Enhance Javadoc git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@829993 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang/builder/ToStringBuilder.java | 51 ++++++++----------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/java/org/apache/commons/lang/builder/ToStringBuilder.java b/src/java/org/apache/commons/lang/builder/ToStringBuilder.java index b55e1fd9a..f67adfd0b 100644 --- a/src/java/org/apache/commons/lang/builder/ToStringBuilder.java +++ b/src/java/org/apache/commons/lang/builder/ToStringBuilder.java @@ -92,7 +92,7 @@ public class ToStringBuilder { /** - * The default style of output to use. + * The default style of output to use, not null. */ private static volatile ToStringStyle defaultStyle = ToStringStyle.DEFAULT_STYLE; @@ -139,7 +139,8 @@ public static void setDefaultStyle(ToStringStyle style) { //---------------------------------------------------------------------------- /** - *

Forwards to ReflectionToStringBuilder.

+ *

Uses ReflectionToStringBuilder to generate a + * toString for the specified object.

* * @param object the Object to be output * @return the String result @@ -150,7 +151,8 @@ public static String reflectionToString(Object object) { } /** - *

Forwards to ReflectionToStringBuilder.

+ *

Uses ReflectionToStringBuilder to generate a + * toString for the specified object.

* * @param object the Object to be output * @param style the style of the toString to create, may be null @@ -162,7 +164,8 @@ public static String reflectionToString(Object object, ToStringStyle style) { } /** - *

Forwards to ReflectionToStringBuilder.

+ *

Uses ReflectionToStringBuilder to generate a + * toString for the specified object.

* * @param object the Object to be output * @param style the style of the toString to create, may be null @@ -175,7 +178,8 @@ public static String reflectionToString(Object object, ToStringStyle style, bool } /** - *

Forwards to ReflectionToStringBuilder.

+ *

Uses ReflectionToStringBuilder to generate a + * toString for the specified object.

* * @param object the Object to be output * @param style the style of the toString to create, may be null @@ -196,62 +200,51 @@ public static String reflectionToString( //---------------------------------------------------------------------------- /** - * Current toString buffer. + * Current toString buffer, not null. */ private final StringBuffer buffer; - /** - * The object being output. + * The object being output, may be null. */ private final Object object; - /** - * The style of output to use. + * The style of output to use, not null. */ private final ToStringStyle style; /** - *

Constructor for ToStringBuilder.

+ *

Constructs a builder for the specified object using the default output style.

* - *

This constructor outputs using the default style set with - * setDefaultStyle.

+ *

This default style is obtained from {@link #getDefaultStyle()}.

* - * @param object the Object to build a toString for - * @throws IllegalArgumentException if the Object passed in is - * null + * @param object the Object to build a toString for, not recommended to be null */ public ToStringBuilder(Object object) { this(object, null, null); } /** - *

Constructor for ToStringBuilder specifying the - * output style.

+ *

Constructs a builder for the specified object using the a defined output style.

* *

If the style is null, the default style is used.

* - * @param object the Object to build a toString for - * @param style the style of the toString to create, - * may be null - * @throws IllegalArgumentException if the Object passed in is - * null + * @param object the Object to build a toString for, not recommended to be null + * @param style the style of the toString to create, null uses the default style */ public ToStringBuilder(Object object, ToStringStyle style) { this(object, style, null); } /** - *

Constructor for ToStringBuilder.

+ *

Constructs a builder for the specified object.

* *

If the style is null, the default style is used.

* *

If the buffer is null, a new one is created.

* - * @param object the Object to build a toString for - * @param style the style of the toString to create, - * may be null - * @param buffer the StringBuffer to populate, may be - * null + * @param object the Object to build a toString for, not recommended to be null + * @param style the style of the toString to create, null uses the default style + * @param buffer the StringBuffer to populate, may be null */ public ToStringBuilder(Object object, ToStringStyle style, StringBuffer buffer) { if (style == null) {