All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.ibm.beans.dip.DippableGenerator
The DippableGenerator class has two options for it's main input: a String containing the name of a class or a String containing the name of an interface plus a corresponding implementation bean.
If given the name of a class, the DippableGenerator class creates a class reference and, using introspection, produces a subclass of the class object. This subclass of the class object implements the Dippable interface. This subclass of the class object also contains a reference to a DippableSupport object. The new dippable class is a child of the original class. The generated subclass object overrides all public and protected methods of the original class and all the base classes of the original class.
If given an interface and implementation pair, the DippableGenerator class still creates a class object. However, this class object implements the input interface as well as the Dippable interface. This class object also contains a reference to both the input implementation bean and an implementation of the DippableSupport interface. Using this approach, the dippable class is not a subclass of the implementation object, it implements the interface and uses the implementation object.
public DippableGenerator(String className, String impName, Boolean extended, Boolean override, String additionalAPIs, String dips, Boolean dipsSpecifyOverrides, String newClassName, Boolean finalClass, String finalMethods, Comment aComment, OutputStream beanOstr, Boolean beanInfoCreated, OutputStream beanInfoOstr)
null
which causes the either the
com.ibm.beans.DippableSupportImp class or the
com.ibm.beans.DippableExtendedSupportImp class
to be used. The decision on which implementation
class should be used as the default is based on the
setting of the extended flag.
true
means
implement DippableExtended; false
means implement only Dippable.
This parameter can be null
.
true
means
override all general methods from all parent classes;
false
means
override only the general methods in the original bean.
Only valid if the input is a class.
This parameter can be null
.
additionalAPIs should be added with great care. If the original bean implemented, for example, the Cloneable interface; the dippable bean with the additional APIs may no longer correctly implement the Cloneable interface. This is because the dippable bean just uses the original implementation for the clone() method, and the original implementation does not know about the data added by the additional APIs, which needs to be included in the clone method.
Another reason additionalAPIs should be added with great care is because adding a class+interface pair to the dippable bean can make a new dippable bean that is not thread-safe or is not immutable, although the original bean was thread-safe or immutable.
This parameter can be null
.
This parameter can be null
.
true
means the dips specify which methods
to override; false
otherwise.
Only valid if the dips parameter is provided.
This parameter can be null
.
null
, the name of the dippable bean is
be based on the className argument.
This parameter can be null
.
true
means create a final class;
false
otherwise.
This parameter can be null
.
Only valid if the finalClass parameter is provided.
This parameter can be null
.
This parameter can be null
which causes a default Comment object to be created.
This parameter can be null
which causes
output to be directed to System.out.
true
means
create a corresponding BeanInfo; false
means do not.
This parameter can be null
.
This parameter can be null
which causes
output to be directed to System.out.
public static final String getMorphedClassName(String originalClassName, String originalInterfaceName)
null
if the new morphed class
is to be created through inheritance. The name of the original
interface if the new morphed class is to be created through
aggregation.
public void morph()
protected void outputPackageDeclaration()
protected void outputImportDeclarations()
protected void outputClassDeclaration()
protected void outputConstructors()
protected void outputEventMethods()
protected void outputPropertyMethods()
protected void outputGeneralMethods()
All Packages Class Hierarchy This Package Previous Next Index