fc.util
Class ToString.Style

java.lang.Object
  extended by fc.util.ToString.Style
Enclosing class:
ToString

public static class ToString.Style
extends Object

Drives the formatting behavior. Behavior different than the defaults can be achieved by instantiating a new object and setting it's properties appropriately.


Nested Class Summary
static class ToString.Style.VisibleLevel
           
 
Field Summary
 String arrayValSep
          default: ,
 boolean className
          Print the class name at all ? default: true
 String endArray
          default: }
 String endContent
          The end of the string after the object classname and identity reference.
 String endString
          The end of the entire string.
 boolean expandArrays
          Expand array values, default: false.
 String fieldAndValSep
          default: =
 boolean fieldName
          Print the field name ? default: true.
 String fieldSep
          default: ,
 boolean fullClassName
          print full class name ? default: false
 boolean idHashCode
          print indentity hash code for the object ? default: true
 boolean reflectFieldName
          print field names when using reflection ? default: true
 boolean reflectStatics
          Reflects static variables.
 boolean reflectSuperClass
          Prints the superclass's variables when using reflection ? default: false
 ToString.Style.VisibleLevel reflectVisibleLevel
          Default access level when using reflection (fields with this or looser access will be printed).
 String startArray
          default: {
 String startContent
          The start of the string after the object classname and identity reference.
 String startString
          The start of the entire string.
 
Constructor Summary
ToString.Style()
           
 
Method Summary
 void ignoreFieldName(String name)
          Case insensitive field names that will be ignored (for example a public field "foo" may be printed otherwise, but if added to this list, it would be ignored).
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startString

public String startString
The start of the entire string. default to empty: ""


endString

public String endString
The end of the entire string. default to empty: ""


startContent

public String startContent
The start of the string after the object classname and identity reference. default: [


endContent

public String endContent
The end of the string after the object classname and identity reference. default: ]


fieldAndValSep

public String fieldAndValSep
default: =


fieldSep

public String fieldSep
default: ,


startArray

public String startArray
default: {


endArray

public String endArray
default: }


arrayValSep

public String arrayValSep
default: ,


expandArrays

public boolean expandArrays
Expand array values, default: false. expansion only works when arrays are manually added using one of the append(..) methods, not when using reflection.


fieldName

public boolean fieldName
Print the field name ? default: true. If field names are not printed, then neither is the #FieldAndValSep - only the value of a field is printed.


className

public boolean className
Print the class name at all ? default: true


fullClassName

public boolean fullClassName
print full class name ? default: false


idHashCode

public boolean idHashCode
print indentity hash code for the object ? default: true


reflectFieldName

public boolean reflectFieldName
print field names when using reflection ? default: true


reflectSuperClass

public boolean reflectSuperClass
Prints the superclass's variables when using reflection ? default: false


reflectStatics

public boolean reflectStatics
Reflects static variables. By default this is false since statics are not part of the object's instance-state.


reflectVisibleLevel

public ToString.Style.VisibleLevel reflectVisibleLevel
Default access level when using reflection (fields with this or looser access will be printed). default: PRIVATE (EVERYTHING IS PRINTED)

Constructor Detail

ToString.Style

public ToString.Style()
Method Detail

ignoreFieldName

public void ignoreFieldName(String name)
Case insensitive field names that will be ignored (for example a public field "foo" may be printed otherwise, but if added to this list, it would be ignored). Use this method to add as many field names as needed.


toString

public String toString()
Overrides:
toString in class Object