All Packages Class Hierarchy This Package Previous Next Index
When it is time to create the new bean class and associated instance, the assembly asks each subassembly object if it has an associated subassembly generator object. If so, it calls methods on that object at various times during the code generation process used to create the new bean class.
Similarly, once the new bean class is compiled, the assembly loads the class, creates an instance, and then allows each subassembly generator to initialize the object with whatever data needs to be serialized with the instance.
public abstract Class getParentClass()
If it does, the required class should be returned. If it does not have any specific requirement, then null should be returned.
It is considered an error if two or more models return classes that are not related by inheritance.
public abstract Class[] getInterface()
If the model does not implement any interfaces, it should return null; otherwise it should return an array containing each of the interfaces it intends to implement.
It is considered an error if two or more models implement the same interface or interfaces related by extension.
public abstract void genBean(String prefix)
In particular, this method can call the assembly genImports(), genFields(), genInit(), genStart(), genMethods(), genClasses(), and genManifest() methods to add whatever Java source code it needs to the class being generated.
This method should generate whatever additional files or classes it needs to implement the new bean. It can use the assembly getPackageName(), getClassName(), getPathName(), and getPackagePathName() methods to determine where any files it needs to create should be stored.
Note that public fields or methods the model wants to expose as part of the new bean's interface should not prepend this string.
public abstract void initBean(Object bean)
If the model needs to initialize the bean with some instance data prior to the assembly serializing it, it can use the introspection APIs to add the data to the bean.
Note that if the model associated with the subassembly generator has established listeners to any of the beans in the current assembly, it should remove them at this time if it wants to prevent the listeners from being saved as part of the new bean persistent state. The assembly invokes the subassembly generator resetBean() method after the new bean has been serialized to allow the model to reattach any removed listeners.
Note that the subassembly should not save the reference to the bean, because it can interfere with the user's ability to create another version of the bean.
public abstract void resetBean()
All Packages Class Hierarchy This Package Previous Next Index