| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.oxtype.oxtype.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.xtext.oxtype.oxtype.OXImportDeclaration; |
| import org.eclipse.osbp.xtext.oxtype.oxtype.OXtypePackage; |
| |
| import org.eclipse.xtext.xtype.impl.XImportDeclarationImpl; |
| import org.eclipse.xtext.xtype.impl.XImportDeclarationImplCustom; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>OX Import Declaration</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.oxtype.oxtype.impl.OXImportDeclarationImpl#isFqnImport <em>Fqn Import</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.oxtype.oxtype.impl.OXImportDeclarationImpl#getImportedFullyQualifiedName <em>Imported Fully Qualified Name</em>}</li> |
| * </ul> |
| * |
| */ |
| public class OXImportDeclarationImpl extends XImportDeclarationImplCustom implements OXImportDeclaration { |
| /** |
| * The default value of the '{@link #isFqnImport() <em>Fqn Import</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFqnImport() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean FQN_IMPORT_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isFqnImport() <em>Fqn Import</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFqnImport() |
| * @generated |
| * @ordered |
| */ |
| protected boolean fqnImport = FQN_IMPORT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getImportedFullyQualifiedName() <em>Imported Fully Qualified Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImportedFullyQualifiedName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String IMPORTED_FULLY_QUALIFIED_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getImportedFullyQualifiedName() <em>Imported Fully Qualified Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImportedFullyQualifiedName() |
| * @generated |
| * @ordered |
| */ |
| protected String importedFullyQualifiedName = IMPORTED_FULLY_QUALIFIED_NAME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OXImportDeclarationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return OXtypePackage.Literals.OX_IMPORT_DECLARATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isFqnImport() { |
| return fqnImport; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFqnImport(boolean newFqnImport) { |
| boolean oldFqnImport = fqnImport; |
| fqnImport = newFqnImport; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OXtypePackage.OX_IMPORT_DECLARATION__FQN_IMPORT, oldFqnImport, fqnImport)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getImportedFullyQualifiedName() { |
| return importedFullyQualifiedName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setImportedFullyQualifiedName(String newImportedFullyQualifiedName) { |
| String oldImportedFullyQualifiedName = importedFullyQualifiedName; |
| importedFullyQualifiedName = newImportedFullyQualifiedName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OXtypePackage.OX_IMPORT_DECLARATION__IMPORTED_FULLY_QUALIFIED_NAME, oldImportedFullyQualifiedName, importedFullyQualifiedName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case OXtypePackage.OX_IMPORT_DECLARATION__FQN_IMPORT: |
| return isFqnImport(); |
| case OXtypePackage.OX_IMPORT_DECLARATION__IMPORTED_FULLY_QUALIFIED_NAME: |
| return getImportedFullyQualifiedName(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case OXtypePackage.OX_IMPORT_DECLARATION__FQN_IMPORT: |
| setFqnImport((Boolean)newValue); |
| return; |
| case OXtypePackage.OX_IMPORT_DECLARATION__IMPORTED_FULLY_QUALIFIED_NAME: |
| setImportedFullyQualifiedName((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case OXtypePackage.OX_IMPORT_DECLARATION__FQN_IMPORT: |
| setFqnImport(FQN_IMPORT_EDEFAULT); |
| return; |
| case OXtypePackage.OX_IMPORT_DECLARATION__IMPORTED_FULLY_QUALIFIED_NAME: |
| setImportedFullyQualifiedName(IMPORTED_FULLY_QUALIFIED_NAME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case OXtypePackage.OX_IMPORT_DECLARATION__FQN_IMPORT: |
| return fqnImport != FQN_IMPORT_EDEFAULT; |
| case OXtypePackage.OX_IMPORT_DECLARATION__IMPORTED_FULLY_QUALIFIED_NAME: |
| return IMPORTED_FULLY_QUALIFIED_NAME_EDEFAULT == null ? importedFullyQualifiedName != null : !IMPORTED_FULLY_QUALIFIED_NAME_EDEFAULT.equals(importedFullyQualifiedName); |
| } |
| 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(" (fqnImport: "); |
| result.append(fqnImport); |
| result.append(", importedFullyQualifiedName: "); |
| result.append(importedFullyQualifiedName); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //OXImportDeclarationImpl |