org.eclipse.bpmn2.impl.ResourceRoleImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI
/**
*
*
* 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.Resource;
import org.eclipse.bpmn2.ResourceAssignmentExpression;
import org.eclipse.bpmn2.ResourceParameterBinding;
import org.eclipse.bpmn2.ResourceRole;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Resource Role'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceRef Resource Ref}
* - {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceParameterBindings Resource Parameter Bindings}
* - {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getResourceAssignmentExpression Resource Assignment Expression}
* - {@link org.eclipse.bpmn2.impl.ResourceRoleImpl#getName Name}
*
*
* @generated
*/
public class ResourceRoleImpl extends BaseElementImpl implements ResourceRole {
/**
* The cached value of the '{@link #getResourceRef() Resource Ref}' reference.
*
*
* @see #getResourceRef()
* @generated
* @ordered
*/
@GwtTransient
protected Resource resourceRef;
/**
* The cached value of the '{@link #getResourceParameterBindings() Resource Parameter Bindings}' containment reference list.
*
*
* @see #getResourceParameterBindings()
* @generated
* @ordered
*/
@GwtTransient
protected EList resourceParameterBindings;
/**
* The cached value of the '{@link #getResourceAssignmentExpression() Resource Assignment Expression}' containment reference.
*
*
* @see #getResourceAssignmentExpression()
* @generated
* @ordered
*/
@GwtTransient
protected ResourceAssignmentExpression resourceAssignmentExpression;
/**
* 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;
/**
*
*
* @generated
*/
protected ResourceRoleImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.RESOURCE_ROLE;
}
/**
*
*
* @generated
*/
@Override
public Resource getResourceRef() {
if (resourceRef != null && resourceRef.eIsProxy()) {
InternalEObject oldResourceRef = (InternalEObject) resourceRef;
resourceRef = (Resource) eResolveProxy(oldResourceRef);
if (resourceRef != oldResourceRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF,
oldResourceRef, resourceRef));
}
}
return resourceRef;
}
/**
*
*
* @generated
*/
public Resource basicGetResourceRef() {
return resourceRef;
}
/**
*
*
* @generated
*/
@Override
public void setResourceRef(Resource newResourceRef) {
Resource oldResourceRef = resourceRef;
resourceRef = newResourceRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF,
oldResourceRef, resourceRef));
}
/**
*
*
* @generated
*/
@Override
public EList getResourceParameterBindings() {
if (resourceParameterBindings == null) {
resourceParameterBindings = new EObjectContainmentEList(
ResourceParameterBinding.class, this, Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS);
}
return resourceParameterBindings;
}
/**
*
*
* @generated
*/
@Override
public ResourceAssignmentExpression getResourceAssignmentExpression() {
return resourceAssignmentExpression;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetResourceAssignmentExpression(
ResourceAssignmentExpression newResourceAssignmentExpression, NotificationChain msgs) {
ResourceAssignmentExpression oldResourceAssignmentExpression = resourceAssignmentExpression;
resourceAssignmentExpression = newResourceAssignmentExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, oldResourceAssignmentExpression,
newResourceAssignmentExpression);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setResourceAssignmentExpression(ResourceAssignmentExpression newResourceAssignmentExpression) {
if (newResourceAssignmentExpression != resourceAssignmentExpression) {
NotificationChain msgs = null;
if (resourceAssignmentExpression != null)
msgs = ((InternalEObject) resourceAssignmentExpression).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, null,
msgs);
if (newResourceAssignmentExpression != null)
msgs = ((InternalEObject) newResourceAssignmentExpression).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, null,
msgs);
msgs = basicSetResourceAssignmentExpression(newResourceAssignmentExpression, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION, newResourceAssignmentExpression,
newResourceAssignmentExpression));
}
/**
*
*
* @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.RESOURCE_ROLE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS:
return ((InternalEList>) getResourceParameterBindings()).basicRemove(otherEnd, msgs);
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION:
return basicSetResourceAssignmentExpression(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF:
if (resolve)
return getResourceRef();
return basicGetResourceRef();
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS:
return getResourceParameterBindings();
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION:
return getResourceAssignmentExpression();
case Bpmn2Package.RESOURCE_ROLE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF:
setResourceRef((Resource) newValue);
return;
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS:
getResourceParameterBindings().clear();
getResourceParameterBindings().addAll((Collection extends ResourceParameterBinding>) newValue);
return;
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION:
setResourceAssignmentExpression((ResourceAssignmentExpression) newValue);
return;
case Bpmn2Package.RESOURCE_ROLE__NAME:
setName((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF:
setResourceRef((Resource) null);
return;
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS:
getResourceParameterBindings().clear();
return;
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION:
setResourceAssignmentExpression((ResourceAssignmentExpression) null);
return;
case Bpmn2Package.RESOURCE_ROLE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_REF:
return resourceRef != null;
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_PARAMETER_BINDINGS:
return resourceParameterBindings != null && !resourceParameterBindings.isEmpty();
case Bpmn2Package.RESOURCE_ROLE__RESOURCE_ASSIGNMENT_EXPRESSION:
return resourceAssignmentExpression != null;
case Bpmn2Package.RESOURCE_ROLE__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();
}
} //ResourceRoleImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy