Java Doc for ToStringStyle.java in  » Library » Apache-common-lang » org » apache » commons » lang » builder » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache common lang » org.apache.commons.lang.builder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.lang.builder.ToStringStyle

All known Subclasses:   org.apache.commons.lang.builder.StandardToStringStyle,
ToStringStyle
abstract public class ToStringStyle implements Serializable(Code)

Controls String formatting for ToStringBuilder . The main public interface is always via ToStringBuilder.

These classes are intended to be used as Singletons. There is no need to instantiate a new style each time. A program will generally use one of the predefined constants on this class. Alternatively, the StandardToStringStyle class can be used to set the individual settings. Thus most styles can be achieved without subclassing.

If required, a subclass can override as many or as few of the methods as it requires. Each object type (from boolean to long to Object to int[]) has its own methods to output it. Most have two versions, detail and summary.

For example, the detail version of the array based methods will output the whole array, whereas the summary method will just output the array length.

If you want to format the output of certain objects, such as dates, you must create a subclass and override a method.

 public class MyStyle extends ToStringStyle {
 protected void appendDetail(StringBuffer buffer, String fieldName, Object value) {
 if (value instanceof Date) {
 value = new SimpleDateFormat("yyyy-MM-dd").format(value);
 }
 buffer.append(value);
 }
 }
 


author:
   Stephen Colebourne
author:
   Gary Gregory
author:
   Pete Gieser
author:
   Masato Tezuka
since:
   1.0
version:
   $Id: ToStringStyle.java 500497 2007-01-27 07:13:59Z bayard $


Field Summary
final public static  ToStringStyleDEFAULT_STYLE
     The default toString style.
final public static  ToStringStyleMULTI_LINE_STYLE
     The multi line toString style.
final public static  ToStringStyleNO_FIELD_NAMES_STYLE
     The no field names toString style.
final public static  ToStringStyleSHORT_PREFIX_STYLE
     The short prefix toString style.
final public static  ToStringStyleSIMPLE_STYLE
     The simple toString style.

Constructor Summary
protected  ToStringStyle()
    

Method Summary
public  voidappend(StringBuffer buffer, String fieldName, Object value, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, long value)
    
public  voidappend(StringBuffer buffer, String fieldName, int value)
    
public  voidappend(StringBuffer buffer, String fieldName, short value)
    
public  voidappend(StringBuffer buffer, String fieldName, byte value)
    
public  voidappend(StringBuffer buffer, String fieldName, char value)
    
public  voidappend(StringBuffer buffer, String fieldName, double value)
    
public  voidappend(StringBuffer buffer, String fieldName, float value)
    
public  voidappend(StringBuffer buffer, String fieldName, boolean value)
    
