| /** |
| * Copyright (c) 2011, 2016 - Lunifera GmbH (Wien), Loetz GmbH&Co.KG (Heidelberg) |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.dsl.semantic.common.types.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.LModifier; |
| import org.eclipse.osbp.dsl.semantic.common.types.LVisibility; |
| import org.eclipse.osbp.dsl.semantic.common.types.OSBPTypesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>LModifier</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.common.types.impl.LModifierImpl#isFinal <em>Final</em>}</li> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.common.types.impl.LModifierImpl#isStatic <em>Static</em>}</li> |
| * <li>{@link org.eclipse.osbp.dsl.semantic.common.types.impl.LModifierImpl#getVisibility <em>Visibility</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LModifierImpl extends LLazyResolverImpl implements LModifier { |
| /** |
| * The default value of the '{@link #isFinal() <em>Final</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFinal() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean FINAL_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isFinal() <em>Final</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFinal() |
| * @generated |
| * @ordered |
| */ |
| protected boolean final_ = FINAL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isStatic() <em>Static</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStatic() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean STATIC_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isStatic() <em>Static</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStatic() |
| * @generated |
| * @ordered |
| */ |
| protected boolean static_ = STATIC_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getVisibility() <em>Visibility</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVisibility() |
| * @generated |
| * @ordered |
| */ |
| protected static final LVisibility VISIBILITY_EDEFAULT = LVisibility.PACKAGE; |
| |
| /** |
| * The cached value of the '{@link #getVisibility() <em>Visibility</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVisibility() |
| * @generated |
| * @ordered |
| */ |
| protected LVisibility visibility = VISIBILITY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LModifierImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OSBPTypesPackage.Literals.LMODIFIER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isFinal() { |
| return final_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFinal(boolean newFinal) { |
| boolean oldFinal = final_; |
| final_ = newFinal; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPTypesPackage.LMODIFIER__FINAL, oldFinal, final_)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isStatic() { |
| return static_; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStatic(boolean newStatic) { |
| boolean oldStatic = static_; |
| static_ = newStatic; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPTypesPackage.LMODIFIER__STATIC, oldStatic, static_)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LVisibility getVisibility() { |
| return visibility; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setVisibility(LVisibility newVisibility) { |
| LVisibility oldVisibility = visibility; |
| visibility = newVisibility == null ? VISIBILITY_EDEFAULT : newVisibility; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OSBPTypesPackage.LMODIFIER__VISIBILITY, oldVisibility, visibility)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case OSBPTypesPackage.LMODIFIER__FINAL: |
| return isFinal(); |
| case OSBPTypesPackage.LMODIFIER__STATIC: |
| return isStatic(); |
| case OSBPTypesPackage.LMODIFIER__VISIBILITY: |
| return getVisibility(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OSBPTypesPackage.LMODIFIER__FINAL: |
| setFinal((Boolean)newValue); |
| return; |
| case OSBPTypesPackage.LMODIFIER__STATIC: |
| setStatic((Boolean)newValue); |
| return; |
| case OSBPTypesPackage.LMODIFIER__VISIBILITY: |
| setVisibility((LVisibility)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OSBPTypesPackage.LMODIFIER__FINAL: |
| setFinal(FINAL_EDEFAULT); |
| return; |
| case OSBPTypesPackage.LMODIFIER__STATIC: |
| setStatic(STATIC_EDEFAULT); |
| return; |
| case OSBPTypesPackage.LMODIFIER__VISIBILITY: |
| setVisibility(VISIBILITY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OSBPTypesPackage.LMODIFIER__FINAL: |
| return final_ != FINAL_EDEFAULT; |
| case OSBPTypesPackage.LMODIFIER__STATIC: |
| return static_ != STATIC_EDEFAULT; |
| case OSBPTypesPackage.LMODIFIER__VISIBILITY: |
| return visibility != VISIBILITY_EDEFAULT; |
| } |
| 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(" (final: "); |
| result.append(final_); |
| result.append(", static: "); |
| result.append(static_); |
| result.append(", visibility: "); |
| result.append(visibility); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LModifierImpl |