org.eclipse.bpmn2.impl.DataObjectImpl 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 org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.DataObject;
import org.eclipse.bpmn2.DataState;
import org.eclipse.bpmn2.ItemAwareElement;
import org.eclipse.bpmn2.ItemDefinition;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'Data Object'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.DataObjectImpl#getDataState Data State}
* - {@link org.eclipse.bpmn2.impl.DataObjectImpl#getItemSubjectRef Item Subject Ref}
* - {@link org.eclipse.bpmn2.impl.DataObjectImpl#isIsCollection Is Collection}
*
*
* @generated
*/
public class DataObjectImpl extends FlowElementImpl implements DataObject {
/**
* The cached value of the '{@link #getDataState() Data State}' containment reference.
*
*
* @see #getDataState()
* @generated
* @ordered
*/
@GwtTransient
protected DataState dataState;
/**
* The cached value of the '{@link #getItemSubjectRef() Item Subject Ref}' reference.
*
*
* @see #getItemSubjectRef()
* @generated
* @ordered
*/
@GwtTransient
protected ItemDefinition itemSubjectRef;
/**
* The default value of the '{@link #isIsCollection() Is Collection}' attribute.
*
*
* @see #isIsCollection()
* @generated
* @ordered
*/
protected static final boolean IS_COLLECTION_EDEFAULT = false;
/**
* The cached value of the '{@link #isIsCollection() Is Collection}' attribute.
*
*
* @see #isIsCollection()
* @generated
* @ordered
*/
@GwtTransient
protected boolean isCollection = IS_COLLECTION_EDEFAULT;
/**
*
*
* @generated
*/
protected DataObjectImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.DATA_OBJECT;
}
/**
*
*
* @generated
*/
@Override
public DataState getDataState() {
return dataState;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDataState(DataState newDataState, NotificationChain msgs) {
DataState oldDataState = dataState;
dataState = newDataState;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
Bpmn2Package.DATA_OBJECT__DATA_STATE, oldDataState, newDataState);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
@Override
public void setDataState(DataState newDataState) {
if (newDataState != dataState) {
NotificationChain msgs = null;
if (dataState != null)
msgs = ((InternalEObject) dataState).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT__DATA_STATE, null, msgs);
if (newDataState != null)
msgs = ((InternalEObject) newDataState).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - Bpmn2Package.DATA_OBJECT__DATA_STATE, null, msgs);
msgs = basicSetDataState(newDataState, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__DATA_STATE, newDataState,
newDataState));
}
/**
*
*
* @generated
*/
@Override
public ItemDefinition getItemSubjectRef() {
if (itemSubjectRef != null && itemSubjectRef.eIsProxy()) {
InternalEObject oldItemSubjectRef = (InternalEObject) itemSubjectRef;
itemSubjectRef = (ItemDefinition) eResolveProxy(oldItemSubjectRef);
if (itemSubjectRef != oldItemSubjectRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF, oldItemSubjectRef, itemSubjectRef));
}
}
return itemSubjectRef;
}
/**
*
*
* @generated
*/
public ItemDefinition basicGetItemSubjectRef() {
return itemSubjectRef;
}
/**
*
*
* @generated
*/
@Override
public void setItemSubjectRef(ItemDefinition newItemSubjectRef) {
ItemDefinition oldItemSubjectRef = itemSubjectRef;
itemSubjectRef = newItemSubjectRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF,
oldItemSubjectRef, itemSubjectRef));
}
/**
*
*
* @generated
*/
@Override
public boolean isIsCollection() {
return isCollection;
}
/**
*
*
* @generated
*/
@Override
public void setIsCollection(boolean newIsCollection) {
boolean oldIsCollection = isCollection;
isCollection = newIsCollection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.DATA_OBJECT__IS_COLLECTION,
oldIsCollection, isCollection));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
return basicSetDataState(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
return getDataState();
case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF:
if (resolve)
return getItemSubjectRef();
return basicGetItemSubjectRef();
case Bpmn2Package.DATA_OBJECT__IS_COLLECTION:
return isIsCollection();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
setDataState((DataState) newValue);
return;
case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF:
setItemSubjectRef((ItemDefinition) newValue);
return;
case Bpmn2Package.DATA_OBJECT__IS_COLLECTION:
setIsCollection((Boolean) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
setDataState((DataState) null);
return;
case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF:
setItemSubjectRef((ItemDefinition) null);
return;
case Bpmn2Package.DATA_OBJECT__IS_COLLECTION:
setIsCollection(IS_COLLECTION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
return dataState != null;
case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF:
return itemSubjectRef != null;
case Bpmn2Package.DATA_OBJECT__IS_COLLECTION:
return isCollection != IS_COLLECTION_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == ItemAwareElement.class) {
switch (derivedFeatureID) {
case Bpmn2Package.DATA_OBJECT__DATA_STATE:
return Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE;
case Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF:
return Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF;
default:
return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == ItemAwareElement.class) {
switch (baseFeatureID) {
case Bpmn2Package.ITEM_AWARE_ELEMENT__DATA_STATE:
return Bpmn2Package.DATA_OBJECT__DATA_STATE;
case Bpmn2Package.ITEM_AWARE_ELEMENT__ITEM_SUBJECT_REF:
return Bpmn2Package.DATA_OBJECT__ITEM_SUBJECT_REF;
default:
return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (isCollection: ");
result.append(isCollection);
result.append(')');
return result.toString();
}
} //DataObjectImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy