All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.tools.dip.MorphClassNameModelManipulator

java.lang.Object
   |
   +----com.ibm.beans.tools.dip.MorphClassNameModelManipulator

public class MorphClassNameModelManipulator
extends Object
implements MorphModelManipulator
The MorphClassNameModelManipulator class gets the information needed from a ClassNameModel so that a MorphController can use it.

See Also:
MorphModelManipulator

Variable Index

 o fMF
The message formatter used by this MorphModelManipulator.
 o fModel
The model that this MorphModelManipulator wraps.

Constructor Index

 o MorphClassNameModelManipulator(ClassNameModel)
Constructs an instance of MorphClassNameModelManipulator.

Method Index

 o checkNonStringError(Object, String)
Checks to make sure a generic object is a String.
 o getClass(Object)
Gets the class associated with an object in the model.
 o getClassName(Object)
Gets the class name associated with an object in the model.
 o getClassName(String)
Gets the class name associated with an object in the model.
 o getModel()
Gets the model associated with this MorphModelManipulator instance.
 o getURLName(String, int)
Gets the URL name associated with a class name for an object in the model.
 o isInstanceOf(Object, Class)
Determines whether an object in the model represents an instance of the specified class.
 o loadModel(MorphViewEvent)
Handles the loading of the model.

Variables

 o fModel
 protected ClassNameModel fModel
The model that this MorphModelManipulator wraps.

 o fMF
 protected MessageFormatter fMF
The message formatter used by this MorphModelManipulator.

Constructors

 o MorphClassNameModelManipulator
 public MorphClassNameModelManipulator(ClassNameModel model)
Constructs an instance of MorphClassNameModelManipulator.

Parameters:
model - The ClassNameModel to use. Must not be null.

Methods

 o getModel
 public Model getModel()
Gets the model associated with this MorphModelManipulator instance.

Returns:
The model associated with this MorphModelManipulator instance.
 o getClassName
 public String getClassName(String str) throws NotAClassObjectException
Gets the class name associated with an object in the model.

Parameters:
str - A String in the model.
Returns:
The class name associated with the str.
Throws: NotAClassObjectException
if the str is not the name of a class object.
 o getClassName
 public String getClassName(Object obj) throws NotAClassObjectException
Gets the class name associated with an object in the model.

Parameters:
obj - An object in the model. Must a String name of a class.
Returns:
The class name associated with the obj (the class that the String names).
Throws: NotAClassObjectException
if the obj is not the name of a class that can be loaded.
 o isInstanceOf
 public boolean isInstanceOf(Object obj,
                             Class cls)
Determines whether an object in the model represents an instance of the specified class.

Parameters:
obj - The object to be examined (the String name of a class).
cls - The class used to check the object.
Returns:
true if obj represents an instance of (i.e., is the name of) cls; false otherwise.
 o getClass
 public Class getClass(Object obj) throws ClassNotFoundException, NotAClassObjectException
Gets the class associated with an object in the model.

Parameters:
obj - An object in the model (the String name of a class).
Returns:
The class associated with the obj (the class named by obj).
Throws: NotAClassObjectException
if the obj is not a class name.
Throws: ClassNotFoundException
if the class object could not be found.
 o getURLName
 public String getURLName(String className,
                          int classIndex) throws NoRepositoryFoundException
Gets the URL name associated with a class name for an object in the model. This implementation always throws a NoRepositoryFoundException because this model does not support associating URLs with model elements.

Parameters:
className - The class name for an object in the model (not used).
classIndex - The index for the class name (not used).
Returns:
The URL string for the className (not used).
Throws: NoRepositoryFoundException
if no URL could be found for className. This implementation always throws this exception.
 o loadModel
 public void loadModel(MorphViewEvent evt)
Handles the loading of the model. The array of class names contained in the specified MorphViewEvent are added to the model.

Parameters:
evt - The MorphViewEvent with the information needed to load the model.
 o checkNonStringError
 protected void checkNonStringError(Object obj,
                                    String methodName)
Checks to make sure a generic object is a String. Since ClassNameModels only hold Strings, it is an error if a non-String object is passed to any MorphClassNameModelManipulator method that expects a model element.

Parameters:
obj - The generic object to be checked.
methodName - The MorphClassNameModelManipulator method name calling this method.

All Packages  Class Hierarchy  This Package  Previous  Next  Index