org.jupe.uml2model
Class UML2ModelFinder

java.lang.Object
  extended by org.jupe.uml2model.UML2ModelFinder

public class UML2ModelFinder
extends java.lang.Object

Helper class to search elements in the UML2 model by name.

Author:
Michael Pradel

Constructor Summary
UML2ModelFinder(UML2ModelRoot root)
           
 
Method Summary
 org.eclipse.uml2.uml.Class findClass(java.lang.String absoluteName)
          Search in the whole model for a class with the given name.
 org.eclipse.uml2.uml.Classifier findClassifier(java.lang.String absoluteName)
          Search for a classifier (can be class or interface) in the UML2 model.
 org.eclipse.uml2.uml.Interface findInterface(java.lang.String absoluteName)
          Search in the whole model for an interface with the give name.
 org.eclipse.uml2.uml.Package findPackage(java.lang.String absoluteName)
          Searches in the whole model for the package with the given name.
 org.eclipse.uml2.uml.Classifier findPrimitiveType(java.lang.String name)
          Find a primitive type.
 org.eclipse.uml2.uml.Classifier findUnresolvedType(java.lang.String absoluteName)
          Search for an unresolved type (in the hidden package for unresolved types).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UML2ModelFinder

public UML2ModelFinder(UML2ModelRoot root)
Method Detail

findClass

public org.eclipse.uml2.uml.Class findClass(java.lang.String absoluteName)
Search in the whole model for a class with the given name.

Parameters:
absoluteName - absolute name of the class
Returns:
the class or null if not found

findInterface

public org.eclipse.uml2.uml.Interface findInterface(java.lang.String absoluteName)
Search in the whole model for an interface with the give name.

Parameters:
absoluteName - name of the interface
Returns:
the interface or null if not found

findClassifier

public org.eclipse.uml2.uml.Classifier findClassifier(java.lang.String absoluteName)
Search for a classifier (can be class or interface) in the UML2 model. That method won't search for primitives or unresolved types.

Parameters:
absoluteName - The absolute name of the classifier to search.
Returns:
The classifier or null if it could not be found in the UML2 model.

findPackage

public org.eclipse.uml2.uml.Package findPackage(java.lang.String absoluteName)
Searches in the whole model for the package with the given name.

Parameters:
absoluteName - absolute name of the package
Returns:
the package

findPrimitiveType

public org.eclipse.uml2.uml.Classifier findPrimitiveType(java.lang.String name)
Find a primitive type.

Parameters:
name - The name of a primitive type that exists, e.g. "int".
Returns:
The UML2 element of the primitive type, or null if the type doesn't exist in the UML2 model.

findUnresolvedType

public org.eclipse.uml2.uml.Classifier findUnresolvedType(java.lang.String absoluteName)
Search for an unresolved type (in the hidden package for unresolved types).

Parameters:
absoluteName - The absolute (so far as known) name of the unresolved type.
Returns:
The UML2 element of the type.