001/** 002 * ****************************************************************************** 003 * Copyright (c) 2018 Red Hat Inc 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * * 009 * Contributors: 010 * Jens Reimann - initial API and implementation 011 * ****************************************************************************** 012 */ 013package de.dentrassi.varlink.idl.varlinkIdl.impl; 014 015import de.dentrassi.varlink.idl.varlinkIdl.TypeAlias; 016import de.dentrassi.varlink.idl.varlinkIdl.TypeAliasDefinition; 017import de.dentrassi.varlink.idl.varlinkIdl.VarlinkIdlPackage; 018 019import org.eclipse.emf.common.notify.Notification; 020import org.eclipse.emf.common.notify.NotificationChain; 021 022import org.eclipse.emf.ecore.EClass; 023import org.eclipse.emf.ecore.InternalEObject; 024 025import org.eclipse.emf.ecore.impl.ENotificationImpl; 026 027/** 028 * <!-- begin-user-doc --> 029 * An implementation of the model object '<em><b>Type Alias</b></em>'. 030 * <!-- end-user-doc --> 031 * <p> 032 * The following features are implemented: 033 * </p> 034 * <ul> 035 * <li>{@link de.dentrassi.varlink.idl.varlinkIdl.impl.TypeAliasImpl#getDefinition <em>Definition</em>}</li> 036 * </ul> 037 * 038 * @generated 039 */ 040public class TypeAliasImpl extends MemberImpl implements TypeAlias 041{ 042 /** 043 * The cached value of the '{@link #getDefinition() <em>Definition</em>}' containment reference. 044 * <!-- begin-user-doc --> 045 * <!-- end-user-doc --> 046 * @see #getDefinition() 047 * @generated 048 * @ordered 049 */ 050 protected TypeAliasDefinition definition; 051 052 /** 053 * <!-- begin-user-doc --> 054 * <!-- end-user-doc --> 055 * @generated 056 */ 057 protected TypeAliasImpl() 058 { 059 super(); 060 } 061 062 /** 063 * <!-- begin-user-doc --> 064 * <!-- end-user-doc --> 065 * @generated 066 */ 067 @Override 068 protected EClass eStaticClass() 069 { 070 return VarlinkIdlPackage.Literals.TYPE_ALIAS; 071 } 072 073 /** 074 * <!-- begin-user-doc --> 075 * <!-- end-user-doc --> 076 * @generated 077 */ 078 public TypeAliasDefinition getDefinition() 079 { 080 return definition; 081 } 082 083 /** 084 * <!-- begin-user-doc --> 085 * <!-- end-user-doc --> 086 * @generated 087 */ 088 public NotificationChain basicSetDefinition(TypeAliasDefinition newDefinition, NotificationChain msgs) 089 { 090 TypeAliasDefinition oldDefinition = definition; 091 definition = newDefinition; 092 if (eNotificationRequired()) 093 { 094 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VarlinkIdlPackage.TYPE_ALIAS__DEFINITION, oldDefinition, newDefinition); 095 if (msgs == null) msgs = notification; else msgs.add(notification); 096 } 097 return msgs; 098 } 099 100 /** 101 * <!-- begin-user-doc --> 102 * <!-- end-user-doc --> 103 * @generated 104 */ 105 public void setDefinition(TypeAliasDefinition newDefinition) 106 { 107 if (newDefinition != definition) 108 { 109 NotificationChain msgs = null; 110 if (definition != null) 111 msgs = ((InternalEObject)definition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VarlinkIdlPackage.TYPE_ALIAS__DEFINITION, null, msgs); 112 if (newDefinition != null) 113 msgs = ((InternalEObject)newDefinition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VarlinkIdlPackage.TYPE_ALIAS__DEFINITION, null, msgs); 114 msgs = basicSetDefinition(newDefinition, msgs); 115 if (msgs != null) msgs.dispatch(); 116 } 117 else if (eNotificationRequired()) 118 eNotify(new ENotificationImpl(this, Notification.SET, VarlinkIdlPackage.TYPE_ALIAS__DEFINITION, newDefinition, newDefinition)); 119 } 120 121 /** 122 * <!-- begin-user-doc --> 123 * <!-- end-user-doc --> 124 * @generated 125 */ 126 @Override 127 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) 128 { 129 switch (featureID) 130 { 131 case VarlinkIdlPackage.TYPE_ALIAS__DEFINITION: 132 return basicSetDefinition(null, msgs); 133 } 134 return super.eInverseRemove(otherEnd, featureID, msgs); 135 } 136 137 /** 138 * <!-- begin-user-doc --> 139 * <!-- end-user-doc --> 140 * @generated 141 */ 142 @Override 143 public Object eGet(int featureID, boolean resolve, boolean coreType) 144 { 145 switch (featureID) 146 { 147 case VarlinkIdlPackage.TYPE_ALIAS__DEFINITION: 148 return getDefinition(); 149 } 150 return super.eGet(featureID, resolve, coreType); 151 } 152 153 /** 154 * <!-- begin-user-doc --> 155 * <!-- end-user-doc --> 156 * @generated 157 */ 158 @Override 159 public void eSet(int featureID, Object newValue) 160 { 161 switch (featureID) 162 { 163 case VarlinkIdlPackage.TYPE_ALIAS__DEFINITION: 164 setDefinition((TypeAliasDefinition)newValue); 165 return; 166 } 167 super.eSet(featureID, newValue); 168 } 169 170 /** 171 * <!-- begin-user-doc --> 172 * <!-- end-user-doc --> 173 * @generated 174 */ 175 @Override 176 public void eUnset(int featureID) 177 { 178 switch (featureID) 179 { 180 case VarlinkIdlPackage.TYPE_ALIAS__DEFINITION: 181 setDefinition((TypeAliasDefinition)null); 182 return; 183 } 184 super.eUnset(featureID); 185 } 186 187 /** 188 * <!-- begin-user-doc --> 189 * <!-- end-user-doc --> 190 * @generated 191 */ 192 @Override 193 public boolean eIsSet(int featureID) 194 { 195 switch (featureID) 196 { 197 case VarlinkIdlPackage.TYPE_ALIAS__DEFINITION: 198 return definition != null; 199 } 200 return super.eIsSet(featureID); 201 } 202 203} //TypeAliasImpl