org.eclipse.uml2.uml.internal.operations.ProfileApplicationOperations Maven / Gradle / Ivy
/*
* Copyright (c) 2005, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - initial API and implementation
* Kenn Hussey - 323181
*
* $Id: ProfileApplicationOperations.java,v 1.9 2010/09/28 21:02:15 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.operations;
import org.eclipse.emf.ecore.ENamedElement;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.ProfileApplication;
/**
*
* A static utility class that provides operations related to 'Profile Application' model objects.
*
*
*
* The following operations are supported:
*
* - {@link org.eclipse.uml2.uml.ProfileApplication#getAppliedDefinition() Get Applied Definition}
* - {@link org.eclipse.uml2.uml.ProfileApplication#getAppliedDefinition(org.eclipse.uml2.uml.NamedElement) Get Applied Definition}
*
*
*
* @generated
*/
public class ProfileApplicationOperations
extends ElementOperations {
/**
*
*
* @generated
*/
protected ProfileApplicationOperations() {
super();
}
/**
*
*
*
* Retrieves the definition (Ecore representation) of the profile associated with this profile application.
* @param profileApplication The receiving 'Profile Application' model object.
*
* @generated NOT
*/
public static EPackage getAppliedDefinition(
ProfileApplication profileApplication) {
EAnnotation eAnnotation = profileApplication
.getEAnnotation(UML2_UML_PACKAGE_2_0_NS_URI);
if (eAnnotation != null) {
EList references = eAnnotation.getReferences();
if (references.size() > 0) {
return (EPackage) references.get(0);
}
}
return null;
}
/**
*
*
*
* Retrieves the definition (Ecore representation) of the specified named element in the profile associated with this profile application.
* @param profileApplication The receiving 'Profile Application' model object.
* @param namedElement The named element for which to retrieve the applied definition.
*
* @generated NOT
*/
public static ENamedElement getAppliedDefinition(
ProfileApplication profileApplication, NamedElement namedElement) {
return ProfileOperations.getDefinition(
profileApplication.getAppliedProfile(), namedElement,
profileApplication.getAppliedDefinition());
}
} // ProfileApplicationOperations