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.VarlinkIdlPackage; 016 017import org.eclipse.emf.common.notify.Notification; 018import org.eclipse.emf.common.notify.NotificationChain; 019 020import org.eclipse.emf.ecore.EClass; 021import org.eclipse.emf.ecore.InternalEObject; 022 023import org.eclipse.emf.ecore.impl.ENotificationImpl; 024 025/** 026 * <!-- begin-user-doc --> 027 * An implementation of the model object '<em><b>Error</b></em>'. 028 * <!-- end-user-doc --> 029 * <p> 030 * The following features are implemented: 031 * </p> 032 * <ul> 033 * <li>{@link de.dentrassi.varlink.idl.varlinkIdl.impl.ErrorImpl#getProperties <em>Properties</em>}</li> 034 * </ul> 035 * 036 * @generated 037 */ 038public class ErrorImpl extends MemberImpl implements de.dentrassi.varlink.idl.varlinkIdl.Error 039{ 040 /** 041 * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference. 042 * <!-- begin-user-doc --> 043 * <!-- end-user-doc --> 044 * @see #getProperties() 045 * @generated 046 * @ordered 047 */ 048 protected de.dentrassi.varlink.idl.varlinkIdl.Object properties; 049 050 /** 051 * <!-- begin-user-doc --> 052 * <!-- end-user-doc --> 053 * @generated 054 */ 055 protected ErrorImpl() 056 { 057 super(); 058 } 059 060 /** 061 * <!-- begin-user-doc --> 062 * <!-- end-user-doc --> 063 * @generated 064 */ 065 @Override 066 protected EClass eStaticClass() 067 { 068 return VarlinkIdlPackage.Literals.ERROR; 069 } 070 071 /** 072 * <!-- begin-user-doc --> 073 * <!-- end-user-doc --> 074 * @generated 075 */ 076 public de.dentrassi.varlink.idl.varlinkIdl.Object getProperties() 077 { 078 return properties; 079 } 080 081 /** 082 * <!-- begin-user-doc --> 083 * <!-- end-user-doc --> 084 * @generated 085 */ 086 public NotificationChain basicSetProperties(de.dentrassi.varlink.idl.varlinkIdl.Object newProperties, NotificationChain msgs) 087 { 088 de.dentrassi.varlink.idl.varlinkIdl.Object oldProperties = properties; 089 properties = newProperties; 090 if (eNotificationRequired()) 091 { 092 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, VarlinkIdlPackage.ERROR__PROPERTIES, oldProperties, newProperties); 093 if (msgs == null) msgs = notification; else msgs.add(notification); 094 } 095 return msgs; 096 } 097 098 /** 099 * <!-- begin-user-doc --> 100 * <!-- end-user-doc --> 101 * @generated 102 */ 103 public void setProperties(de.dentrassi.varlink.idl.varlinkIdl.Object newProperties) 104 { 105 if (newProperties != properties) 106 { 107 NotificationChain msgs = null; 108 if (properties != null) 109 msgs = ((InternalEObject)properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - VarlinkIdlPackage.ERROR__PROPERTIES, null, msgs); 110 if (newProperties != null) 111 msgs = ((InternalEObject)newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - VarlinkIdlPackage.ERROR__PROPERTIES, null, msgs); 112 msgs = basicSetProperties(newProperties, msgs); 113 if (msgs != null) msgs.dispatch(); 114 } 115 else if (eNotificationRequired()) 116 eNotify(new ENotificationImpl(this, Notification.SET, VarlinkIdlPackage.ERROR__PROPERTIES, newProperties, newProperties)); 117 } 118 119 /** 120 * <!-- begin-user-doc --> 121 * <!-- end-user-doc --> 122 * @generated 123 */ 124 @Override 125 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) 126 { 127 switch (featureID) 128 { 129 case VarlinkIdlPackage.ERROR__PROPERTIES: 130 return basicSetProperties(null, msgs); 131 } 132 return super.eInverseRemove(otherEnd, featureID, msgs); 133 } 134 135 /** 136 * <!-- begin-user-doc --> 137 * <!-- end-user-doc --> 138 * @generated 139 */ 140 @Override 141 public Object eGet(int featureID, boolean resolve, boolean coreType) 142 { 143 switch (featureID) 144 { 145 case VarlinkIdlPackage.ERROR__PROPERTIES: 146 return getProperties(); 147 } 148 return super.eGet(featureID, resolve, coreType); 149 } 150 151 /** 152 * <!-- begin-user-doc --> 153 * <!-- end-user-doc --> 154 * @generated 155 */ 156 @Override 157 public void eSet(int featureID, Object newValue) 158 { 159 switch (featureID) 160 { 161 case VarlinkIdlPackage.ERROR__PROPERTIES: 162 setProperties((de.dentrassi.varlink.idl.varlinkIdl.Object)newValue); 163 return; 164 } 165 super.eSet(featureID, newValue); 166 } 167 168 /** 169 * <!-- begin-user-doc --> 170 * <!-- end-user-doc --> 171 * @generated 172 */ 173 @Override 174 public void eUnset(int featureID) 175 { 176 switch (featureID) 177 { 178 case VarlinkIdlPackage.ERROR__PROPERTIES: 179 setProperties((de.dentrassi.varlink.idl.varlinkIdl.Object)null); 180 return; 181 } 182 super.eUnset(featureID); 183 } 184 185 /** 186 * <!-- begin-user-doc --> 187 * <!-- end-user-doc --> 188 * @generated 189 */ 190 @Override 191 public boolean eIsSet(int featureID) 192 { 193 switch (featureID) 194 { 195 case VarlinkIdlPackage.ERROR__PROPERTIES: 196 return properties != null; 197 } 198 return super.eIsSet(featureID); 199 } 200 201} //ErrorImpl