接口 ToStringStyler
- 所有已知实现类:
DefaultToStringStyler
public interface ToStringStyler
A strategy interface for pretty-printing
toString() methods.
Encapsulates the print algorithms; some other object such as a builder
should provide the workflow.- 从以下版本开始:
- 4.0
- 作者:
- Keith Donald
-
方法概要
修饰符和类型方法说明voidstyleEnd(StringBuilder buffer, Object obj) Style atoString()'ed object after it's fields are styled.voidstyleField(StringBuilder buffer, String fieldName, Object value) Style a field value as a string.voidstyleFieldSeparator(StringBuilder buffer) Style the field separator.voidstyleStart(StringBuilder buffer, Object obj) Style atoString()'ed object before its fields are styled.voidstyleValue(StringBuilder buffer, Object value) Style the given value.
-
方法详细资料
-
styleStart
Style atoString()'ed object before its fields are styled.- 参数:
buffer- the buffer to print toobj- the object to style
-
styleEnd
Style atoString()'ed object after it's fields are styled.- 参数:
buffer- the buffer to print toobj- the object to style
-
styleField
Style a field value as a string.- 参数:
buffer- the buffer to print tofieldName- the he name of the fieldvalue- the field value
-
styleValue
Style the given value.- 参数:
buffer- the buffer to print tovalue- the field value
-
styleFieldSeparator
Style the field separator.- 参数:
buffer- the buffer to print to
-