com.objectwave.sourceModel
Class JavaModel

java.lang.Object
  |
  +--com.objectwave.sourceModel.JavaModel

public class JavaModel
extends java.lang.Object

This class can almost be thought of as a GlobalDictionary containing a reference to all know JavaClassDefs. There are many things that you would wish to ask of class, but you need a context of the JavaModel to get the answers. For example, if I wanted to getRelations() from a class, I can only return those related classes which are found in this model. If a class has a relation to class not found in this JavaModel, it won't be part of the getRelations() answer.

Author:
Dave Hoag
See Also:
JavaClassDef, JavaClassInfo

Constructor Summary
JavaModel()
           
 
Method Summary
 void addJavaDef(JavaClassDef def)
          Add a new JavaClassDef to the our JavaModel.
 boolean contains(JavaClassInfo info)
          Doe the 'info' already exist in this model.
 JavaClassInfo findIdentifier(java.lang.String className, JavaClassDef context)
          Try to find a 'JavaClassInfo' for the specified identifier.
 java.util.Vector getAllClassInfo()
          We could probably go stright to the javaInfos hashtable, but that may not be current??? Is this true?
 java.util.Vector getAllRelations()
          Like getRelations except it will return all of the relations found in the current model.
 JavaRelation getBackRelation(JavaClassInfo source, JavaClassInfo type)
           
 java.util.Enumeration getClassNames()
           
 java.util.Vector getDependentClasses(JavaClassInfo info)
          Return a vector containing 'JavaClassInfo's for the classes in this model interacting or relating to this class.
 JavaClassDef getJavaClassDef(java.lang.String className)
          A single java file can have only 1 public class.
 JavaClassInfo getJavaClassInfo(java.lang.String fullName)
           
 java.util.Vector getKnownInterfaces(JavaClassInfo info)
          Return a vector containing 'JavaClassInfo's for the interfaces in this model that are implemented by this class.
 java.util.Vector getRelatedClasses(JavaClassInfo info)
          Return a vector containing 'JavaClassInfo's for the classes in this model relating to the specified argument.
 java.util.Vector getRelations(JavaClassInfo info)
           
 boolean hasImplemented(JavaClassInfo info, java.lang.String interfaceName)
          Should eventually be expanded to check all the known super classes.
 void removeJavaDef(JavaClassDef def)
          Remove the JavaClassDef from the JavaModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaModel

public JavaModel()
Method Detail

addJavaDef

public void addJavaDef(JavaClassDef def)
Add a new JavaClassDef to the our JavaModel.

See Also:
JavaClassDef

contains

public boolean contains(JavaClassInfo info)
Doe the 'info' already exist in this model.


findIdentifier

public JavaClassInfo findIdentifier(java.lang.String className,
                                    JavaClassDef context)
Try to find a 'JavaClassInfo' for the specified identifier. Since we have full name spaces, a context in which to look for this identifier is necessary. This is similar to getJavaClassInfo(String fullName) however the identifier 'className' need not be a fully qualified java class name.

See Also:
getJavaClassInfo(String)

getAllClassInfo

public java.util.Vector getAllClassInfo()
We could probably go stright to the javaInfos hashtable, but that may not be current??? Is this true?


getAllRelations

public java.util.Vector getAllRelations()
Like getRelations except it will return all of the relations found in the current model. A relation is only entered in here once, therefore if object1 relates to object2 and object2 relates to object1 only one JavaRelation will be included in the result set.


getBackRelation

public JavaRelation getBackRelation(JavaClassInfo source,
                                    JavaClassInfo type)
See Also:
JavaClassInfo

getClassNames

public java.util.Enumeration getClassNames()
Returns:
All of the classnames loaded into this model.

getDependentClasses

public java.util.Vector getDependentClasses(JavaClassInfo info)
Return a vector containing 'JavaClassInfo's for the classes in this model interacting or relating to this class.

See Also:
JavaClassInfo

getJavaClassDef

public JavaClassDef getJavaClassDef(java.lang.String className)
A single java file can have only 1 public class. That public class needs to match the file name. Get the the java class def that has the full 'className'.


getJavaClassInfo

public JavaClassInfo getJavaClassInfo(java.lang.String fullName)
Parameters:
fullName - The full class name. This includes package name. This classes full name is 'com.objectwave.sourceModel.JavaModel'
Returns:
JavaClassInfo The class infor with the provided name.
See Also:
JavaClassInfo

getKnownInterfaces

public java.util.Vector getKnownInterfaces(JavaClassInfo info)
Return a vector containing 'JavaClassInfo's for the interfaces in this model that are implemented by this class.

See Also:
JavaClassInfo

getRelatedClasses

public java.util.Vector getRelatedClasses(JavaClassInfo info)
Return a vector containing 'JavaClassInfo's for the classes in this model relating to the specified argument.

See Also:
JavaClassInfo

getRelations

public java.util.Vector getRelations(JavaClassInfo info)

hasImplemented

public boolean hasImplemented(JavaClassInfo info,
                              java.lang.String interfaceName)
Should eventually be expanded to check all the known super classes.

See Also:
JavaClassInfo

removeJavaDef

public void removeJavaDef(JavaClassDef def)
Remove the JavaClassDef from the JavaModel.

See Also:
JavaClassDef