From f24344c2578a829acdfec914db27a5bbe0fc09f7 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Mon, 4 May 2015 21:21:32 +0200 Subject: [PATCH] Better JavaDoc for ToStringExclude --- .../lang3/builder/ReflectionToStringBuilder.java | 14 ++++++++++++++ .../commons/lang3/builder/ToStringExclude.java | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java index 59044699e..83dba01c4 100644 --- a/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/ReflectionToStringBuilder.java @@ -79,6 +79,10 @@ import org.apache.commons.lang3.ClassUtils; * } * *

+ * Alternatively the {@link ToStringExclude} annotation can be used to exclude fields from being incorporated in the + * result. + *

+ *

* The exact format of the toString is determined by the {@link ToStringStyle} passed into the constructor. *

* @@ -113,6 +117,8 @@ public class ReflectionToStringBuilder extends ToStringBuilder { * @return the String result * @throws IllegalArgumentException * if the Object is null + * + * @see ToStringExclude */ public static String toString(final Object object) { return toString(object, null, false, false, null); @@ -145,6 +151,8 @@ public class ReflectionToStringBuilder extends ToStringBuilder { * @return the String result * @throws IllegalArgumentException * if the Object or ToStringStyle is null + * + * @see ToStringExclude */ public static String toString(final Object object, final ToStringStyle style) { return toString(object, style, false, false, null); @@ -183,6 +191,8 @@ public class ReflectionToStringBuilder extends ToStringBuilder { * @return the String result * @throws IllegalArgumentException * if the Object is null + * + * @see ToStringExclude */ public static String toString(final Object object, final ToStringStyle style, final boolean outputTransients) { return toString(object, style, outputTransients, false, null); @@ -228,6 +238,8 @@ public class ReflectionToStringBuilder extends ToStringBuilder { * @return the String result * @throws IllegalArgumentException * if the Object is null + * + * @see ToStringExclude * @since 2.1 */ public static String toString(final Object object, final ToStringStyle style, final boolean outputTransients, final boolean outputStatics) { @@ -279,6 +291,8 @@ public class ReflectionToStringBuilder extends ToStringBuilder { * @return the String result * @throws IllegalArgumentException * if the Object is null + * + * @see ToStringExclude * @since 2.1 */ public static String toString( diff --git a/src/main/java/org/apache/commons/lang3/builder/ToStringExclude.java b/src/main/java/org/apache/commons/lang3/builder/ToStringExclude.java index 4b7359909..c080e317a 100755 --- a/src/main/java/org/apache/commons/lang3/builder/ToStringExclude.java +++ b/src/main/java/org/apache/commons/lang3/builder/ToStringExclude.java @@ -23,7 +23,8 @@ import java.lang.annotation.Target; import java.lang.annotation.RetentionPolicy; /** - * Use this annotation to builds a String excluding the annotated field. + * Use this annotation to exclude a field from being being used by + * the {@link ReflectionToStringBuilder}. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD)