org.eclipse.ocl.uml.internal
Class UMLForeignMethods

java.lang.Object
  extended by org.eclipse.ocl.uml.internal.UMLForeignMethods

public class UMLForeignMethods
extends java.lang.Object

A collection of Foreign Methods for the UML API.

Author:
Christian W. Damus (cdamus)

Method Summary
static org.eclipse.emf.common.util.EList<org.eclipse.uml2.uml.Association> getAllAssociations(org.eclipse.uml2.uml.Classifier classifier)
          Foreign method for the missing Classifier::getAllAssociations() method that gets inherited associations as well as those defined by the specified classifier.
static org.eclipse.uml2.uml.NamedElement getMember(org.eclipse.uml2.uml.Namespace ns, java.lang.String name, org.eclipse.emf.ecore.EClass type)
          Foreign method for Namespace.getMember(String, boolean, EClass) that accounts for possibility of underscore-escaped names.
static org.eclipse.uml2.uml.Package getNestedPackage(org.eclipse.uml2.uml.Package pkg, java.lang.String name)
          Foreign method for Package.getNestedPackage(String) that accounts for possibility of underscore-escaped names.
static org.eclipse.uml2.uml.Vertex getSubvertex(org.eclipse.uml2.uml.Region region, java.lang.String name)
          Foreign method for Region.getSubvertex(String) that accounts for possibility of underscore-escaped names.
static boolean isNamed(java.lang.String name, org.eclipse.uml2.uml.NamedElement element)
          Checks whether the specified element has the given name, accounting for possibility of underscore-escaped names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isNamed

public static boolean isNamed(java.lang.String name,
                              org.eclipse.uml2.uml.NamedElement element)
Checks whether the specified element has the given name, accounting for possibility of underscore-escaped names.

Parameters:
name - a possibly underscore-escaped name of an element
element - a named element
Returns:
whether the element has this name

getNestedPackage

public static org.eclipse.uml2.uml.Package getNestedPackage(org.eclipse.uml2.uml.Package pkg,
                                                            java.lang.String name)
Foreign method for Package.getNestedPackage(String) that accounts for possibility of underscore-escaped names.

Parameters:
pkg - a package
name - a possibly underscore-escaped name of a nested package
Returns:
the matching package, or null if none

getMember

public static org.eclipse.uml2.uml.NamedElement getMember(org.eclipse.uml2.uml.Namespace ns,
                                                          java.lang.String name,
                                                          org.eclipse.emf.ecore.EClass type)
Foreign method for Namespace.getMember(String, boolean, EClass) that accounts for possibility of underscore-escaped names.

Parameters:
ns - a namespace
name - a possibly underscore-escaped name of a member
type - the type of member to look for
Returns:
the matching member, or null if none

getSubvertex

public static org.eclipse.uml2.uml.Vertex getSubvertex(org.eclipse.uml2.uml.Region region,
                                                       java.lang.String name)
Foreign method for Region.getSubvertex(String) that accounts for possibility of underscore-escaped names.

Parameters:
region - a region
name - a possibly underscore-escaped name of a vertex
Returns:
the matching vertex, or null if none

getAllAssociations

public static org.eclipse.emf.common.util.EList<org.eclipse.uml2.uml.Association> getAllAssociations(org.eclipse.uml2.uml.Classifier classifier)
Foreign method for the missing Classifier::getAllAssociations() method that gets inherited associations as well as those defined by the specified classifier.

Parameters:
classifier - a classifier
Returns:
all of its associations, including those that it inherits
Since:
1.2