All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.beans.tools.assembly.Assembly

public interface interface Assembly
extends Serializable
This interface provides the top level meta-data that represents the current assembly. This interface tracks all the beans that were added to the assembly, the subassembly models currently being used to assemble the beans, and the set, size, and position of all of the views currently in use. When a user performs a save operation, it is the assembly object which is serialized to save the current state of the editing session. Note that the assembly object only contains meta-data, it is not itself the new bean being assembled.

An assembly object also coordinates the activity of all subassembly models currently in use, both while a new bean is being edited and being generated. The assembly object also informs each active subassembly model when a bean is added, deleted, or selected as well as when it is time to generate the model code needed to define the new bean or add the newly minted bean instance data prior to being serialized. The assembly object also provides a number of methods that aid in the code generation phase of creating a new bean.

See Also:
SubAssembly, SubAssemblyView, SubAssemblyGen

Method Index

 o addBean(BeanReference)
Notifies that a specified bean was added to the assembly by one of the subassembly models or views.
 o addPropertyChangeListener(PropertyChangeListener)
Add a listener to the assembly.
 o closedView(SubAssemblyView)
Notifies that a subassembly view has closed itself.
 o debuggable()
 o genCustomizerBeanInfo(String)
Adds the code to specify one or more customizer classes.
 o genEventSetBeanInfo(String)
Adds the code to create one or more EventDescriptor objects.
 o genFieldNames(String[])
Specifies an array of field names being defined in the source code.
 o genFields(String)
Adds field declarations to the source code.
 o genIconBeanInfo(String)
Defines the code for the BeanInfo getIcon() method along with its associated set of image files.
 o genIconBeanInfo(String, String[])
 o genImports(String)
Adds import statements to the source code.
 o genInit(String)
Adds one or more statements to the bean initialization section of the source code.
 o genInnerClasses(String)
Adds one or more innner classes to the source code.
 o genManifest(String)
Adds information to the bean manifest.
 o genMethodBeanInfo(String)
Adds the code to create one or more MethodDescriptor objects.
 o genMethodNames(String[])
Specifies an array of method names being defined in the source code.
 o genMethods(String)
Adds methods to the source code.
 o genPrivateClasses(String)
Adds one or more private class definition to the source code.
 o genPropertyBeanInfo(String)
Adds the code to create one or more PropertyDescriptor objects.
 o genPublicClass(String, byte[])
Adds a compiled class definition to the generated bean.
 o genPublicClass(String, String)
Adds a public class definition to the source code.
 o genStart(String)
Adds one or more statements to the start execution section of the source code.
 o genStop(String)
Adds one or more statements to the stop execution section of the source code.
 o genUnInit(String)
Adds one or more statements to the bean serialization section of the source code.
 o getBeans()
Returns all BeanReference objects currently in use by the assembly.
 o getClassName()
Returns the class name of the bean being created.
 o getPackageName()
Returns the package name of the bean being created.
 o getPackagePathName()
Returns the complete path name obtained by combining the getPathName() method result with the getPackageName() method result.
 o getParentClass()
Returns the class the generated bean is derived from.
 o getPathName()
Returns the path name being used as the root for all files generated as part of this bean (for example, C:\tempBeans\).
 o getRepositoryName()
Returns the name of the repository the bean is to be stored in.
 o isDebuggable()
 o removeBean(BeanReference)
Notifies that a specified bean was removed from the assembly by one of the subassembly models or views.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener from the set of listeners associated with the assembly.
 o selectBean(BeanReference)
Notifies that a specified bean was selected in one of the subassembly models or views.
 o setParentClass(Class)
Sets the class the generated bean is derived from.
 o showError(String)
Displays the message specified by message in the assembly's status line display as an error message.
 o showStatus(String)
Displays the message specified by message in the assembly's status line display as an information message.
 o showWarning(String)
Displays the message specified by message in the assembly's status line display as a warning message.

Methods

 o closedView
 public abstract void closedView(SubAssemblyView sav)
Notifies that a subassembly view has closed itself. Any subassembly view which provides its own user interface for closing the view should call this method when that interface is used to close the view. This method allows the assembly object to update the main menu bar to indicate the view is not currently active and also to remove the view from the associated subassembly model.

Parameters:
sav - The subassembly view that closed itself.
 o addBean
 public abstract void addBean(BeanReference br)
Notifies that a specified bean was added to the assembly by one of the subassembly models or views. Any subassembly view which provides its own mechanism for adding a bean to the assembly can invoke this method to let the Assembly inform all other active models that the specified bean was added.

Parameters:
br - The reference to the added bean.
 o removeBean
 public abstract void removeBean(BeanReference br)
