net.sf.seaf.util
Class ToStringUtils

java.lang.Object
  extended by net.sf.seaf.util.ToStringUtils

public class ToStringUtils
extends Object

Builder of toString() return value for a JavaBean.


Constructor Summary
ToStringUtils(Class<?> clazz, String superToString)
          Initialize the builder.
 
Method Summary
 void addProperty(String name, Object value)
          Add a property to the builder.
 String toString()
          Returns the value of the buffered toString output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToStringUtils

public ToStringUtils(Class<?> clazz,
                     String superToString)
Initialize the builder.

Parameters:
clazz - The class of the bean
superToString - The result of toString() on the superclass
Throws:
NullPointerException - When clazz is null
Method Detail

addProperty

public void addProperty(String name,
                        Object value)
Add a property to the builder.

Parameters:
name - Name of the property
value - Value of the property

toString

public String toString()
Returns the value of the buffered toString output.

Overrides:
toString in class Object
Returns:
String


Copyright © 2008-2012 SEAF. All Rights Reserved.