public  voidappend(StringBuffer buffer, String fieldName, Object[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, long[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, int[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, short[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, byte[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, char[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, float[] array, Boolean fullDetail)
    
public  voidappend(StringBuffer buffer, String fieldName, boolean[] array, Boolean fullDetail)
    
protected  voidappendClassName(StringBuffer buffer, Object object)
    
protected  voidappendContentEnd(StringBuffer buffer)
    
protected  voidappendContentStart(StringBuffer buffer)
    
protected  voidappendCyclicObject(StringBuffer buffer, String fieldName, Object value)
    

Append to the toString an Object value that has been detected to participate in a cycle.

protected  voidappendDetail(StringBuffer buffer, String fieldName, Object value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, Collection coll)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, Map map)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, long value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, int value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, short value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, byte value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, char value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, double value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, float value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, boolean value)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, Object[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, long[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, int[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, short[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, byte[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, char[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, double[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, float[] array)
    
protected  voidappendDetail(StringBuffer buffer, String fieldName, boolean[] array)
    
public  voidappendEnd(StringBuffer buffer, Object object)
    
protected  voidappendFieldEnd(StringBuffer buffer, String fieldName)
    
protected  voidappendFieldSeparator(StringBuffer buffer)
    
protected  voidappendFieldStart(StringBuffer buffer, String fieldName)
    
protected  voidappendIdentityHashCode(StringBuffer buffer, Object object)
    
protected  voidappendInternal(StringBuffer buffer, String fieldName, Object value, boolean detail)
    
protected  voidappendNullText(StringBuffer buffer, String fieldName)
    
public  voidappendStart(StringBuffer buffer, Object object)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, Object value)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, Object[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, long[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, int[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, short[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, byte[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, char[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, double[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, float[] array)
    
protected  voidappendSummary(StringBuffer buffer, String fieldName, boolean[] array)
    
protected  voidappendSummarySize(StringBuffer buffer, String fieldName, int size)
    
public  voidappendSuper(StringBuffer buffer, String superToString)
    
public  voidappendToString(StringBuffer buffer, String toString)
    
protected  StringgetArrayEnd()
    
protected  StringgetArraySeparator()
    
protected  StringgetArrayStart()
    
protected  StringgetContentEnd()
    
protected  StringgetContentStart()
    
protected  StringgetFieldNameValueSeparator()
    
protected  StringgetFieldSeparator()
    
protected  StringgetNullText()
    
static  SetgetRegistry()
    

Returns the registry of objects being traversed by the reflectionToString methods in the current thread.

protected  StringgetShortClassName(Class cls)
    
protected  StringgetSizeEndText()
    
protected  StringgetSizeStartText()
    
protected  StringgetSummaryObjectEndText()
    
protected  StringgetSummaryObjectStartText()
    
protected  booleanisArrayContentDetail()
    
protected  booleanisDefaultFullDetail()
    
protected  booleanisFieldSeparatorAtEnd()
    
protected  booleanisFieldSeparatorAtStart()
    
protected  booleanisFullDetail(Boolean fullDetailRequest)
    

Is this field to be output in full detail.

This method converts a detail request into a detail level. The calling code may request full detail (true), but a subclass might ignore that and always return false.

static  booleanisRegistered(Object value)
    

Returns true if the registry contains the given object. Used by the reflection methods to avoid infinite loops.


Parameters:
  value - The object to lookup in the registry.
protected  booleanisShortClassName()
    
protected  booleanisUseClassName()
    
protected  booleanisUseFieldNames()
    
protected  booleanisUseIdentityHashCode()
    
protected  booleanisUseShortClassName()
    
protected  voidreflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array)
    
static  voidregister(Object value)
    

Registers the given object.

protected  voidremoveLastFieldSeparator(StringBuffer buffer)
    
protected  voidsetArrayContentDetail(boolean arrayContentDetail)
    
protected  voidsetArrayEnd(String arrayEnd)
    
protected  voidsetArraySeparator(String arraySeparator)
    
protected  voidsetArrayStart(String arrayStart)
    
protected  voidsetContentEnd(String contentEnd)
    
protected  voidsetContentStart(String contentStart)
    
protected  voidsetDefaultFullDetail(boolean defaultFullDetail)
    
protected  voidsetFieldNameValueSeparator(String fieldNameValueSeparator)
    
protected  voidsetFieldSeparator(String fieldSeparator)
    
protected  voidsetFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)
    
protected  voidsetFieldSeparatorAtStart(boolean fieldSeparatorAtStart)
    
protected  voidsetNullText(String nullText)
    
protected  voidsetShortClassName(boolean shortClassName)
    
protected  voidsetSizeEndText(String sizeEndText)
    
protected  voidsetSizeStartText(String sizeStartText)
    
protected  voidsetSummaryObjectEndText(String summaryObjectEndText)
    
protected  voidsetSummaryObjectStartText(String summaryObjectStartText)
    
protected  voidsetUseClassName(boolean useClassName)
    
protected  voidsetUseFieldNames(boolean useFieldNames)
    
protected  voidsetUseIdentityHashCode(boolean useIdentityHashCode)
    
protected  voidsetUseShortClassName(boolean useShortClassName)
    
static  voidunregister(Object value)
    

Unregisters the given object.


Field Detail
DEFAULT_STYLE
final public static ToStringStyle DEFAULT_STYLE(Code)
The default toString style.



MULTI_LINE_STYLE
final public static ToStringStyle MULTI_LINE_STYLE(Code)
The multi line toString style.



NO_FIELD_NAMES_STYLE
final public static ToStringStyle NO_FIELD_NAMES_STYLE(Code)
The no field names toString style.



SHORT_PREFIX_STYLE
final public static ToStringStyle SHORT_PREFIX_STYLE(Code)
The short prefix toString style.
since:
   2.1



SIMPLE_STYLE
final public static ToStringStyle SIMPLE_STYLE(Code)
The simple toString style.




Constructor Detail
ToStringStyle
protected ToStringStyle()(Code)

Constructor.





Method Detail
append
public void append(StringBuffer buffer, String fieldName, Object value, Boolean fullDetail)(Code)

Append to the toString an Object value, printing the full toString of the Object passed in.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, long value)(Code)

Append to the toString a long value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, int value)(Code)

Append to the toString an int value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, short value)(Code)

Append to the toString a short value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, byte value)(Code)

Append to the toString a byte value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, char value)(Code)

Append to the toString a char value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, double value)(Code)

Append to the toString a double value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, float value)(Code)

Append to the toString a float value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, boolean value)(Code)

Append to the toString a boolean value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  value - the value to add to the toString



append
public void append(StringBuffer buffer, String fieldName, Object[] array, Boolean fullDetail)(Code)

Append to the toString an Object array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, long[] array, Boolean fullDetail)(Code)

Append to the toString a long array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, int[] array, Boolean fullDetail)(Code)

Append to the toString an int array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, short[] array, Boolean fullDetail)(Code)

Append to the toString a short array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, byte[] array, Boolean fullDetail)(Code)

Append to the toString a byte array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, char[] array, Boolean fullDetail)(Code)