Notifies that a specified bean was removed from the assembly by one of the subassembly models or views. Any subassembly which provides its own mechanism for removing a bean from the assembly can invoke this method to let the assembly inform all other subassemblies that the specified bean was removed.

Parameters:
br - The reference to the removed bean.
 o selectBean
 public abstract void selectBean(BeanReference br)
Notifies that a specified bean was selected in one of the subassembly models or views. Any subassembly which provides its own mechanism for selecting the current bean can invoke this method to let the assembly inform all other active subassemblies that the specified bean was selected.

Parameters:
br - The reference to the selected bean.
 o getBeans
 public abstract Vector getBeans()
Returns all BeanReference objects currently in use by the assembly.

Returns:
A Vector containing all the BeanReference objects for the beans currently used in the assembly.
 o showStatus
 public abstract void showStatus(String message)
Displays the message specified by message in the assembly's status line display as an information message. This method can be called by a subassembly or subassembly view to display an informational message to the user.

Parameters:
message - The informational message to be displayed.
 o showWarning
 public abstract void showWarning(String message)
Displays the message specified by message in the assembly's status line display as a warning message. This method can be called by a subassembly or subassembly view to display a warning message to the user.

Parameters:
message - The warning message to be displayed.
 o showError
 public abstract void showError(String message)
Displays the message specified by message in the assembly's status line display as an error message. This method can be called by a subassembly or subassembly view to display an error message to the user.

Parameters:
message - The error message to be displayed.
 o genImports
 public abstract void genImports(String imports)
Adds import statements to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever import statements it needs to the Java source code for the class. The imports argument should specify one or more valid Java import statements; for example: import java.awt.*;\r\n.

Parameters:
imports - The Java language import statements to be added to the source code being generated.
 o genFields
 public abstract void genFields(String fields)
Adds field declarations to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever fields it needs to the Java source code for the class. The fields argument should specify one or more valid Java field declarations (for example, public int foo = 0;\r\n). If any of the fields are for private use of the model, the field name should be prepended with the unique string previously passed to the subassembly generator setPrefix() method.

Parameters:
fields - The Java language field declarations to add to the source code being generated.
 o genFieldNames
 public abstract void genFieldNames(String fieldNames[])
Specifies an array of field names being defined in the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to inform the assembly what public field names are being added by the associated model to the bean being generated. The use of this method allows the assembly to check for duplicate field names across all models generating code for the bean. If more than one model generates public fields with the same name, the assembly will generate an error and inform the user what models and field names are in conflict.

Parameters:
fieldNames - The array of public Java field names being added to the source code.
 o genInit
 public abstract void genInit(String init)
Adds one or more statements to the bean initialization section of the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever code it needs to the initialization section of the class. The init argument should specify one or more valid Java statements (for example, foo = 0;\r\n). Only initialization logic should be specified. Any code needed to start execution of the bean should be added using the genStart() method. The initialization code is called whenever the object is instantiated from its serialized form and is invoked just after the contents of the object are restored from the serialized stream.

Parameters:
init - The Java language statements to add to the bean initialization section of the source code being generated.
 o genUnInit
 public abstract void genUnInit(String unInit)
Adds one or more statements to the bean serialization section of the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever code it needs to the serialization section of the class. The unInit argument should specify one or more valid Java statements (for example, foo = 0;\r\n). The serialization code is called whenever the generated bean is serialized and is invoked just prior to the contents of the bean being written to the serialized stream.

Parameters:
unInit - The Java language statements to add to the bean serialization section of the source code being generated.
 o genStart
 public abstract void genStart(String start)
Adds one or more statements to the start execution section of the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever code it needs to the start method for the class. The start argument should specify one or more valid Java statements (for example, foo = 0;\r\n). The start() method will normally be used only by beans which are executable as applets.

Parameters:
start - The Java language statements to add to the bean start execution section of the source code being generated.
 o genStop
 public abstract void genStop(String stop)
Adds one or more statements to the stop execution section of the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever code it needs to the stop method for the class. The stop argument should specify one or more valid Java statements (for example, foo = 0;\r\n). The stop() method will normally be used only by beans which are executable as applets.

Parameters:
stop - The Java language statements to add to the bean stop execution section of the source code being generated.
 o genMethods
 public abstract void genMethods(String methods)
Adds methods to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever methods it needs to the definition of the class. The methods argument should contain one or more valid Java methods (for example, public void setColor( Color color ) { myColor = color; }\r\n). If any of the methods are for private use of the model, the method name should be prepended with the unique string previously passed to the subassembly generator setPrefix() method.

Parameters:
methods - The Java language methods to add to the source code being generated.
 o genMethodNames
 public abstract void genMethodNames(String methodNames[])
