Package org.springframework.core.style
Class DefaultValueStyler
java.lang.Object
org.springframework.core.style.DefaultValueStyler
- All Implemented Interfaces:
- ValueStyler
- Direct Known Subclasses:
- SimpleValueStyler
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, Sam Brannen
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionStyle the given value, returning a String representation.protected StringstyleArray(Object[] array) Generate a styled version of the supplied array.protected StringstyleClass(Class<?> clazz) Generate a styled version of the suppliedClass.protected StringstyleCollection(Collection<?> collection) Generate a styled version of the suppliedCollection.protected <K,V> String Generate a styled version of the suppliedMap.protected StringstyleMapEntry(Map.Entry<?, ?> entry) Generate a styled version of the suppliedMap.Entry.protected StringstyleMethod(Method method) Generate a styled version of the suppliedMethod.protected StringGenerate a styled version ofnull.protected StringstyleObject(Object obj) Generate a styled version of the suppliedObject.protected StringstyleString(String str) Generate a styled version of the suppliedString.
- 
Constructor Details- 
DefaultValueStylerpublic DefaultValueStyler()
 
- 
- 
Method Details- 
styleDescription copied from interface:ValueStylerStyle the given value, returning a String representation.- Specified by:
- stylein interface- ValueStyler
- Parameters:
- value- the Object value to style
- Returns:
- the styled String
 
- 
styleNullGenerate a styled version ofnull.The default implementation returns "[null]".- Returns:
- a styled version of null
- Since:
- 6.0
 
- 
styleStringGenerate a styled version of the suppliedString.The default implementation returns the supplied string wrapped in single quotes. - Returns:
- a styled version of the supplied string
- Since:
- 6.0
 
- 
styleClassGenerate a styled version of the suppliedClass.The default implementation delegates to ClassUtils.getShortName(Class).- Returns:
- a styled version of the supplied class
- Since:
- 6.0
 
- 
styleMethodGenerate a styled version of the suppliedMethod.The default implementation returns the method's name and the short name of the method's declaring class, separated by the "@"symbol.- Returns:
- a styled version of the supplied method
- Since:
- 6.0
 
- 
styleMapGenerate a styled version of the suppliedMap.- Returns:
- a styled version of the supplied map
- Since:
- 6.0
 
- 
styleMapEntryGenerate a styled version of the suppliedMap.Entry.- Returns:
- a styled version of the supplied map entry
- Since:
- 6.0
 
- 
styleCollectionGenerate a styled version of the suppliedCollection.- Returns:
- a styled version of the supplied collection
- Since:
- 6.0
 
- 
styleArrayGenerate a styled version of the supplied array.- Returns:
- a styled version of the supplied array
- Since:
- 6.0
 
- 
styleObjectGenerate a styled version of the suppliedObject.This method is only invoked by style(Object)as a fallback, if none of the otherstyle*()methods is suitable for the object's type.The default implementation delegates to String.valueOf(Object).- Returns:
- a styled version of the supplied object
- Since:
- 6.0
 
 
-