Append to the toString a char array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail)(Code)

Append to the toString a double array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, float[] array, Boolean fullDetail)(Code)

Append to the toString a float array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



append
public void append(StringBuffer buffer, String fieldName, boolean[] array, Boolean fullDetail)(Code)

Append to the toString a boolean array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name
Parameters:
  array - the array to add to the toString
Parameters:
  fullDetail - true for detail, falsefor summary info, null for style decides



appendClassName
protected void appendClassName(StringBuffer buffer, Object object)(Code)

Append to the toString the class name.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  object - the Object whose name to output



appendContentEnd
protected void appendContentEnd(StringBuffer buffer)(Code)

Append to the toString the content end.


Parameters:
  buffer - the StringBuffer to populate



appendContentStart
protected void appendContentStart(StringBuffer buffer)(Code)

Append to the toString the content start.


Parameters:
  buffer - the StringBuffer to populate



appendCyclicObject
protected void appendCyclicObject(StringBuffer buffer, String fieldName, Object value)(Code)

Append to the toString an Object value that has been detected to participate in a cycle. This implementation will print the standard string value of the value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString,not null
since:
   2.2



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, Object value)(Code)

Append to the toString an Object value, printing the full detail of the Object.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, Collection coll)(Code)

Append to the toString a Collection.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  coll - the Collection to add to thetoString, not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, Map map)(Code)

Append to the toString a Map.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  map - the Map to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, long value)(Code)

Append to the toString a long value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, int value)(Code)

Append to the toString an int value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, short value)(Code)

Append to the toString a short value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, byte value)(Code)

Append to the toString a byte value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, char value)(Code)

Append to the toString a char value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, double value)(Code)

Append to the toString a double value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, float value)(Code)

Append to the toString a float value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, boolean value)(Code)

Append to the toString a boolean value.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, Object[] array)(Code)

Append to the toString the detail of an Object array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, long[] array)(Code)

Append to the toString the detail of a long array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, int[] array)(Code)

Append to the toString the detail of an int array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, short[] array)(Code)

Append to the toString the detail of a short array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, byte[] array)(Code)

Append to the toString the detail of a byte array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, char[] array)(Code)

Append to the toString the detail of a char array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, double[] array)(Code)

Append to the toString the detail of a double array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, float[] array)(Code)

Append to the toString the detail of a float array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendDetail
protected void appendDetail(StringBuffer buffer, String fieldName, boolean[] array)(Code)

Append to the toString the detail of a boolean array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendEnd
public void appendEnd(StringBuffer buffer, Object object)(Code)

Append to the toString the end of data indicator.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  object - the Object to build atoString for.



