Package jadex.commons.beans
Class DefaultPersistenceDelegate
- java.lang.Object
- 
- jadex.commons.beans.PersistenceDelegate
- 
- jadex.commons.beans.DefaultPersistenceDelegate
 
 
- 
 public class DefaultPersistenceDelegate extends PersistenceDelegate Default PersistenceDelegate for normal classes. The instances of this class are used when other customized PersistenceDelegate is not set in the encoders for a particular type.- See Also:
- Encoder
 - 
- 
Constructor SummaryConstructors Constructor Description DefaultPersistenceDelegate()Constructs aDefaultPersistenceDelegateinstance that supports the persistence of a bean which has a default constructor.DefaultPersistenceDelegate(java.lang.String[] propertyNames)Constructs aDefaultPersistenceDelegateinstance that supports the persistence of a bean which is constructed with some properties.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinitialize(java.lang.Class<?> type, java.lang.Object oldInstance, java.lang.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.protected Expressioninstantiate(java.lang.Object oldInstance, Encoder enc)Returns an expression that represents a call to the bean's constructor.protected booleanmutatesTo(java.lang.Object o1, java.lang.Object o2)Determines whether one object mutates to the other object.- 
Methods inherited from class jadex.commons.beans.PersistenceDelegatewriteObject
 
- 
 
- 
 - 
- 
Constructor Detail- 
DefaultPersistenceDelegatepublic DefaultPersistenceDelegate() Constructs aDefaultPersistenceDelegateinstance that supports the persistence of a bean which has a default constructor.
 - 
DefaultPersistenceDelegatepublic DefaultPersistenceDelegate(java.lang.String[] propertyNames) Constructs aDefaultPersistenceDelegateinstance that supports the persistence of a bean which is constructed with some properties.- Parameters:
- propertyNames- the name of the properties that are taken as parameters by the bean's constructor
 
 
- 
 - 
Method Detail- 
initializeprotected void initialize(java.lang.Class<?> type, java.lang.Object oldInstance, java.lang.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.- Overrides:
- initializein class- PersistenceDelegate
- Parameters:
- 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
 - 
instantiateprotected Expression instantiate(java.lang.Object oldInstance, Encoder enc) Returns an expression that represents a call to the bean's constructor. The constructor may take zero or more parameters, as specified when thisDefaultPersistenceDelegateis constructed.- Specified by:
- instantiatein class- PersistenceDelegate
- Parameters:
- oldInstance- the old instance
- enc- the encoder that wants to record the old instance
- Returns:
- an expression for instantiating an object of the same type as the old instance
 
 - 
mutatesToprotected boolean mutatesTo(java.lang.Object o1, java.lang.Object o2)Determines whether one object mutates to the other object. If thisDefaultPersistenceDelegateis constructed with one or more property names, and the class ofo1overrides the "equals(Object)" method, theno2is considered to mutate too1ifo1equals too2. Otherwise, the result is the same as the definition inPersistenceDelegate.- Overrides:
- mutatesToin class- PersistenceDelegate
- Parameters:
- o1- one object
- o2- the other object
- Returns:
- true if second object mutates to the first object, otherwise false
 
 
 
- 
 
-