Encoder
, together with PersistenceDelegate
s, can encode an object into a series of java statements. By executing these statements, a new object can be created and it will has the same state as the original object which has been passed to the encoder. Here "has the same state" means the two objects are indistinguishable from their public API. The Encoder
and PersistenceDelegate
s do this by creating copies of the input object and all objects it references. The copy process continues recursively util every object in the object graph has its new copy and the new version has the same state as the old version. All statements used to create those new objects and executed on them during the process form the result of encoding.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|