org.springframework.core.style
Class DefaultValueStyler

java.lang.Object
  extended by org.springframework.core.style.DefaultValueStyler
All Implemented Interfaces:
ValueStyler

public class DefaultValueStyler
extends java.lang.Object
implements ValueStyler

Converts objects to String form, generally for debugging purposes, using Spring's toString styling conventions.

Uses the reflective visitor pattern underneath the hood to nicely encapsulate styling algorithms for each type of styled object.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Field Summary
private static java.lang.String ARRAY
           
private static java.lang.String COLLECTION
           
private static java.lang.String EMPTY
           
private static java.lang.String LIST
           
private static java.lang.String MAP
           
private static java.lang.String NULL
           
private static java.lang.String SET
           
 
Constructor Summary
DefaultValueStyler()
           
 
Method Summary
private  java.lang.String getCollectionTypeString(java.util.Collection value)
           
private  java.lang.String style(java.util.Collection value)
           
private  java.lang.String style(java.util.Map.Entry value)
           
private  java.lang.String style(java.util.Map value)
           
 java.lang.String style(java.lang.Object value)
          Style the given value, returning a String representation.
private  java.lang.String styleArray(java.lang.Object[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

private static final java.lang.String EMPTY
See Also:
Constant Field Values

NULL

private static final java.lang.String NULL
See Also:
Constant Field Values

COLLECTION

private static final java.lang.String COLLECTION
See Also:
Constant Field Values

SET

private static final java.lang.String SET
See Also:
Constant Field Values

LIST

private static final java.lang.String LIST
See Also:
Constant Field Values

MAP

private static final java.lang.String MAP
See Also:
Constant Field Values

ARRAY

private static final java.lang.String ARRAY
See Also:
Constant Field Values
Constructor Detail

DefaultValueStyler

public DefaultValueStyler()
Method Detail

style

public java.lang.String style(java.lang.Object value)
Description copied from interface: ValueStyler
Style the given value, returning a String representation.

Specified by:
style in interface ValueStyler
Parameters:
value - the Object value to style
Returns:
the styled String

style

private java.lang.String style(java.util.Map value)

style

private java.lang.String style(java.util.Map.Entry value)

style

private java.lang.String style(java.util.Collection value)

getCollectionTypeString

private java.lang.String getCollectionTypeString(java.util.Collection value)

styleArray

private java.lang.String styleArray(java.lang.Object[] array)