Class SimpleValueStyler
- All Implemented Interfaces:
- ValueStyler
ValueStyler that converts objects to String form — generally for
 debugging purposes — using simple styling conventions that mimic the
 toString() styling conventions for standard JDK implementations of
 collections, maps, and arrays.
 Uses the reflective visitor pattern underneath the hood to nicely encapsulate styling algorithms for each type of styled object.
Favor SimpleValueStyler over DefaultValueStyler when you
 wish to use styling similar to the JDK or when you need configurable control
 over the styling of classes and methods.
- Since:
- 6.0
- Author:
- Sam Brannen
- 
Field SummaryFieldsModifier and TypeFieldDescriptionDefaultClassstyling function:Class.getCanonicalName().DefaultMethodstyling function: converts the suppliedMethodto a simple string representation of the method's signature in the form of<method name>(<parameter types>), where<parameter types>is a comma-separated list of the simple names of the parameter types.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate aSimpleValueStylerusing the supplied class and method stylers.
- 
Method SummaryModifier and TypeMethodDescriptionprotected 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 StringstyleMethod(Method method) Generate a styled version of the suppliedMethod.protected StringGenerate a styled version ofnull.protected StringstyleString(String str) Generate a styled version of the suppliedString.Methods inherited from class org.springframework.core.style.DefaultValueStylerstyle, styleMapEntry, styleObject
- 
Field Details- 
DEFAULT_CLASS_STYLERDefaultClassstyling function:Class.getCanonicalName().
- 
DEFAULT_METHOD_STYLERDefaultMethodstyling function: converts the suppliedMethodto a simple string representation of the method's signature in the form of<method name>(<parameter types>), where<parameter types>is a comma-separated list of the simple names of the parameter types.For example, if the supplied method is a reference to String.getBytes(java.nio.charset.Charset), this function will return"getBytes(Charset)".
 
- 
- 
Constructor Details
- 
Method Details- 
styleNullDescription copied from class:DefaultValueStylerGenerate a styled version ofnull.The default implementation returns "[null]".- Overrides:
- styleNullin class- DefaultValueStyler
- Returns:
- a styled version of null
 
- 
styleStringDescription copied from class:DefaultValueStylerGenerate a styled version of the suppliedString.The default implementation returns the supplied string wrapped in single quotes. - Overrides:
- styleStringin class- DefaultValueStyler
- Returns:
- a styled version of the supplied string
 
- 
styleClassDescription copied from class:DefaultValueStylerGenerate a styled version of the suppliedClass.The default implementation delegates to ClassUtils.getShortName(Class).- Overrides:
- styleClassin class- DefaultValueStyler
- Returns:
- a styled version of the supplied class
 
- 
styleMethodDescription copied from class:DefaultValueStylerGenerate 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.- Overrides:
- styleMethodin class- DefaultValueStyler
- Returns:
- a styled version of the supplied method
 
- 
styleMapDescription copied from class:DefaultValueStylerGenerate a styled version of the suppliedMap.- Overrides:
- styleMapin class- DefaultValueStyler
- Returns:
- a styled version of the supplied map
 
- 
styleCollectionDescription copied from class:DefaultValueStylerGenerate a styled version of the suppliedCollection.- Overrides:
- styleCollectionin class- DefaultValueStyler
- Returns:
- a styled version of the supplied collection
 
- 
styleArrayDescription copied from class:DefaultValueStylerGenerate a styled version of the supplied array.- Overrides:
- styleArrayin class- DefaultValueStyler
- Returns:
- a styled version of the supplied array
 
 
-