blob: c6f761ab715835349be8c339124a89241d363f81 [file] [log] [blame]
/**
* <copyright>
* Copyright (c) 2005 IBM Corporation 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:
* IBM Corporation - initial API and implementation
* </copyright>
*
* $Id: AssignImpl.java,v 1.11 2011/03/30 18:54:25 rbrodt Exp $
*/
package org.eclipse.bpel.model.impl;
import java.util.Collection;
import org.eclipse.bpel.model.Assign;
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.Copy;
import org.eclipse.bpel.model.util.BPELConstants;
import org.eclipse.bpel.model.util.BPELUtils;
import org.eclipse.bpel.model.util.ReconciliationHelper;
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.EReference;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Assign</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.bpel.model.impl.AssignImpl#getCopy <em>Copy</em>}</li>
* <li>{@link org.eclipse.bpel.model.impl.AssignImpl#getValidate <em>Validate</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AssignImpl extends ActivityImpl implements Assign {
/**
* The cached value of the '{@link #getCopy() <em>Copy</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCopy()
* @generated
* @ordered
*/
protected EList<Copy> copy;
/**
* The default value of the '{@link #getValidate() <em>Validate</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValidate()
* @generated
* @ordered
*/
protected static final Boolean VALIDATE_EDEFAULT = Boolean.FALSE;
/**
* The cached value of the '{@link #getValidate() <em>Validate</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValidate()
* @generated
* @ordered
*/
protected Boolean validate = VALIDATE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AssignImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BPELPackage.Literals.ASSIGN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Copy> getCopy() {
if (copy == null) {
copy = new EObjectContainmentEList<Copy>(Copy.class, this,
BPELPackage.ASSIGN__COPY);
}
return copy;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Boolean getValidate() {
return validate;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*/
public void setValidate(Boolean newValidate) {
Boolean oldValidate = validate;
if (!isReconciling) {
ReconciliationHelper.replaceAttribute(this,
BPELConstants.AT_VALIDATE,
BPELUtils.boolean2XML(newValidate));
}
validate = newValidate;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
BPELPackage.ASSIGN__VALIDATE, oldValidate, validate));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case BPELPackage.ASSIGN__COPY:
return ((InternalEList<?>) getCopy()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BPELPackage.ASSIGN__COPY:
return getCopy();
case BPELPackage.ASSIGN__VALIDATE:
return getValidate();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BPELPackage.ASSIGN__COPY:
getCopy().clear();
getCopy().addAll((Collection<? extends Copy>) newValue);
return;
case BPELPackage.ASSIGN__VALIDATE:
setValidate((Boolean) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BPELPackage.ASSIGN__COPY:
getCopy().clear();
return;
case BPELPackage.ASSIGN__VALIDATE:
setValidate(VALIDATE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BPELPackage.ASSIGN__COPY:
return copy != null && !copy.isEmpty();
case BPELPackage.ASSIGN__VALIDATE:
return VALIDATE_EDEFAULT == null ? validate != null
: !VALIDATE_EDEFAULT.equals(validate);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (validate: "); //$NON-NLS-1$
result.append(validate);
result.append(')');
return result.toString();
}
@Override
protected void adoptContent(EReference reference, Object object) {
if (object instanceof Copy) {
ReconciliationHelper.adoptChild(this, copy, (Copy) object,
BPELConstants.ND_COPY);
}
super.adoptContent(reference, object);
}
@Override
protected void orphanContent(EReference reference, Object obj) {
if (obj instanceof Copy) {
ReconciliationHelper.orphanChild(this, (Copy) obj);
}
super.orphanContent(reference, obj);
}
} //AssignImpl