appendFieldEnd
protected void appendFieldEnd(StringBuffer buffer, String fieldName)(Code)

Append to the toString the field end.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended



appendFieldSeparator
protected void appendFieldSeparator(StringBuffer buffer)(Code)

Append to the toString the field separator.


Parameters:
  buffer - the StringBuffer to populate



appendFieldStart
protected void appendFieldStart(StringBuffer buffer, String fieldName)(Code)

Append to the toString the field start.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name



appendIdentityHashCode
protected void appendIdentityHashCode(StringBuffer buffer, Object object)(Code)

Append the System.identityHashCode(java.lang.Object) .


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  object - the Object whose id to output



appendInternal
protected void appendInternal(StringBuffer buffer, String fieldName, Object value, boolean detail)(Code)

Append to the toString an Object, correctly interpreting its type.

This method performs the main lookup by Class type to correctly route arrays, Collections, Maps and Objects to the appropriate method.

Either detail or summary views can be specified.

If a cycle is detected, an object will be appended with the Object.toString() format.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString,not null
Parameters:
  detail - output detail or not



appendNullText
protected void appendNullText(StringBuffer buffer, String fieldName)(Code)

Append to the toString an indicator for null.

The default indicator is '<null>'.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended



appendStart
public void appendStart(StringBuffer buffer, Object object)(Code)

Append to the toString the start of data indicator.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  object - the Object to build a toString for



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, Object value)(Code)

Append to the toString an Object value, printing a summary of the Object.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  value - the value to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, Object[] array)(Code)

Append to the toString a summary of an Object array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, long[] array)(Code)

Append to the toString a summary of a long array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, int[] array)(Code)

Append to the toString a summary of an int array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, short[] array)(Code)

Append to the toString a summary of a short array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, byte[] array)(Code)

Append to the toString a summary of a byte array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, char[] array)(Code)

Append to the toString a summary of a char array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, double[] array)(Code)

Append to the toString a summary of a double array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, float[] array)(Code)

Append to the toString a summary of a float array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummary
protected void appendSummary(StringBuffer buffer, String fieldName, boolean[] array)(Code)

Append to the toString a summary of a boolean array.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null



appendSummarySize
protected void appendSummarySize(StringBuffer buffer, String fieldName, int size)(Code)

Append to the toString a size summary.

The size summary is used to summarize the contents of Collections, Maps and arrays.

The output consists of a prefix, the passed in size and a suffix.

The default format is '<size=n>'.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  size - the size to append



appendSuper
public void appendSuper(StringBuffer buffer, String superToString)(Code)

Append to the toString the superclass toString.

A null superToString is ignored.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  superToString - the super.toString()
since:
   2.0



appendToString
public void appendToString(StringBuffer buffer, String toString)(Code)

Append to the toString another toString.

A null toString is ignored.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  toString - the additional toString
since:
   2.0



getArrayEnd
protected String getArrayEnd()(Code)

Gets the array end text.

the current array end text



getArraySeparator
protected String getArraySeparator()(Code)

Gets the array separator text.

the current array separator text



getArrayStart
protected String getArrayStart()(Code)

Gets the array start text.

the current array start text



getContentEnd
protected String getContentEnd()(Code)

Gets the content end text.

the current content end text



getContentStart
protected String getContentStart()(Code)

Gets the content start text.

the current content start text



getFieldNameValueSeparator
protected String getFieldNameValueSeparator()(Code)

Gets the field name value separator text.

the current field name value separator text



getFieldSeparator
protected String getFieldSeparator()(Code)

Gets the field separator text.

the current field separator text



getNullText
protected String getNullText()(Code)

Gets the text to output when null found.

the current text to output when null found



getRegistry
static Set getRegistry()(Code)

Returns the registry of objects being traversed by the reflectionToString methods in the current thread.

Set the registry of objects being traversed



getShortClassName
protected String getShortClassName(Class cls)(Code)

Gets the short class name for a class.

The short class name is the classname excluding the package name.


Parameters:
  cls - the Class to get the short name of the short name



getSizeEndText
protected String getSizeEndText()(Code)

Gets the end text to output when a Collection, Map or array size is output.

This is output after the size value.

