public final class ToStringManager
extends java.lang.Object
String representation.  The mechanisms that are available
  to perform this conversion are attempted in the following order:
  toString()
        to go from Object to String and use the
        constructor that takes a single String parameter to go
        from String to Object.
    ToStringManager.  If one is found,
        use its toString() and fromString()
        methods for carrying out the conversion.
  String is possible for the given object, and any attempt
  to perform the conversion will result in an
  UnsupportedOperationException being thrown.| Modifier and Type | Method and Description | 
|---|---|
| static boolean | converterAvailable(java.lang.Class type)Returns  trueif the given class type can be converted
  to and fromStringfor the purposes of persistence. | 
| static boolean | converterAvailable(java.lang.Object object)Returns  trueif the value of the given object can be
  converted to and from aStringrepresentation. | 
| static boolean | converterAvailable(java.lang.String typeStr)Invokes  Class.forName()on thetypeStrand then callsconverterAvailable(Class). | 
| static java.lang.Object | fromString(java.lang.String s,
          java.lang.Class targetClass)Converts the given  Stringinto the specified
  target class type, returning an instance that has been properly
  initialized according to the contents of theString. | 
| static java.lang.Object | fromString(java.lang.String s,
          java.lang.Class targetClass,
          java.lang.ClassLoader loader)Converts the given  Stringinto the specified
  target class type, returning an instance that has been properly
  initialized according to the contents of theString. | 
| static boolean | registerCustomConverter(java.lang.Class converterClass)Registers a class type as being able to interconvert an object
  type to and from  String. | 
| static boolean | registerStringConvertible(java.lang.Class clazz)Adds the specified class to the list of classes that have
  a direct  Stringrepresentation. | 
| static java.lang.String | toString(java.lang.Object obj)Converts the given object to a  Stringrepresentation
  from which the instance can later be restored by invokingfromString(). | 
| static java.lang.String | toString(java.lang.Object obj,
        java.lang.Class objClass)Converts the given object to a  Stringrepresentation,
  forcing the format to be that of the classobjClass. | 
| static java.lang.Class | wrapPrimitive(java.lang.Class primitive)If the  primitiveargument represents a primitive type,
  then the returned class is the corresponding object-wrapped type. | 
public static boolean registerStringConvertible(java.lang.Class clazz)
String representation.true if the class type has not already been
  registered as a constructor supported converter; false
  otherwise.public static boolean registerCustomConverter(java.lang.Class converterClass)
String.  The class type passed in
  through converterClass must be declared as
  public and must supply three static methods that conform
  to the following:
  public static Class supportedClass();Class that represents
        the object type that the converterClass is
        capable of interconverting to and from String.
    public static String toString( <supportedClass> );
        String.
    public static <supportedClass> fromString( String s );
        registerCustomConverter() will return false.
  If registration succeeds, registerCustomConverter()
  returns true.
  Generally, the name of the class should end with 2String,
  but this is not enforced by ToStringManager.
public static java.lang.Class wrapPrimitive(java.lang.Class primitive)
primitive argument represents a primitive type,
  then the returned class is the corresponding object-wrapped type.
  Otherwise, the argument is returned as is.public static boolean converterAvailable(java.lang.Object object)
true if the value of the given object can be
  converted to and from a String representation.  If
  the object parameter is null, then this
  method returns false.public static boolean converterAvailable(java.lang.String typeStr)
Class.forName() on the typeStr
  and then calls converterAvailable(Class).public static boolean converterAvailable(java.lang.Class type)
true if the given class type can be converted
  to and from String for the purposes of persistence.
  If the type parameter is null, then this
  method returns false.public static java.lang.String toString(java.lang.Object obj)
String representation
  from which the instance can later be restored by invoking
  fromString().public static java.lang.String toString(java.lang.Object obj,
                                        java.lang.Class objClass)
String representation,
  forcing the format to be that of the class objClass.public static java.lang.Object fromString(java.lang.String s,
                                          java.lang.Class targetClass)
String into the specified
  target class type, returning an instance that has been properly
  initialized according to the contents of the String.
  The fromString() method should restore the object
  instance to its exact state at the time that the
  ToStringManager.toString() method was used to persist
  it.public static java.lang.Object fromString(java.lang.String s,
                                          java.lang.Class targetClass,
                                          java.lang.ClassLoader loader)
String into the specified
  target class type, returning an instance that has been properly
  initialized according to the contents of the String.
  The fromString() method should restore the object
  instance to its exact state at the time that the
  ToStringManager.toString() method was used to persist
  it.