| /** |
| * Copyright (c) 2014, 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: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datainterchange.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.datainterchange.DataDSLPackage; |
| import org.eclipse.osbp.xtext.datainterchange.DataInterchangeFileXML; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Interchange File XML</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeFileXMLImpl#getEncoding <em>Encoding</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeFileXMLImpl#getLocale <em>Locale</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeFileXMLImpl#getFileURL <em>File URL</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.datainterchange.impl.DataInterchangeFileXMLImpl#isByAttribute <em>By Attribute</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataInterchangeFileXMLImpl extends DataInterchangeLazyResolverImpl implements DataInterchangeFileXML { |
| /** |
| * The default value of the '{@link #getEncoding() <em>Encoding</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEncoding() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ENCODING_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getEncoding() <em>Encoding</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEncoding() |
| * @generated |
| * @ordered |
| */ |
| protected String encoding = ENCODING_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLocale() <em>Locale</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLocale() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LOCALE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLocale() <em>Locale</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLocale() |
| * @generated |
| * @ordered |
| */ |
| protected String locale = LOCALE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getFileURL() <em>File URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFileURL() |
| * @generated |
| * @ordered |
| */ |
| protected static final String FILE_URL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getFileURL() <em>File URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFileURL() |
| * @generated |
| * @ordered |
| */ |
| protected String fileURL = FILE_URL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isByAttribute() <em>By Attribute</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isByAttribute() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean BY_ATTRIBUTE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isByAttribute() <em>By Attribute</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isByAttribute() |
| * @generated |
| * @ordered |
| */ |
| protected boolean byAttribute = BY_ATTRIBUTE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataInterchangeFileXMLImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DataDSLPackage.Literals.DATA_INTERCHANGE_FILE_XML; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getEncoding() { |
| return encoding; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEncoding(String newEncoding) { |
| String oldEncoding = encoding; |
| encoding = newEncoding; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_FILE_XML__ENCODING, oldEncoding, encoding)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLocale() { |
| return locale; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLocale(String newLocale) { |
| String oldLocale = locale; |
| locale = newLocale; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_FILE_XML__LOCALE, oldLocale, locale)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getFileURL() { |
| return fileURL; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFileURL(String newFileURL) { |
| String oldFileURL = fileURL; |
| fileURL = newFileURL; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_FILE_XML__FILE_URL, oldFileURL, fileURL)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isByAttribute() { |
| return byAttribute; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setByAttribute(boolean newByAttribute) { |
| boolean oldByAttribute = byAttribute; |
| byAttribute = newByAttribute; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DataDSLPackage.DATA_INTERCHANGE_FILE_XML__BY_ATTRIBUTE, oldByAttribute, byAttribute)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__ENCODING: |
| return getEncoding(); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__LOCALE: |
| return getLocale(); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__FILE_URL: |
| return getFileURL(); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__BY_ATTRIBUTE: |
| return isByAttribute(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__ENCODING: |
| setEncoding((String)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__LOCALE: |
| setLocale((String)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__FILE_URL: |
| setFileURL((String)newValue); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__BY_ATTRIBUTE: |
| setByAttribute((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__ENCODING: |
| setEncoding(ENCODING_EDEFAULT); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__LOCALE: |
| setLocale(LOCALE_EDEFAULT); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__FILE_URL: |
| setFileURL(FILE_URL_EDEFAULT); |
| return; |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__BY_ATTRIBUTE: |
| setByAttribute(BY_ATTRIBUTE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__ENCODING: |
| return ENCODING_EDEFAULT == null ? encoding != null : !ENCODING_EDEFAULT.equals(encoding); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__LOCALE: |
| return LOCALE_EDEFAULT == null ? locale != null : !LOCALE_EDEFAULT.equals(locale); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__FILE_URL: |
| return FILE_URL_EDEFAULT == null ? fileURL != null : !FILE_URL_EDEFAULT.equals(fileURL); |
| case DataDSLPackage.DATA_INTERCHANGE_FILE_XML__BY_ATTRIBUTE: |
| return byAttribute != BY_ATTRIBUTE_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(" (encoding: "); |
| result.append(encoding); |
| result.append(", locale: "); |
| result.append(locale); |
| result.append(", fileURL: "); |
| result.append(fileURL); |
| result.append(", byAttribute: "); |
| result.append(byAttribute); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DataInterchangeFileXMLImpl |