the current end of size text



getSizeStartText
protected String getSizeStartText()(Code)

Gets the start text to output when a Collection, Map or array size is output.

This is output before the size value.

the current start of size text



getSummaryObjectEndText
protected String getSummaryObjectEndText()(Code)

Gets the end text to output when an Object is output in summary mode.

This is output after the size value.

the current end of summary text



getSummaryObjectStartText
protected String getSummaryObjectStartText()(Code)

Gets the start text to output when an Object is output in summary mode.

This is output before the size value.

the current start of summary text



isArrayContentDetail
protected boolean isArrayContentDetail()(Code)

Gets whether to output array content detail.

the current array content detail setting



isDefaultFullDetail
protected boolean isDefaultFullDetail()(Code)

Gets whether to use full detail when the caller doesn't specify.

the current defaultFullDetail flag



isFieldSeparatorAtEnd
protected boolean isFieldSeparatorAtEnd()(Code)

Gets whether the field separator should be added at the end of each buffer.

fieldSeparatorAtEnd flag
since:
   2.0



isFieldSeparatorAtStart
protected boolean isFieldSeparatorAtStart()(Code)

Gets whether the field separator should be added at the start of each buffer.

the fieldSeparatorAtStart flag
since:
   2.0



isFullDetail
protected boolean isFullDetail(Boolean fullDetailRequest)(Code)

Is this field to be output in full detail.

This method converts a detail request into a detail level. The calling code may request full detail (true), but a subclass might ignore that and always return false. The calling code may pass in null indicating that it doesn't care about the detail level. In this case the default detail level is used.


Parameters:
  fullDetailRequest - the detail level requested whether full detail is to be shown



isRegistered
static boolean isRegistered(Object value)(Code)

Returns true if the registry contains the given object. Used by the reflection methods to avoid infinite loops.


Parameters:
  value - The object to lookup in the registry. boolean true if the registry contains the givenobject.



isShortClassName
protected boolean isShortClassName()(Code)

Gets whether to output short or long class names.

the current shortClassName flagToStringStyle.isUseShortClassName()



isUseClassName
protected boolean isUseClassName()(Code)

Gets whether to use the class name.

the current useClassName flag



isUseFieldNames
protected boolean isUseFieldNames()(Code)

Gets whether to use the field names passed in.

the current useFieldNames flag



isUseIdentityHashCode
protected boolean isUseIdentityHashCode()(Code)

Gets whether to use the identity hash code.

the current useIdentityHashCode flag



isUseShortClassName
protected boolean isUseShortClassName()(Code)

Gets whether to output short or long class names.

the current useShortClassName flag
since:
   2.0



reflectionAppendArrayDetail
protected void reflectionAppendArrayDetail(StringBuffer buffer, String fieldName, Object array)(Code)

Append to the toString the detail of an array type.


Parameters:
  buffer - the StringBuffer to populate
Parameters:
  fieldName - the field name, typically not used as already appended
Parameters:
  array - the array to add to the toString,not null
since:
   2.0



register
static void register(Object value)(Code)

Registers the given object. Used by the reflection methods to avoid infinite loops.


Parameters:
  value - The object to register.



removeLastFieldSeparator
protected void removeLastFieldSeparator(StringBuffer buffer)(Code)

Remove the last field separator from the buffer.


Parameters:
  buffer - the StringBuffer to populate
since:
   2.0



setArrayContentDetail
protected void setArrayContentDetail(boolean arrayContentDetail)(Code)

Sets whether to output array content detail.


Parameters:
  arrayContentDetail - the new arrayContentDetail flag



setArrayEnd
protected void setArrayEnd(String arrayEnd)(Code)

Sets the array end text.

null is accepted, but will be converted to an empty String.


Parameters:
  arrayEnd - the new array end text



setArraySeparator
protected void setArraySeparator(String arraySeparator)(Code)

Sets the array separator text.

null is accepted, but will be converted to an empty String.


Parameters:
  arraySeparator - the new array separator text



setArrayStart
protected void setArrayStart(String arrayStart)(Code)

Sets the array start text.

null is accepted, but will be converted to an empty String.


Parameters:
  arrayStart - the new array start text



