All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.omg.bpmn.bpmn2.impl.OperationImpl Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2012 - 2024 Data In Motion and others.
 * All rights reserved. 
 * 
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *      Mark Hoffmann - initial API and implementation
 */
package org.omg.bpmn.bpmn2.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

import org.omg.bpmn.bpmn2.Bpmn2Package;
import org.omg.bpmn.bpmn2.Message;
import org.omg.bpmn.bpmn2.Operation;

/**
 * 
 * An implementation of the model object 'Operation'.
 * 
 * 

* The following features are implemented: *

*
    *
  • {@link org.omg.bpmn.bpmn2.impl.OperationImpl#getInMessageRef In Message Ref}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.OperationImpl#getOutMessageRef Out Message Ref}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.OperationImpl#getErrorRefs Error Refs}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.OperationImpl#getImplementationRef Implementation Ref}
  • *
  • {@link org.omg.bpmn.bpmn2.impl.OperationImpl#getName Name}
  • *
* * @generated */ public class OperationImpl extends BaseElementImpl implements Operation { /** * The cached value of the '{@link #getInMessageRef() In Message Ref}' reference. * * * @see #getInMessageRef() * @generated * @ordered */ protected Message inMessageRef; /** * The cached value of the '{@link #getOutMessageRef() Out Message Ref}' reference. * * * @see #getOutMessageRef() * @generated * @ordered */ protected Message outMessageRef; /** * The cached value of the '{@link #getErrorRefs() Error Refs}' reference list. * * * @see #getErrorRefs() * @generated * @ordered */ protected EList errorRefs; /** * The cached value of the '{@link #getImplementationRef() Implementation Ref}' reference. * * * @see #getImplementationRef() * @generated * @ordered */ protected EObject implementationRef; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * * * @generated */ protected OperationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Bpmn2Package.eINSTANCE.getOperation(); } /** * * * @generated */ @Override public Message getInMessageRef() { if (inMessageRef != null && inMessageRef.eIsProxy()) { InternalEObject oldInMessageRef = (InternalEObject)inMessageRef; inMessageRef = (Message)eResolveProxy(oldInMessageRef); if (inMessageRef != oldInMessageRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.OPERATION__IN_MESSAGE_REF, oldInMessageRef, inMessageRef)); } } return inMessageRef; } /** * * * @generated */ public Message basicGetInMessageRef() { return inMessageRef; } /** * * * @generated */ @Override public void setInMessageRef(Message newInMessageRef) { Message oldInMessageRef = inMessageRef; inMessageRef = newInMessageRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__IN_MESSAGE_REF, oldInMessageRef, inMessageRef)); } /** * * * @generated */ @Override public Message getOutMessageRef() { if (outMessageRef != null && outMessageRef.eIsProxy()) { InternalEObject oldOutMessageRef = (InternalEObject)outMessageRef; outMessageRef = (Message)eResolveProxy(oldOutMessageRef); if (outMessageRef != oldOutMessageRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.OPERATION__OUT_MESSAGE_REF, oldOutMessageRef, outMessageRef)); } } return outMessageRef; } /** * * * @generated */ public Message basicGetOutMessageRef() { return outMessageRef; } /** * * * @generated */ @Override public void setOutMessageRef(Message newOutMessageRef) { Message oldOutMessageRef = outMessageRef; outMessageRef = newOutMessageRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__OUT_MESSAGE_REF, oldOutMessageRef, outMessageRef)); } /** * * * @generated */ @Override public EList getErrorRefs() { if (errorRefs == null) { errorRefs = new EObjectResolvingEList(org.omg.bpmn.bpmn2.Error.class, this, Bpmn2Package.OPERATION__ERROR_REFS); } return errorRefs; } /** * * * @generated */ @Override public EObject getImplementationRef() { if (implementationRef != null && implementationRef.eIsProxy()) { InternalEObject oldImplementationRef = (InternalEObject)implementationRef; implementationRef = eResolveProxy(oldImplementationRef); if (implementationRef != oldImplementationRef) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.OPERATION__IMPLEMENTATION_REF, oldImplementationRef, implementationRef)); } } return implementationRef; } /** * * * @generated */ public EObject basicGetImplementationRef() { return implementationRef; } /** * * * @generated */ @Override public void setImplementationRef(EObject newImplementationRef) { EObject oldImplementationRef = implementationRef; implementationRef = newImplementationRef; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__IMPLEMENTATION_REF, oldImplementationRef, implementationRef)); } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__NAME, oldName, name)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Bpmn2Package.OPERATION__IN_MESSAGE_REF: if (resolve) return getInMessageRef(); return basicGetInMessageRef(); case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: if (resolve) return getOutMessageRef(); return basicGetOutMessageRef(); case Bpmn2Package.OPERATION__ERROR_REFS: return getErrorRefs(); case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: if (resolve) return getImplementationRef(); return basicGetImplementationRef(); case Bpmn2Package.OPERATION__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Bpmn2Package.OPERATION__IN_MESSAGE_REF: setInMessageRef((Message)newValue); return; case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: setOutMessageRef((Message)newValue); return; case Bpmn2Package.OPERATION__ERROR_REFS: getErrorRefs().clear(); getErrorRefs().addAll((Collection)newValue); return; case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: setImplementationRef((EObject)newValue); return; case Bpmn2Package.OPERATION__NAME: setName((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Bpmn2Package.OPERATION__IN_MESSAGE_REF: setInMessageRef((Message)null); return; case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: setOutMessageRef((Message)null); return; case Bpmn2Package.OPERATION__ERROR_REFS: getErrorRefs().clear(); return; case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: setImplementationRef((EObject)null); return; case Bpmn2Package.OPERATION__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Bpmn2Package.OPERATION__IN_MESSAGE_REF: return inMessageRef != null; case Bpmn2Package.OPERATION__OUT_MESSAGE_REF: return outMessageRef != null; case Bpmn2Package.OPERATION__ERROR_REFS: return errorRefs != null && !errorRefs.isEmpty(); case Bpmn2Package.OPERATION__IMPLEMENTATION_REF: return implementationRef != null; case Bpmn2Package.OPERATION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //OperationImpl




© 2015 - 2024 Weber Informatics LLC | Privacy Policy