| /******************************************************************************* |
| * Copyright (c) 2009, 2015 Xored Software Inc 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: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.tesla.ecl.model.impl; |
| |
| import org.eclipse.rcptt.tesla.ecl.model.GetProperty; |
| import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage; |
| |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.rcptt.ecl.core.impl.CommandImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Get Property</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetPropertyImpl#getObject <em>Object</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetPropertyImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetPropertyImpl#getIndex <em>Index</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.GetPropertyImpl#isRaw <em>Raw</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class GetPropertyImpl extends CommandImpl implements GetProperty { |
| /** |
| * The cached value of the '{@link #getObject() <em>Object</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getObject() |
| * @generated |
| * @ordered |
| */ |
| protected EObject object; |
| |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIndex() <em>Index</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIndex() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer INDEX_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getIndex() <em>Index</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIndex() |
| * @generated |
| * @ordered |
| */ |
| protected Integer index = INDEX_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isRaw() <em>Raw</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isRaw() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean RAW_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isRaw() <em>Raw</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isRaw() |
| * @generated |
| * @ordered |
| */ |
| protected boolean raw = RAW_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected GetPropertyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.GET_PROPERTY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EObject getObject() { |
| if (object != null && object.eIsProxy()) { |
| InternalEObject oldObject = (InternalEObject)object; |
| object = eResolveProxy(oldObject); |
| if (object != oldObject) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, TeslaPackage.GET_PROPERTY__OBJECT, oldObject, object)); |
| } |
| } |
| return object; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EObject basicGetObject() { |
| return object; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setObject(EObject newObject) { |
| EObject oldObject = object; |
| object = newObject; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.GET_PROPERTY__OBJECT, oldObject, object)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.GET_PROPERTY__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getIndex() { |
| return index; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIndex(Integer newIndex) { |
| Integer oldIndex = index; |
| index = newIndex; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.GET_PROPERTY__INDEX, oldIndex, index)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isRaw() { |
| return raw; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRaw(boolean newRaw) { |
| boolean oldRaw = raw; |
| raw = newRaw; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.GET_PROPERTY__RAW, oldRaw, raw)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.GET_PROPERTY__OBJECT: |
| if (resolve) return getObject(); |
| return basicGetObject(); |
| case TeslaPackage.GET_PROPERTY__NAME: |
| return getName(); |
| case TeslaPackage.GET_PROPERTY__INDEX: |
| return getIndex(); |
| case TeslaPackage.GET_PROPERTY__RAW: |
| return isRaw(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TeslaPackage.GET_PROPERTY__OBJECT: |
| setObject((EObject)newValue); |
| return; |
| case TeslaPackage.GET_PROPERTY__NAME: |
| setName((String)newValue); |
| return; |
| case TeslaPackage.GET_PROPERTY__INDEX: |
| setIndex((Integer)newValue); |
| return; |
| case TeslaPackage.GET_PROPERTY__RAW: |
| setRaw((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.GET_PROPERTY__OBJECT: |
| setObject((EObject)null); |
| return; |
| case TeslaPackage.GET_PROPERTY__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case TeslaPackage.GET_PROPERTY__INDEX: |
| setIndex(INDEX_EDEFAULT); |
| return; |
| case TeslaPackage.GET_PROPERTY__RAW: |
| setRaw(RAW_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.GET_PROPERTY__OBJECT: |
| return object != null; |
| case TeslaPackage.GET_PROPERTY__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case TeslaPackage.GET_PROPERTY__INDEX: |
| return INDEX_EDEFAULT == null ? index != null : !INDEX_EDEFAULT.equals(index); |
| case TeslaPackage.GET_PROPERTY__RAW: |
| return raw != RAW_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (name: "); |
| result.append(name); |
| result.append(", index: "); |
| result.append(index); |
| result.append(", raw: "); |
| result.append(raw); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //GetPropertyImpl |