|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.syndication.feed.impl.ToStringBean
public class ToStringBean
Provides deep Bean toString support.
It works on all read/write properties, recursively. It support all primitive types, Strings, Collections, ToString objects and multi-dimensional arrays of any of them.
Constructor Summary | |
---|---|
protected |
ToStringBean(Class beanClass)
Default constructor. |
|
ToStringBean(Class beanClass,
Object obj)
Creates a ToStringBean to be used in a delegation pattern. |
Method Summary | |
---|---|
String |
toString()
Returns the String representation of the bean given in the constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ToStringBean(Class beanClass)
To be used by classes extending ToStringBean only.
beanClass
- indicates the class to scan for properties, normally an interface class.public ToStringBean(Class beanClass, Object obj)
For example:
public class Foo implements ToString {
public String toString(String prefix) {
ToStringBean tsb = new ToStringBean(this);
return tsb.toString(prefix);
}
public String toString() {
return toString("Foo");
}
}
beanClass
- indicates the class to scan for properties, normally an interface class.obj
- object bean to create String representation.Method Detail |
---|
public String toString()
It uses the Class name as the prefix.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |