IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.modeler
Class UMLModeler

java.lang.Object
  extended bycom.ibm.xtools.modeler.UMLModeler

public final class UMLModeler
extends Object

A utility class that exposes model and profile lifecycle operations and provides access to the modeling platform.

API clients should not instantiate this class.


Method Summary
static void closeModel(org.eclipse.uml2.Model model)
          Closes the model specified by model
static void closeProfile(org.eclipse.uml2.Profile profile)
          Closes the profile specified by profile
static org.eclipse.uml2.Model createModel(String file)
          Creates a UML model given a file path
static org.eclipse.uml2.Model createModel(org.eclipse.emf.common.util.URI uri)
          Creates a UML model given a URI
static org.eclipse.uml2.Profile createProfile(String file)
          Creates a UML profile given a file path
static org.eclipse.uml2.Profile createProfile(org.eclipse.emf.common.util.URI uri)
          Creates a UML profile given a URI
static EditingDomain getEditingDomain()
          Returns the UMLModeler's EditingDomain.
static IEObjectHelper getEObjectHelper()
          Returns a helper to work with classes implementing EObject
static IOclQueryHelper getOclQueryHelper()
          Returns a helper to perform OCL queries over models
static Collection getOpenedModels()
          Returns all opened UML models.
static IQueryHelper getQueryHelper()
          Returns a helper to perform queries over models
static IUMLDiagramHelper getUMLDiagramHelper()
          Returns a user helper to work with classes implementing View
static IUMLHelper getUMLHelper()
          Returns a helper to work with classes implementing Element
static IUMLUIHelper getUMLUIHelper()
          Returns a user interface helper to work with classes implementing Element
static org.eclipse.uml2.Model openModel(String file)
          Opens the UML model whose filename is described by file.
static org.eclipse.uml2.Model openModel(org.eclipse.emf.common.util.URI uri)
          Opens the UML model whose filename is described by uri.
static org.eclipse.uml2.Profile openProfile(String file)
          Opens the UML profile whose filename is described by file.
static org.eclipse.uml2.Profile openProfile(org.eclipse.emf.common.util.URI uri)
          Opens the UML profile whose URI is described by uri.
static void saveModel(org.eclipse.uml2.Model model)
          Saves the UML model specified by model.
static void saveModelAs(org.eclipse.uml2.Model model, String file)
          Saves the model specified by model to the location specified by file
static void saveModelAs(org.eclipse.uml2.Model model, org.eclipse.emf.common.util.URI uri)
          Saves the model specified by model to the location specified by uri
static void saveProfile(org.eclipse.uml2.Profile profile)
          Saves the UML profile specified by profile.
static void saveProfileAs(org.eclipse.uml2.Profile profile, String file)
          Saves the profile specified by profile to the location specified by file
static void saveProfileAs(org.eclipse.uml2.Profile profile, org.eclipse.emf.common.util.URI uri)
          Saves the profile specified by profile to the location specified by uri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEObjectHelper

public static IEObjectHelper getEObjectHelper()
Returns a helper to work with classes implementing EObject

Returns:
The UMLModeler IEObjectHelper

getUMLHelper

public static IUMLHelper getUMLHelper()
Returns a helper to work with classes implementing Element

Returns:
The UMLModeler IUMLHelper

getUMLUIHelper

public static IUMLUIHelper getUMLUIHelper()
Returns a user interface helper to work with classes implementing Element

Returns:
The UMLModeler IUMLUIHelper

getUMLDiagramHelper

public static IUMLDiagramHelper getUMLDiagramHelper()
Returns a user helper to work with classes implementing View

Returns:
The UMLModeler IUMLDiagramHelper

getQueryHelper

public static IQueryHelper getQueryHelper()
Returns a helper to perform queries over models

Returns:
The UMLModeler IQueryHelper

getOclQueryHelper

public static IOclQueryHelper getOclQueryHelper()
Returns a helper to perform OCL queries over models

Returns:
The UMLModeler IOclQueryHelper

getEditingDomain

public static EditingDomain getEditingDomain()
Returns the UMLModeler's EditingDomain. The latter is used to perform operations on the models managed by the tool. It also provides batched notification support.

Returns:
The UMLModeler EditingDomain

getOpenedModels

public static Collection getOpenedModels()
Returns all opened UML models.

Returns:
The collection of all currently opened UML models

createModel

public static org.eclipse.uml2.Model createModel(String file)
Creates a UML model given a file path

Parameters:
file - The model file to create
Returns:
The created UML model
Throws:
IllegalArgumentException - file is an empty string
NullPointerException - file is null

createModel

public static org.eclipse.uml2.Model createModel(org.eclipse.emf.common.util.URI uri)
Creates a UML model given a URI

