Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 56990 invoked from network); 1 Oct 2002 20:03:11 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 1 Oct 2002 20:03:11 -0000 Received: (qmail 3765 invoked by uid 97); 1 Oct 2002 20:03:56 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 3745 invoked by uid 97); 1 Oct 2002 20:03:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 3722 invoked by uid 97); 1 Oct 2002 20:03:55 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 1 Oct 2002 20:03:04 -0000 Message-ID: <20021001200304.74538.qmail@icarus.apache.org> From: stevencaswell@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/builder ToStringBuilder.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stevencaswell 2002/10/01 13:03:04 Modified: lang/src/java/org/apache/commons/lang/builder ToStringBuilder.java Log: javadoc corrections: - changed tag to
 tag around code examples for better formatting
  - added reflection method explanation text
  
  Revision  Changes    Path
  1.6       +17 -3     jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringBuilder.java
  
  Index: ToStringBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/builder/ToStringBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ToStringBuilder.java	29 Sep 2002 08:26:05 -0000	1.5
  +++ ToStringBuilder.java	1 Oct 2002 20:03:04 -0000	1.6
  @@ -69,7 +69,7 @@
    * 
    * 

* To use this class write code as follows: - * + *

    * public class Person {
    *   String name;
    *   int age;
  @@ -85,9 +85,23 @@
    *       toString();
    *   }
    * }
  - * 
  + * 
* This will produce a toString of the format: * Person@7f54[name=Stephen,age=29,smoker=false] + *

+ * Alternatively, there is a method that uses reflection to determine + * the fields to test. Because these fields are usually private, the method, + * reflectionToString, uses Field.setAccessible to change + * the visibility of the fields. This will fail under a security manager, + * unless the appropriate permissions are set. It is also slower than testing + * explicitly. + *

+ * A typical invocation for this method would look like: + *

  + * public String toString() {
  + *   return ToStringBuilder.reflectionToString(this);
  + * }
  + * 
*

* The exact format of the toString is determined by the {@link ToStringStyle} * passed into the constructor. -- To unsubscribe, e-mail: For additional commands, e-mail: