blob: d6117aa9df3b0bfaaec316e687702d238a6e703a [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*/
package org.eclipse.osbp.infogrid.model.gridsource.impl;
import java.util.Collection;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourceEQFilter;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourceInput;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Input</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceInputImpl#getInputType <em>Input Type</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceInputImpl#getInputTypeFQN <em>Input Type FQN</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceInputImpl#getFilters <em>Filters</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CxGridSourceInputImpl extends MinimalEObjectImpl.Container implements CxGridSourceInput {
/**
* The cached value of the '{@link #getInputType() <em>Input Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInputType()
* @generated
* @ordered
*/
protected JvmTypeReference inputType;
/**
* The default value of the '{@link #getInputTypeFQN() <em>Input Type FQN</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInputTypeFQN()
* @generated
* @ordered
*/
protected static final String INPUT_TYPE_FQN_EDEFAULT = null;
/**
* The cached value of the '{@link #getInputTypeFQN() <em>Input Type FQN</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInputTypeFQN()
* @generated
* @ordered
*/
protected String inputTypeFQN = INPUT_TYPE_FQN_EDEFAULT;
/**
* The cached value of the '{@link #getFilters() <em>Filters</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFilters()
* @generated
* @ordered
*/
protected EList<CxGridSourceEQFilter> filters;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CxGridSourceInputImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CxGridSourcePackage.Literals.CX_GRID_SOURCE_INPUT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JvmTypeReference getInputType() {
return inputType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInputType(JvmTypeReference newInputType, NotificationChain msgs) {
JvmTypeReference oldInputType = inputType;
inputType = newInputType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE, oldInputType, newInputType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInputType(JvmTypeReference newInputType) {
if (newInputType != inputType) {
NotificationChain msgs = null;
if (inputType != null)
msgs = ((InternalEObject)inputType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE, null, msgs);
if (newInputType != null)
msgs = ((InternalEObject)newInputType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE, null, msgs);
msgs = basicSetInputType(newInputType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE, newInputType, newInputType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getInputTypeFQN() {
return inputTypeFQN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInputTypeFQN(String newInputTypeFQN) {
String oldInputTypeFQN = inputTypeFQN;
inputTypeFQN = newInputTypeFQN;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE_FQN, oldInputTypeFQN, inputTypeFQN));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<CxGridSourceEQFilter> getFilters() {
if (filters == null) {
filters = new EObjectContainmentEList<CxGridSourceEQFilter>(CxGridSourceEQFilter.class, this, CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS);
}
return filters;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE:
return basicSetInputType(null, msgs);
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS:
return ((InternalEList<?>)getFilters()).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 CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE:
return getInputType();
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE_FQN:
return getInputTypeFQN();
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS:
return getFilters();
}
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 CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE:
setInputType((JvmTypeReference)newValue);
return;
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE_FQN:
setInputTypeFQN((String)newValue);
return;
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS:
getFilters().clear();
getFilters().addAll((Collection<? extends CxGridSourceEQFilter>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE:
setInputType((JvmTypeReference)null);
return;
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE_FQN:
setInputTypeFQN(INPUT_TYPE_FQN_EDEFAULT);
return;
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS:
getFilters().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE:
return inputType != null;
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__INPUT_TYPE_FQN:
return INPUT_TYPE_FQN_EDEFAULT == null ? inputTypeFQN != null : !INPUT_TYPE_FQN_EDEFAULT.equals(inputTypeFQN);
case CxGridSourcePackage.CX_GRID_SOURCE_INPUT__FILTERS:
return filters != null && !filters.isEmpty();
}
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(" (inputTypeFQN: ");
result.append(inputTypeFQN);
result.append(')');
return result.toString();
}
} //CxGridSourceInputImpl