/******************************************************************************* | |
* Copyright (c) 2010, 2011 David A Carlson 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: | |
* David A Carlson (XMLmodeling.com) - initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.mdht.uml.hl7.rim.operations; | |
import org.eclipse.emf.common.util.EList; | |
import org.eclipse.emf.common.util.Enumerator; | |
import org.eclipse.emf.ecore.EClassifier; | |
import org.eclipse.mdht.uml.hl7.rim.Entity; | |
import org.eclipse.mdht.uml.hl7.rim.Participation; | |
import org.eclipse.mdht.uml.hl7.rim.RIMPackage; | |
import org.eclipse.mdht.uml.hl7.rim.Role; | |
import org.eclipse.mdht.uml.hl7.rim.RoleLink; | |
import org.eclipse.ocl.ParserException; | |
import org.eclipse.ocl.ecore.OCL; | |
import org.eclipse.ocl.expressions.OCLExpression; | |
/** | |
* <!-- begin-user-doc --> | |
* A static utility class that provides operations related to '<em><b>Role</b></em>' model objects. | |
* <!-- end-user-doc --> | |
* | |
* <p> | |
* The following operations are supported: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getClassCode() <em>Get Class Code</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getPlayer() <em>Get Player</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getScoper() <em>Get Scoper</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getParticipations() <em>Get Participations</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getOutboundLinks() <em>Get Outbound Links</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#getInboundLinks() <em>Get Inbound Links</em>}</li> | |
* <li>{@link org.eclipse.mdht.uml.hl7.rim.Role#isClassCodeDefined() <em>Is Class Code Defined</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class RoleOperations extends InfrastructureRootOperations { | |
/** | |
* The cached environment for evaluating OCL expressions. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
* @ordered | |
*/ | |
protected static final ThreadLocal<OCL> EOCL_ENV = new ThreadLocal<OCL>() { | |
@Override | |
public OCL initialValue() { | |
return OCL.newInstance(); | |
} | |
}; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected RoleOperations() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static Enumerator getClassCode(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static Entity getPlayer(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static Entity getScoper(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static EList<Participation> getParticipations(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static EList<RoleLink> getOutboundLinks(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static EList<RoleLink> getInboundLinks(Role role) { | |
// TODO: implement this method | |
// Ensure that you remove @generated or mark it @generated NOT | |
throw new UnsupportedOperationException(); | |
} | |
/** | |
* The cached OCL expression body for the '{@link #isClassCodeDefined(Role) <em>Is Class Code Defined</em>}' operation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isClassCodeDefined(Role) | |
* @generated | |
* @ordered | |
*/ | |
protected static final String IS_CLASS_CODE_DEFINED__EOCL_EXP = "self.isDefined('classCode')"; | |
/** | |
* The cached OCL query for the '{@link #isClassCodeDefined(Role) <em>Is Class Code Defined</em>}' query operation. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isClassCodeDefined(Role) | |
* @generated | |
* @ordered | |
*/ | |
protected static ThreadLocal<OCLExpression<EClassifier>> IS_CLASS_CODE_DEFINED__EOCL_QRY = new ThreadLocal<OCLExpression<EClassifier>>(); | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public static boolean isClassCodeDefined(Role role) { | |
if (IS_CLASS_CODE_DEFINED__EOCL_QRY.get() == null) { | |
synchronized (EOCL_ENV) { | |
OCL.Helper helper = EOCL_ENV.get().createOCLHelper(); | |
helper.setOperationContext( | |
RIMPackage.Literals.ROLE, RIMPackage.Literals.ROLE.getEAllOperations().get(14)); | |
try { | |
IS_CLASS_CODE_DEFINED__EOCL_QRY.set(helper.createQuery(IS_CLASS_CODE_DEFINED__EOCL_EXP)); | |
} catch (ParserException pe) { | |
throw new UnsupportedOperationException(pe.getLocalizedMessage()); | |
} | |
} | |
} | |
OCL.Query query = EOCL_ENV.get().createQuery(IS_CLASS_CODE_DEFINED__EOCL_QRY.get()); | |
return ((Boolean) query.evaluate(role)).booleanValue(); | |
} | |
} // RoleOperations |