setContentEnd
protected void setContentEnd(String contentEnd)(Code)

Sets the content end text.

null is accepted, but will be converted to an empty String.


Parameters:
  contentEnd - the new content end text



setContentStart
protected void setContentStart(String contentStart)(Code)

Sets the content start text.

null is accepted, but will be converted to an empty String.


Parameters:
  contentStart - the new content start text



setDefaultFullDetail
protected void setDefaultFullDetail(boolean defaultFullDetail)(Code)

Sets whether to use full detail when the caller doesn't specify.


Parameters:
  defaultFullDetail - the new defaultFullDetail flag



setFieldNameValueSeparator
protected void setFieldNameValueSeparator(String fieldNameValueSeparator)(Code)

Sets the field name value separator text.

null is accepted, but will be converted to an empty String.


Parameters:
  fieldNameValueSeparator - the new field name value separator text



setFieldSeparator
protected void setFieldSeparator(String fieldSeparator)(Code)

Sets the field separator text.

null is accepted, but will be converted to an empty String.


Parameters:
  fieldSeparator - the new field separator text



setFieldSeparatorAtEnd
protected void setFieldSeparatorAtEnd(boolean fieldSeparatorAtEnd)(Code)

Sets whether the field separator should be added at the end of each buffer.


Parameters:
  fieldSeparatorAtEnd - the fieldSeparatorAtEnd flag
since:
   2.0



setFieldSeparatorAtStart
protected void setFieldSeparatorAtStart(boolean fieldSeparatorAtStart)(Code)

Sets whether the field separator should be added at the start of each buffer.


Parameters:
  fieldSeparatorAtStart - the fieldSeparatorAtStart flag
since:
   2.0



setNullText
protected void setNullText(String nullText)(Code)

Sets the text to output when null found.

null is accepted, but will be converted to an empty String.


Parameters:
  nullText - the new text to output when null found



setShortClassName
protected void setShortClassName(boolean shortClassName)(Code)

Sets whether to output short or long class names.


Parameters:
  shortClassName - the new shortClassName flagToStringStyle.setUseShortClassName(boolean)



setSizeEndText
protected void setSizeEndText(String sizeEndText)(Code)

Sets the end text to output when a Collection, Map or array size is output.

This is output after the size value.

null is accepted, but will be converted to an empty String.


Parameters:
  sizeEndText - the new end of size text



setSizeStartText
protected void setSizeStartText(String sizeStartText)(Code)

Sets the start text to output when a Collection, Map or array size is output.

This is output before the size value.

null is accepted, but will be converted to an empty String.


Parameters:
  sizeStartText - the new start of size text



setSummaryObjectEndText
protected void setSummaryObjectEndText(String summaryObjectEndText)(Code)

Sets the end text to output when an Object is output in summary mode.

This is output after the size value.

null is accepted, but will be converted to an empty String.


Parameters:
  summaryObjectEndText - the new end of summary text



setSummaryObjectStartText
protected void setSummaryObjectStartText(String summaryObjectStartText)(Code)

Sets the start text to output when an Object is output in summary mode.

This is output before the size value.

null is accepted, but will be converted to an empty String.


Parameters:
  summaryObjectStartText - the new start of summary text



setUseClassName
protected void setUseClassName(boolean useClassName)(Code)

Sets whether to use the class name.


Parameters:
  useClassName - the new useClassName flag



setUseFieldNames
protected void setUseFieldNames(boolean useFieldNames)(Code)

Sets whether to use the field names passed in.


Parameters:
  useFieldNames - the new useFieldNames flag



setUseIdentityHashCode
protected void setUseIdentityHashCode(boolean useIdentityHashCode)(Code)

Sets whether to use the identity hash code.


Parameters:
  useIdentityHashCode - the new useIdentityHashCode flag



setUseShortClassName
protected void setUseShortClassName(boolean useShortClassName)(Code)

Sets whether to output short or long class names.


Parameters:
  useShortClassName - the new useShortClassName flag
since:
   2.0



unregister
static void unregister(Object value)(Code)

Unregisters the given object.

Used by the reflection methods to avoid infinite loops.


Parameters:
  value - The object to unregister.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.