org.eclipse.bpmn2.impl.OperationImpl Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2010 SAP AG.
* 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:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
*
*/
package org.eclipse.bpmn2.impl;
import com.google.gwt.user.client.rpc.GwtTransient;
import java.util.Collection;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.Message;
import org.eclipse.bpmn2.Operation;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
/**
*
* An implementation of the model object 'Operation'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.OperationImpl#getInMessageRef In Message Ref}
* - {@link org.eclipse.bpmn2.impl.OperationImpl#getOutMessageRef Out Message Ref}
* - {@link org.eclipse.bpmn2.impl.OperationImpl#getErrorRefs Error Refs}
* - {@link org.eclipse.bpmn2.impl.OperationImpl#getName Name}
* - {@link org.eclipse.bpmn2.impl.OperationImpl#getImplementationRef Implementation Ref}
*
*
* @generated
*/
public class OperationImpl extends BaseElementImpl implements Operation {
/**
* The cached value of the '{@link #getInMessageRef() In Message Ref}' reference.
*
*
* @see #getInMessageRef()
* @generated
* @ordered
*/
@GwtTransient
protected Message inMessageRef;
/**
* The cached value of the '{@link #getOutMessageRef() Out Message Ref}' reference.
*
*
* @see #getOutMessageRef()
* @generated
* @ordered
*/
@GwtTransient
protected Message outMessageRef;
/**
* The cached value of the '{@link #getErrorRefs() Error Refs}' reference list.
*
*
* @see #getErrorRefs()
* @generated
* @ordered
*/
@GwtTransient
protected EList errorRefs;
/**
* 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
*/
@GwtTransient
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getImplementationRef() Implementation Ref}' attribute.
*
*
* @see #getImplementationRef()
* @generated
* @ordered
*/
protected static final String IMPLEMENTATION_REF_EDEFAULT = null;
/**
* The cached value of the '{@link #getImplementationRef() Implementation Ref}' attribute.
*
*
* @see #getImplementationRef()
* @generated
* @ordered
*/
@GwtTransient
protected String implementationRef = IMPLEMENTATION_REF_EDEFAULT;
/**
*
*
* @generated
*/
protected OperationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.OPERATION;
}
/**
*
*
* @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.eclipse.bpmn2.Error.class, this,
Bpmn2Package.OPERATION__ERROR_REFS);
}
return errorRefs;
}
/**
*
*
* @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 String getImplementationRef() {
return implementationRef;
}
/**
*
*
* @generated
*/
@Override
public void setImplementationRef(String newImplementationRef) {
String oldImplementationRef = implementationRef;
implementationRef = newImplementationRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.OPERATION__IMPLEMENTATION_REF,
oldImplementationRef, implementationRef));
}
/**
*
*
* @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__NAME:
return getName();
case Bpmn2Package.OPERATION__IMPLEMENTATION_REF:
return getImplementationRef();
}
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 extends org.eclipse.bpmn2.Error>) newValue);
return;
case Bpmn2Package.OPERATION__NAME:
setName((String) newValue);
return;
case Bpmn2Package.OPERATION__IMPLEMENTATION_REF:
setImplementationRef((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__NAME:
setName(NAME_EDEFAULT);
return;
case Bpmn2Package.OPERATION__IMPLEMENTATION_REF:
setImplementationRef(IMPLEMENTATION_REF_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__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case Bpmn2Package.OPERATION__IMPLEMENTATION_REF:
return IMPLEMENTATION_REF_EDEFAULT == null ? implementationRef != null
: !IMPLEMENTATION_REF_EDEFAULT.equals(implementationRef);
}
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(", implementationRef: ");
result.append(implementationRef);
result.append(')');
return result.toString();
}
} //OperationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy