站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 1.2.9 API 文档英文版

DefaultToStringStyler (Spring Framework) - Spring Framework 1.2.9 API 文档英文版


org.springframework.core.style
Class DefaultToStringStyler

java.lang.Object
  extended by org.springframework.core.style.DefaultToStringStyler
All Implemented Interfaces:
ToStringStyler

public class DefaultToStringStyler
extends Object
implements ToStringStyler

Spring's default toString() styler.

This class is used by ToStringCreator to style toString() output in a consistent manner according to Spring conventions.

Since:
1.2.2
Author:
Keith Donald, Juergen Hoeller

Constructor Summary
DefaultToStringStyler(ValueStyler valueStyler)
          Create a new DefaultToStringStyler.
 
Method Summary
protected  ValueStyler getValueStyler()
          Return the ValueStyler used by this ToStringStyler.
 void styleEnd(StringBuffer buffer, Object o)
          Style a toString()'ed object after it's fields are styled.
 void styleField(StringBuffer buffer, String fieldName, Object value)
          Style a field value as a string.
protected  void styleFieldEnd(StringBuffer buffer, String fieldName)
           
 void styleFieldSeparator(StringBuffer buffer)
          Style the field separator.
protected  void styleFieldStart(StringBuffer buffer, String fieldName)
           
 void styleStart(StringBuffer buffer, Object obj)
          Style a toString()'ed object before its fields are styled.
 void styleValue(StringBuffer 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

DefaultToStringStyler

public DefaultToStringStyler(ValueStyler valueStyler)
Create a new DefaultToStringStyler.

Parameters:
valueStyler - the ValueStyler to use
Method Detail

getValueStyler

protected final ValueStyler getValueStyler()
Return the ValueStyler used by this ToStringStyler.


styleStart

public void styleStart(StringBuffer buffer,
                       Object obj)
Description copied from interface: ToStringStyler
Style a toString()'ed object before its fields are styled.

Specified by:
styleStart in interface ToStringStyler
Parameters:
buffer - the buffer to print to
obj - the object to style

styleEnd

public void styleEnd(StringBuffer buffer,
                     Object o)
Description copied from interface: ToStringStyler
Style a toString()'ed object after it's fields are styled.

Specified by:
styleEnd in interface ToStringStyler
Parameters:
buffer - the buffer to print to
o - the object to style

styleField

public void styleField(StringBuffer buffer,
                       String fieldName,
                       Object value)
Description copied from interface: ToStringStyler
Style a field value as a string.

Specified by:
styleField in interface ToStringStyler
Parameters:
buffer - the buffer to print to
fieldName - the he name of the field
value - the field value

styleFieldStart

protected void styleFieldStart(StringBuffer buffer,
                               String fieldName)

styleFieldEnd

protected void styleFieldEnd(StringBuffer buffer,
                             String fieldName)

styleValue

public void styleValue(StringBuffer buffer,
                       Object value)
Description copied from interface: ToStringStyler
Style the given value.

Specified by:
styleValue in interface ToStringStyler
Parameters:
buffer - the buffer to print to
value - the field value

styleFieldSeparator

public void styleFieldSeparator(StringBuffer buffer)
Description copied from interface: ToStringStyler
Style the field separator.

Specified by:
styleFieldSeparator in interface ToStringStyler
Parameters:
buffer - buffer to print to


Copyright (c) 2002-2007 The Spring Framework Project.