|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.core.style.DefaultToStringStyler
public class DefaultToStringStyler
Spring's default toString()
styler.
This class is used by ToStringCreator
to style toString()
output in a consistent manner according to Spring conventions.
Constructor Summary | |
---|---|
DefaultToStringStyler(ValueStyler valueStyler)
Create a new DefaultToStringStyler. |
Method Summary | |
---|---|
protected ValueStyler |
getValueStyler()
Return the ValueStyler used by this ToStringStyler. |
void |
styleEnd(StringBuilder buffer,
Object o)
Style a toString() 'ed object after it's fields are styled. |
void |
styleField(StringBuilder buffer,
String fieldName,
Object value)
Style a field value as a string. |
protected void |
styleFieldEnd(StringBuilder buffer,
String fieldName)
|
void |
styleFieldSeparator(StringBuilder buffer)
Style the field separator. |
protected void |
styleFieldStart(StringBuilder buffer,
String fieldName)
|
void |
styleStart(StringBuilder buffer,
Object obj)
Style a toString() 'ed object before its fields are styled. |
void |
styleValue(StringBuilder buffer,
Object value)
Style the given value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultToStringStyler(ValueStyler valueStyler)
valueStyler
- the ValueStyler to useMethod Detail |
---|
protected final ValueStyler getValueStyler()
public void styleStart(StringBuilder buffer, Object obj)
ToStringStyler
toString()
'ed object before its fields are styled.
styleStart
in interface ToStringStyler
buffer
- the buffer to print toobj
- the object to stylepublic void styleEnd(StringBuilder buffer, Object o)
ToStringStyler
toString()
'ed object after it's fields are styled.
styleEnd
in interface ToStringStyler
buffer
- the buffer to print too
- the object to stylepublic void styleField(StringBuilder buffer, String fieldName, Object value)
ToStringStyler
styleField
in interface ToStringStyler
buffer
- the buffer to print tofieldName
- the he name of the fieldvalue
- the field valueprotected void styleFieldStart(StringBuilder buffer, String fieldName)
protected void styleFieldEnd(StringBuilder buffer, String fieldName)
public void styleValue(StringBuilder buffer, Object value)
ToStringStyler
styleValue
in interface ToStringStyler
buffer
- the buffer to print tovalue
- the field valuepublic void styleFieldSeparator(StringBuilder buffer)
ToStringStyler
styleFieldSeparator
in interface ToStringStyler
buffer
- buffer to print to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |