A class that implements this interface indicates that it is able to:
- Persist itself as a single
String
through its
toString()
method.
- Completely initialize a new instance through a constructor that
takes a single
String
parameter. This constructor
thus performs the inverse operation of the toString()
method.
The
ToStringManager
class mediates the conversion to and from
a
String
representation. The
ToStringManager
will automatically detect that a class implements the
StringConversion
interface. Therefore classes implementing
this interface do not need to be registered via the
ToStringManager.registerConstructorSupportedConverter()
method in order for the conversion to and from
String
to
take place. Explicit registration is intended for already existing
classes (e.g.
java.net.URL
) that cannot or should not be
changed to include this interface in their
implements clause.