All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.mb.MBElementFactory

java.lang.Object
   |
   +----com.ibm.beans.mb.MBElementFactory

public class MBElementFactory
extends Object
This helper class builds MBElements and performs miscellaneous functions pertaining to the building and classification of MBElements.

See Also:
MBElement

Constructor Index

 o MBElementFactory()

Method Index

 o copyMBElement(Class, MBElement, ManagedBean)
Copies the specified MBElement into a new MBElement of the specified type.
 o createCommonMBElement(Class, MBMoniker, byte[], ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.
 o createCommonMBElement(Class, MBMoniker, File, ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.
 o createCommonMBElement(Class, String, byte[], ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement. Deprecated.
 o createCommonMBElement(Class, String, File, ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement. Deprecated.
 o createMBElement(Class, MBMoniker, byte[], ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean.
 o createMBElement(Class, MBMoniker, File, ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean.
 o createMBElement(Class, String, byte[], ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean. Deprecated.
 o createMBElement(Class, String, File, ManagedBean)
Creates an MBElement and adds it to the specified ManagedBean. Deprecated.
 o guessBeanNameFromFiles(Vector)
Guesses the name of a bean.
 o guessBeanNameFromStrings(Vector)
Guesses the name of a bean.
 o guessMBElementSubclass(File)
Guesses, based on the file name, what kind of MBElement subclass is associated with a file of this name.
 o guessMBElementSubclass(String)
Guesses, based on name, what kind of MBElement subclass is associated with a file of this name.
 o passthroughProperties(MBElement, MBManifestSection)
Initializes an MBElement with passthrough properties from a MBManifestSection.
 o quickSortVector(Vector, int, int)
QuickSorts the contents of a Vector of Strings, based on the String values.
 o setBeanName(String)
Sets beanName for use in guessing MBElement subclasses.

Constructors

 o MBElementFactory
 public MBElementFactory()

Methods

 o createMBElement
 public MBElement createMBElement(Class c,
                                  MBMoniker moniker,
                                  File elementFile,
                                  ManagedBean mb) throws InstantiationException, IllegalAccessException, FileNotFoundException, IOException, InstantiationError
Creates an MBElement and adds it to the specified ManagedBean.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
elementFile - The File associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated. This can be null. If not null, and the instantiated MBElement is a MBBeanClass or a MBBeanSer, the moniker of the ManagedBean will be made to match the moniker of the created MBElement.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
Throws: FileNotFoundException
Thrown if the MBElement file cannot be found.
Throws: IOException
Thrown if an IO problem occurs while reading the MBElement file.
See Also:
MBElement
 o createMBElement
 public MBElement createMBElement(Class c,
                                  MBMoniker moniker,
                                  byte b[],
                                  ManagedBean mb) throws InstantiationException, IllegalAccessException, InstantiationError
Creates an MBElement and adds it to the specified ManagedBean.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
b - The ByteArray associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated. This can be null. If not null, and the instantiated MBElement is a MBBeanClass or a MBBeanSer, the moniker of the ManagedBean will be made to match the moniker of the created MBElement.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
See Also:
MBElement
 o createCommonMBElement
 public MBElement createCommonMBElement(Class c,
                                        MBMoniker moniker,
                                        File elementFile,
                                        ManagedBean mb) throws InstantiationException, IllegalAccessException, FileNotFoundException, IOException, InstantiationError
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
elementFile - The File associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated. This can be null, although it doesn't make much sense.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
Throws: FileNotFoundException
Thrown if the MBElement file cannot be found.
Throws: IOException
Thrown if an IO problem occurs while reading the MBElement file.
See Also:
MBElement
 o createCommonMBElement
 public MBElement createCommonMBElement(Class c,
                                        MBMoniker moniker,
                                        byte b[],
                                        ManagedBean mb) throws InstantiationException, IllegalAccessException, InstantiationError
Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
b - The ByteArray associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated. This can be null, although it doesn't make much sense.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
See Also:
MBElement
 o createMBElement
 public MBElement createMBElement(Class c,
                                  String moniker,
                                  File elementFile,
                                  ManagedBean mb) throws InstantiationException, IllegalAccessException, FileNotFoundException, IOException, InstantiationError
Note: createMBElement() is deprecated.

Creates an MBElement and adds it to the specified ManagedBean.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
elementFile - The File associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
Throws: FileNotFoundException
Thrown if the MBElement file cannot be found.
Throws: IOException
Thrown if an IO problem occurs while reading the MBElement file.
See Also:
MBElement
 o createMBElement
 public MBElement createMBElement(Class c,
                                  String moniker,
                                  byte b[],
                                  ManagedBean mb) throws InstantiationException, IllegalAccessException, InstantiationError
Note: createMBElement() is deprecated.

Creates an MBElement and adds it to the specified ManagedBean.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
b - The ByteArray associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
See Also:
MBElement
 o createCommonMBElement
 public MBElement createCommonMBElement(Class c,
                                        String moniker,
                                        File elementFile,
                                        ManagedBean mb) throws InstantiationException, IllegalAccessException, FileNotFoundException, IOException, InstantiationError
Note: createCommonMBElement() is deprecated.

Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
elementFile - The File associated with this BMElement.
mb - The ManagedBean with which this MBElement will be associated.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
Throws: FileNotFoundException
Thrown if the MBElement file cannot be found.
Throws: IOException
Thrown if an IO problem occurs while reading the MBElement file.
See Also:
MBElement
 o createCommonMBElement
 public MBElement createCommonMBElement(Class c,
                                        String moniker,
                                        byte b[],
                                        ManagedBean mb) throws InstantiationException, IllegalAccessException, InstantiationError
Note: createCommonMBElement() is deprecated.

Creates an MBElement and adds it to the specified ManagedBean as a common MBElement.

Parameters:
c - The MBElement subclass to be instantiated.
moniker - The moniker of this new MBElement subclass.
b - The ByteArray associated with this MBElement.
mb - The ManagedBean with which this MBElement will be associated.
Returns:
The instantiated MBElement subclass.
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
See Also:
MBElement
 o copyMBElement
 public MBElement copyMBElement(Class c,
                                MBElement mbe,
                                ManagedBean mb) throws InstantiationException, IllegalAccessException, InstantiationError
Copies the specified MBElement into a new MBElement of the specified type. This new MBElement is affiliated with ManagedBean mb. MBElement properties are not copied.

Parameters:
c - The MBElement subclass to be instantiated.
mbe - The MBElement to be copied.
mb - The ManagedBean with which this MBElement will be affiliated.
Returns:
The instantiated MBElement subclass
Throws: InstantiationException
Thrown if newInstance() fails.
Throws: IllegalAccessException
Thrown if newInstance() fails.
Throws: InstantiationError
Thrown if argument c is not a valid subclass of MBElement.
See Also:
MBElement
 o guessMBElementSubclass
 public Class guessMBElementSubclass(String name)
Guesses, based on name, what kind of MBElement subclass is associated with a file of this name. Information provided by the setBeanName() method is used to assist in the guess.

Parameters:
name - The name that is used to generate the guess.
Returns:
The Class to which this name probably belongs.
 o guessMBElementSubclass
 public Class guessMBElementSubclass(File f)
Guesses, based on the file name, what kind of MBElement subclass is associated with a file of this name. Information provided by the setBeanName() method is used to assist in the guessing.

Parameters:
f - The File that is used to generate the guess.
Returns:
The Class to which this File probably belongs.
 o setBeanName
 public void setBeanName(String beanName)
Sets beanName for use in guessing MBElement subclasses.

Parameters:
beanName - The name to be used when name guesses are made.
 o guessBeanNameFromStrings
 public String guessBeanNameFromStrings(Vector sv)
Guesses the name of a bean.

Parameters:
sv - The Vector of Strings containing the names used to make a guess.
Returns:
The guessed bean name.
 o guessBeanNameFromFiles
 public String guessBeanNameFromFiles(Vector fv)
Guesses the name of a bean.

Parameters:
sv - The Vector of Files containing the names used using to make a guess.
Returns:
The guessed bean name.
 o passthroughProperties
 protected void passthroughProperties(MBElement mbe,
                                      MBManifestSection section)
Initializes an MBElement with passthrough properties from a MBManifestSection.

Parameters:
mbe - MBElement to be initialized.
section - MBManifestSection that provides the properties.
 o quickSortVector
 public void quickSortVector(Vector v,
                             int first,
                             int last)
QuickSorts the contents of a Vector of Strings, based on the String values.

Parameters:
v - The Vector to be sorted.
first - Index of the first element in the Vector to be sorted.
last - Index of the last element in the Vector to be sorted.

All Packages  Class Hierarchy  This Package  Previous  Next  Index