|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--net.walend.lyophil.GenericMother
This class implemetns Mother. It uses the role-to-class and role-to-interface defined in lyophil.properties
It uses introspection to call the concrete class's constructors. This Mother immediately freezes a new Freezable in the Director's Freezer.
| Field Summary | |
protected Map |
classesToInterfaces
|
protected Map |
interfacesToRoles
|
protected Map |
rolesToClasses
|
protected Map |
rolesToInterfaces
|
| Fields inherited from interface net.walend.lyophil.Mother |
BEAN, INTERFACE, PREFIX, ROLE |
| Constructor Summary | |
GenericMother()
|
|
| Method Summary | |
private java.lang.String |
arrayToString(java.lang.Object[] array)
|
Freezable |
createEvilClone(Freezable freezy,
java.lang.String role)
Create a copy as a new instance with a new identifier. |
Freezable |
createNewInstance(java.lang.String role)
Create a new instance of a class for the given role wanted. |
Freezable |
createNewInstance(java.lang.String role,
java.lang.Object[] parameters)
Create a new instance of a class for the given role wanted. |
java.lang.Class |
getInterfaceForBeanClass(java.lang.Class beanClass)
|
java.lang.Class |
getInterfaceForRole(java.lang.String role)
|
Set |
getInterfaces()
|
protected PropertySource |
getPropertySource()
|
java.lang.String |
getRoleForInterface(java.lang.Class interf)
|
void |
postCreate(Freezable freezable,
Mother caller)
Freezes the new Freezable immediately |
Freezable |
restoreNewInstance(java.lang.String role,
java.io.Serializable id)
Only call this method from inside a Freezer. |
Freezable |
restoreNewInstance(java.lang.String role,
java.io.Serializable id,
java.lang.Object[] parameters)
Only call this method from inside a Freezer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Map rolesToInterfaces
protected Map interfacesToRoles
protected Map rolesToClasses
protected Map classesToInterfaces
| Constructor Detail |
public GenericMother()
| Method Detail |
protected PropertySource getPropertySource()
public java.lang.Class getInterfaceForRole(java.lang.String role)
getInterfaceForRole in interface Motherpublic java.lang.String getRoleForInterface(java.lang.Class interf)
getRoleForInterface in interface Motherpublic java.lang.Class getInterfaceForBeanClass(java.lang.Class beanClass)
getInterfaceForBeanClass in interface Motherpublic Set getInterfaces()
getInterfaces in interface Motherpublic Freezable createNewInstance(java.lang.String role)
Motherimplementations should call postCreate(new freezable,this);
createNewInstance in interface Mothernet.walend.lyophil.Motherrole - the role that the Freezable should implementprivate java.lang.String arrayToString(java.lang.Object[] array)
public void postCreate(Freezable freezable,
Mother caller)
postCreate in interface Mother
public Freezable createNewInstance(java.lang.String role,
java.lang.Object[] parameters)
Motherimplementations should call postCreate(new freezable,this);
createNewInstance in interface Mothernet.walend.lyophil.Motherrole - the role that the Freezable should implementparameters - for the object's constructor.
public Freezable createEvilClone(Freezable freezy,
java.lang.String role)
Motherimplementations should call postCreate(new freezable,this);
createEvilClone in interface Mothernet.walend.lyophil.Motherfreezy - the Freezable to copy.
public Freezable restoreNewInstance(java.lang.String role,
java.io.Serializable id)
Mother
restoreNewInstance in interface Mothernet.walend.lyophil.Motherrole - the role that the Freezable should implement
public Freezable restoreNewInstance(java.lang.String role,
java.io.Serializable id,
java.lang.Object[] parameters)
Mother
restoreNewInstance in interface Mothernet.walend.lyophil.Motherrole - the role that the Freezable should implementid - the identifier of this Freezableparameters - for the object's constructor.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||