Package org.springframework.core.style
Interface ToStringStyler
- All Known Implementing Classes:
DefaultToStringStyler
public interface ToStringStyler
A strategy interface for pretty-printingtoString()
methods. Encapsulates the print algorithms; some other object such as a builder should provide the workflow.- Since:
- 1.2.2
- Author:
- Keith Donald
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
styleEnd(StringBuilder buffer, Object obj)
Style atoString()
'ed object after it's fields are styled.void
styleField(StringBuilder buffer, String fieldName, Object value)
Style a field value as a string.void
styleFieldSeparator(StringBuilder buffer)
Style the field separator.void
styleStart(StringBuilder buffer, Object obj)
Style atoString()
'ed object before its fields are styled.void
styleValue(StringBuilder buffer, Object value)
Style the given value.
Method Detail
styleStart
void styleStart(StringBuilder buffer, Object obj)
Style atoString()
'ed object before its fields are styled.- Parameters:
buffer
- the buffer to print toobj
- the object to style
styleEnd
void styleEnd(StringBuilder buffer, Object obj)
Style atoString()
'ed object after it's fields are styled.- Parameters:
buffer
- the buffer to print toobj
- the object to style
styleField
void styleField(StringBuilder buffer, String fieldName, Object value)
Style a field value as a string.- Parameters:
buffer
- the buffer to print tofieldName
- the he name of the fieldvalue
- the field value
styleValue
void styleValue(StringBuilder buffer, Object value)
Style the given value.- Parameters:
buffer
- the buffer to print tovalue
- the field value
styleFieldSeparator
void styleFieldSeparator(StringBuilder buffer)
Style the field separator.- Parameters:
buffer
- buffer to print to