Parameters:
uri - The URI of the model to create
Returns:
The created UML model
Throws:
IllegalArgumentException - file is an empty string
NullPointerException - file is null

openModel

public static org.eclipse.uml2.Model openModel(String file)
                                        throws IOException
Opens the UML model whose filename is described by file.

Supported extensions are:

Parameters:
file - The model file to open
Returns:
The opened UML model
Throws:
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model

openModel

public static org.eclipse.uml2.Model openModel(org.eclipse.emf.common.util.URI uri)
                                        throws IOException
Opens the UML model whose filename is described by uri.

Supported extensions are:

Parameters:
uri - The URI of the model to open
Returns:
The opened UML model
Throws:
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Model

saveModel

public static void saveModel(org.eclipse.uml2.Model model)
                      throws IOException
Saves the UML model specified by model.

Parameters:
model - The UML model to save
Throws:
IOException - The location specified by the root path of model cannot be used to save the model
IllegalArgumentException - model has no associated resource (

saveModelAs

public static void saveModelAs(org.eclipse.uml2.Model model,
                               String file)
                        throws IOException
Saves the model specified by model to the location specified by file

Parameters:
model - The UML2 model to save
file - The location to save the UML2 model
Throws:
IOException - The location specified by file cannot be used to save the model
IllegalArgumentException - model has no associated Model ( model.getMode() is null or file is empty

saveModelAs

public static void saveModelAs(org.eclipse.uml2.Model model,
                               org.eclipse.emf.common.util.URI uri)
                        throws IOException
Saves the model specified by model to the location specified by uri

Parameters:
model - The UML2 model to save
uri - The URI location to save the UML2 model
Throws:
IOException - The location specified by uri cannot be used to save the model
IllegalArgumentException - model has no associated Model ( model.getMode() is null or file is empty

closeModel

public static void closeModel(org.eclipse.uml2.Model model)
Closes the model specified by model

Parameters:
model - The UML2 model to close
Throws:
IllegalArgumentException - model has no associated Model ( model.getMode() is null

createProfile

public static org.eclipse.uml2.Profile createProfile(String file)
Creates a UML profile given a file path

Parameters:
file - The profile file to create
Returns:
The created UML Profile
Throws:
IllegalArgumentException - file is an empty string
NullPointerException - file is null

createProfile

public static org.eclipse.uml2.Profile createProfile(org.eclipse.emf.common.util.URI uri)
Creates a UML profile given a URI

Parameters:
uri - The URI of the profile to create
Returns:
The created UML Profile
Throws:
IllegalArgumentException - file is an empty string
NullPointerException - file is null

openProfile

public static org.eclipse.uml2.Profile openProfile(String file)
                                            throws IOException
Opens the UML profile whose filename is described by file.

Supported extensions are:

Parameters:
file - The profile file to open
Returns:
The opened UML profile
Throws:
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Profile

openProfile

public static org.eclipse.uml2.Profile openProfile(org.eclipse.emf.common.util.URI uri)
                                            throws IOException
Opens the UML profile whose URI is described by uri.

Supported extensions are:

Parameters:
uri - The URI of the profile to open
Returns:
The opened UML profile
Throws:
IllegalArgumentException - file is an empty string
IOException - The file specified by file could not be found or the file is corrupted or could not be opened
NullPointerException - file is null
ClassCastException - file does not point to a Profile

saveProfile

public static void saveProfile(org.eclipse.uml2.Profile profile)
                        throws IOException
Saves the UML profile specified by profile.

Parameters:
profile - The UML profile to save
Throws:
IOException - The location specified by the root path of profile cannot be used to save the profile
IllegalArgumentException - profile has no associated resource (

saveProfileAs

public static void saveProfileAs(org.eclipse.uml2.Profile profile,
                                 String file)
                          throws IOException
Saves the profile specified by profile to the location specified by file

Parameters:
profile - The UML2 profile to save
file - The location to save the UML2 profile
Throws:
IOException - The location specified by file cannot be used to save the profile
IllegalArgumentException - profile has no associated Profile ( profile.getMode() is null or file is empty

saveProfileAs

public static void saveProfileAs(org.eclipse.uml2.Profile profile,
                                 org.eclipse.emf.common.util.URI uri)
                          throws IOException
Saves the profile specified by profile to the location specified by uri

Parameters:
profile - The UML2 profile to save
uri - The location to save the UML2 profile
Throws:
IOException - The location specified by file cannot be used to save the profile
IllegalArgumentException - profile has no associated Profile ( profile.getMode() is null or file is empty

closeProfile

public static void closeProfile(org.eclipse.uml2.Profile profile)
Closes the profile specified by profile

Parameters:
profile - The UML2 profile to close
Throws:
IllegalArgumentException - profile has no associated Profile ( profile.getMode() is null

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.