Top Description Fields Constructors Methods
com.rometools.rome.feed.impl

public Class ToStringBean

extends Object
Class Inheritance
Imports
java.lang.reflect.Array, .Method, java.util.Collection, .List, .Map, .Map.Entry, .Set, .Stack, org.slf4j.Logger, .LoggerFactory

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.

Field Summary

Modifier and TypeField and Description
private static final Logger
private static final Object[]
private static final ThreadLocal<Stack<String[]>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
printArrayProperty(final StringBuffer sb, final String prefix, final Object array)

private static void
printProperty(final StringBuffer sb, final String prefix, final Object value)

public static String

Returns:

bean object String representation.
toString
(Class<?> beanClass, Object obj)

Returns the String representation of the bean given in the constructor.

private static String

Returns:

bean object String representation.
toString
(final Class<?> beanClass, final Object obj, final String
to use for bean properties.
prefix
)

Returns the String representation of the bean given in the constructor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG
NO_PARAMSback to summary
private static final Object[] NO_PARAMS
PREFIX_TLback to summary
private static final ThreadLocal<Stack<String[]>> PREFIX_TL

Constructor Detail

ToStringBeanback to summary
private ToStringBean()

Method Detail

printArrayPropertyback to summary
private static void printArrayProperty(final StringBuffer sb, final String prefix, final Object array)
printPropertyback to summary
private static void printProperty(final StringBuffer sb, final String prefix, final Object value)
toStringback to summary
public static String toString(Class<?> beanClass, Object obj)

Returns the String representation of the bean given in the constructor.

It uses the Class name as the prefix.

Returns:String

bean object String representation.

toStringback to summary
private static String toString(final Class<?> beanClass, final Object obj, final String prefix)

Returns the String representation of the bean given in the constructor.

Parameters
prefix:String

to use for bean properties.

Returns:String

bean object String representation.