blob: fd4a42e9233958c60fe61de4457ad8e1826b5bda [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.reportdsl.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.reportdsl.CurrencyFormat;
import org.eclipse.osbp.xtext.reportdsl.CurrencyFormatCategoryEnum;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Currency Format</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.CurrencyFormatImpl#getReport_category <em>Report category</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CurrencyFormatImpl extends SomeFormatImpl implements CurrencyFormat {
/**
* The default value of the '{@link #getReport_category() <em>Report category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReport_category()
* @generated
* @ordered
*/
protected static final CurrencyFormatCategoryEnum REPORT_CATEGORY_EDEFAULT = CurrencyFormatCategoryEnum.UNFORMATTED;
/**
* The cached value of the '{@link #getReport_category() <em>Report category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReport_category()
* @generated
* @ordered
*/
protected CurrencyFormatCategoryEnum report_category = REPORT_CATEGORY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CurrencyFormatImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.CURRENCY_FORMAT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CurrencyFormatCategoryEnum getReport_category() {
return report_category;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReport_category(CurrencyFormatCategoryEnum newReport_category) {
CurrencyFormatCategoryEnum oldReport_category = report_category;
report_category = newReport_category == null ? REPORT_CATEGORY_EDEFAULT : newReport_category;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.CURRENCY_FORMAT__REPORT_CATEGORY, oldReport_category, report_category));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.CURRENCY_FORMAT__REPORT_CATEGORY:
return getReport_category();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReportDSLPackage.CURRENCY_FORMAT__REPORT_CATEGORY:
setReport_category((CurrencyFormatCategoryEnum)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.CURRENCY_FORMAT__REPORT_CATEGORY:
setReport_category(REPORT_CATEGORY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.CURRENCY_FORMAT__REPORT_CATEGORY:
return report_category != REPORT_CATEGORY_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(" (report_category: ");
result.append(report_category);
result.append(')');
return result.toString();
}
} //CurrencyFormatImpl