Serializes objects which are "attached" to this component but which are
not UIComponent children of it. Examples are validator and listener
objects. To be precise, it returns an object which implements
java.io.Serializable, and which when serialized will persist the
state of the provided object.
If the attachedObject is a List then every object in the list is saved
via a call to this method, and the returned wrapper object contains
a List object.
If the object implements StateHolder then the object's saveState is
called immediately, and a wrapper is returned which contains both
this saved state and the original class name. However in the case
where the StateHolder.isTransient method returns true, null is
returned instead.
If the object implements java.io.Serializable then the object is simply
returned immediately; standard java serialization will later be used
to store this object.
In all other cases, a wrapper is returned which simply stores the type
of the provided object. When deserialized, a default instance of that
type will be recreated.