org.eclipse.ocl.ecore.internal
Class EcoreForeignMethods

java.lang.Object
  extended by org.eclipse.ocl.ecore.internal.EcoreForeignMethods

public class EcoreForeignMethods
extends java.lang.Object

A collection of Foreign Methods for the UML API.

Author:
Christian W. Damus (cdamus)

Method Summary
static org.eclipse.emf.ecore.EClassifier getEClassifier(org.eclipse.emf.ecore.EPackage pkg, java.lang.String name)
          Foreign method for EPackage.getEClassifier(String) that accounts for possibility of underscore-escaped names.
static org.eclipse.emf.ecore.EPackage getESubpackage(org.eclipse.emf.ecore.EPackage pkg, java.lang.String name)
          Foreign method for EPackage.getESubpackages() that searches by name and accounts for possibility of underscore-escaped names.
static boolean isNamed(java.lang.String name, org.eclipse.emf.ecore.ENamedElement 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.emf.ecore.ENamedElement 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

getEClassifier

public static org.eclipse.emf.ecore.EClassifier getEClassifier(org.eclipse.emf.ecore.EPackage pkg,
                                                               java.lang.String name)
Foreign method for EPackage.getEClassifier(String) that accounts for possibility of underscore-escaped names.

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

getESubpackage

public static org.eclipse.emf.ecore.EPackage getESubpackage(org.eclipse.emf.ecore.EPackage pkg,
                                                            java.lang.String name)
Foreign method for EPackage.getESubpackages() that searches by name and accounts for possibility of underscore-escaped names.

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