Specifies an array of method names being defined in the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to inform the assembly about the signatures of the public methods being added by the associated model to the bean. This allows the assembly to check for duplicate method signatures across all models generating code for the bean.

If more than one model generates public methods with the same signature, the assembly will generate an error and inform the user what models and method signatures are in conflict.

Note that the method signatures specified must be a slight variation of the standard Java String representation of type and method signatures. In particular, the method name should be concatenated with the method signature and no method return type should be specified. For example, the method:

long foo( int n, String s, int [] arr );
should be specified as:
foo(ILjava/lang/String;[I)
.

A more complete specification of the standard Java type signatures can be found in JNI Types and Data Structures.

Parameters:
methodNames - The array of public Java method signatures being added to the source code.
 o genInnerClasses
 public abstract void genInnerClasses(String classes)
Adds one or more innner classes to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever inner classes it needs to the definition of the class. The classes argument should specify one or more valid Java inner class definitions (for example, private class foo { ... } ). All class names generated should be prepended with the unique string previously passed to the subassembly generator setPrefix() method.

Parameters:
classes - The array of Java inner classes to add to the source code being generated.
 o genPrivateClasses
 public abstract void genPrivateClasses(String classes)
Adds one or more private class definition to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever private classes it needs to the definition of the class. The classes argument should specify one or more valid Java class definitions (for example, private class foo { ... } ). All class names generated should be prepended with the unique string previously passed to the subassembly generator setPrefix() method.

Parameters:
classes - The private Java classes to add to the source code being generated.
 o genPublicClass
 public abstract void genPublicClass(String className,
                                     String classDefinition)
Adds a public class definition to the source code. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add a public class to the assembled bean's definition.

The className argument should specify the name of the public class defined by the classDefinition argument. If the class is not part of the same package as the bean, the class name may be fully qualified (for example, java.util.BeanEvent); otherewise, the class is assumed to be in the same package as the bean being assembled.

The classDefinition argument should specify a valid Java class definition.

Parameters:
className - The name of the public Java class to add to the bean being generated.
classDefinition - The source code definition of the public Java class to add to the bean being generated.
 o genPublicClass
 public abstract void genPublicClass(String className,
                                     byte classDefinition[])
Adds a compiled class definition to the generated bean. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add a compiled class it has generated to the assembled bean's definition.

The className argument should specify the name of the class contained in the byte array specified by the classDefinition argument. If the class is not part of the same package as the bean, the class name may be fully qualified (for example, java.util.BeanEvent); otherewise, the class is assumed to be in the same package as the bean being assembled.

The classDefinition argument should contain a valid compiled class definition.

Parameters:
className - The name of the public Java class to add to the bean being generated.
classDefinition - A byte array containing the valid compiled class definition to add to the bean being generated.
 o genManifest
 public abstract void genManifest(String manifest)
Adds information to the bean manifest. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add whatever information it needs to the manifest for the new bean. The manifest argument should specify one or more valid Java manifest entries.

Parameters:
manifest - The statements to add to the manifest for the bean being generated.
 o genMethodBeanInfo
 public abstract void genMethodBeanInfo(String methodBeanInfo)
Adds the code to create one or more MethodDescriptor objects. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add the code needed to create the MethodDescriptor objects for the BeanInfo class of the assembled bean.

The model should add code to create a MethodDescriptor object for each public method it defines that is to be part of the information returned by the getMethodDescriptors() method of this BeanInfo class.

The methodBeanInfo argument should contain code to create one or more valid MethodDescriptor objects and add them to a Vector called beanInfo.

Parameters:
methodBeanInfo - The code used to create one or more MethodDescriptor objects returned by the getMethodDescriptors() method of this BeanInfo class.
 o genPropertyBeanInfo
 public abstract void genPropertyBeanInfo(String propertyBeanInfo)
Adds the code to create one or more PropertyDescriptor objects. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add the code needed to create the PropertyDescriptor objects for the BeanInfo class of the assembled bean.

The model should add code to create a PropertyDescriptor object for each public property it defines that is to be part of the information returned by the getPropertyDescriptors() method of this BeanInfo class.

The propertyBeanInfo argument should contain code to create one or more valid PropertyDescriptor objects and add them to a Vector called beanInfo. If a particular PropertyDescriptor object is to be marked as the default property, the code should contain the statement setDefaultPropertyIndex(); immediately following the statement which adds the default PropertyDescriptor object to the beanInfo Vector.

Parameters:
propertyBeanInfo - The code used to create one or more PropertyDescriptor objects returned by the getPropertyDescriptors() method of this BeanInfo class.
 o genEventSetBeanInfo
 public abstract void genEventSetBeanInfo(String eventSetBeanInfo)
Adds the code to create one or more EventDescriptor objects. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add the code needed to create the EventSetDescriptor objects for the BeanInfo class of the assembled bean.

The model should add code to create an EventSetDescriptor object for each set of events it fires that is to be part of the information returned by the getEventSetDescriptors() method of this BeanInfo class.

The eventSetBeanInfo argument should contain code to create one or more valid EventSetDescriptor objects and add them to a Vector called beanInfo. If a particular EventSetDescriptor object is to be marked as the default event, the code should contain the statement setDefaultEventIndex(); immediately following the statement which adds the default EventSetDescriptor object to the beanInfo Vector.

Parameters:
eventSetBeanInfo - The code used to create one or more EventSetDescriptor objects returned by the getEventSetDescriptors() method of this BeanInfo class.
 o genCustomizerBeanInfo
 public abstract void genCustomizerBeanInfo(String customizerBeanInfo)
Adds the code to specify one or more customizer classes. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to add the code necessary to define the customizer class returned by the getCustomizerClass() method of the BeanDescriptor object returned by the getBeanDescriptor() method of the BeanInfo class of the assembled bean.

The customizerBeanInfo argument should contain code to identify one or more valid customizer Class objects by adding them to a Vector called beanInfo.

Note that if more than one customizer class is defined, the assembly will generate code to merge the collection of customizers into a single, new customizer class.

Parameters:
customizerBeanInfo - The code used to define one or more customizer Class objects for the assembled bean.
 o genIconBeanInfo
 public abstract void genIconBeanInfo(String iconBeanInfo)
Defines the code for the BeanInfo getIcon() method along with its associated set of image files. This method is called by a subassembly generator during the code generation phase for the bean being assembled to allow the model to define the Image object returned by the getIcon() method of the BeanInfo class of the assembled bean.

The iconBeanInfo argument should contain the code to be used as the entire method body for the getIcon() method of the BeanInfo class of this assembled bean. It is an error for this method to be invoked more than once with an argument which is not null or an empty String.

The iconFileNames argument should contain the names of the files containing the icons to include in the generated bean's repository object. If the icons are not to be stored with the generated bean, this argument may be null or an empty array.

Parameters:
iconBeanInfo - The code to use as the method body for the getIcon() method of the BeanInfo class of the assembled bean.
iconFileNames - The names of the files containing the icons to be included in the repository object of the generated bean.
 o genIconBeanInfo
 public abstract void genIconBeanInfo(String iconBeanInfo,
                                      String iconFileNames[])
 o getPackageName
 public abstract String getPackageName()
Returns the package name of the bean being created.

Returns:
The package name of the bean being generated.
 o getClassName
 public abstract String getClassName()
Returns the class name of the bean being created.

Returns:
The class name of the bean being generated.
 o getPathName
 public abstract String getPathName()
Returns the path name being used as the root for all files generated as part of this bean (for example, C:\tempBeans\).

Returns:
The path name of the directory used as the root for all files generated as part of the bean being created.
 o getPackagePathName
 public abstract String getPackagePathName()
Returns the complete path name obtained by combining the getPathName() method result with the getPackageName() method result. So, for example, if the getPathName() method result is C:\tempBeans\ and the getPackageName() method result is com.ibm.sample.beans, the result returned is: C:\tempBeans\com\ibm\sample\beans\.

Returns:
The path name to use for any files in the same package as the bean being created.
 o getRepositoryName
 public abstract String getRepositoryName()
Returns the name of the repository the bean is to be stored in.

Returns:
The name of the repository the bean is to be stored in.
 o getParentClass
 public abstract Class getParentClass()
Returns the class the generated bean is derived from.

Returns:
The class the generated bean is derived from.
 o setParentClass
 public abstract void setParentClass(Class parentClass)
Sets the class the generated bean is derived from.

Parameters:
parentClass - The class the generated bean is derived from.
 o addPropertyChangeListener
 public abstract void addPropertyChangeListener(PropertyChangeListener pcl)
Add a listener to the assembly. This method provides a way to listen for event changes made to the assembly properties. The properties supporting the listener interface are packageName, className, repositoryName, and parentClass.

Parameters:
pcl - The listener to add to the assembly.
 o removePropertyChangeListener
 public abstract void removePropertyChangeListener(PropertyChangeListener pcl)
Removes a listener from the set of listeners associated with the assembly.

Parameters:
pcl - The listener to remove from the assembly.
 o isDebuggable
 public abstract boolean isDebuggable()
 o debuggable
 public abstract void debuggable()

All Packages  Class Hierarchy  This Package  Previous  Next  Index