![]() |
|
Contents |
Protected Member Functions | |
| boolean | mutatesTo (Object o1, Object o2) |
| Determines whether one object mutates to the other object. | |
| void | initialize (Class<?> type, Object oldInstance, Object newInstance, Encoder enc) |
| Initializes the new instance in the new environment so that it becomes equivalent with the old one, meanwhile recording this process in the encoder. | |
| Expression | instantiate (Object oldInstance, Encoder enc) |
| Returns an expression that represents a call to the bean's constructor. | |
| boolean mutatesTo | ( | Object | o1, | |
| Object | o2 | |||
| ) | [protected] |
Determines whether one object mutates to the other object.
If this DefaultPersistenceDelegate is constructed with one or more property names, and the class of o1 overrides the "equals(Object)" method, then o2 is considered to mutate to o1 if o1 equals to o2. Otherwise, the result is the same as the definition in PersistenceDelegate.
| o1 | one object | |
| o2 | the other object |
Reimplemented from DefaultPersistenceDelegate.
| void initialize | ( | Class<?> | type, | |
| Object | oldInstance, | |||
| Object | newInstance, | |||
| Encoder | enc | |||
| ) | [protected] |
Initializes the new instance in the new environment so that it becomes equivalent with the old one, meanwhile recording this process in the encoder.
This is done by inspecting each property of the bean. The property value from the old bean instance and the value from the new bean instance are both retrieved and examined to see whether the latter mutates to the former, and if not, issue a call to the write method to set the equivalent value for the new instance. Exceptions occured during this process are reported to the exception listener of the encoder.
| type | the type of the bean | |
| oldInstance | the original bean object to be recorded | |
| newInstance | the simmulating new bean object to be initialized | |
| enc | the encoder to write the outputs to |
Reimplemented from DefaultPersistenceDelegate.
| Expression instantiate | ( | Object | oldInstance, | |
| Encoder | enc | |||
| ) | [protected, virtual] |
Returns an expression that represents a call to the bean's constructor.
The constructor may take zero or more parameters, as specified when this DefaultPersistenceDelegate is constructed.
| oldInstance | the old instance | |
| enc | the encoder that wants to record the old instance |
Reimplemented from DefaultPersistenceDelegate.