blob: 7df69321630b5aba406e822602a6ead4058e3dc2 [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.messagedsl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.xtext.messagedsl.MessageDSLPackage;
import org.eclipse.osbp.xtext.messagedsl.MessageDefaultFormat;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Message Default Format</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.messagedsl.impl.MessageDefaultFormatImpl#getFormat <em>Format</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MessageDefaultFormatImpl extends MinimalEObjectImpl.Container implements MessageDefaultFormat {
/**
* The default value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected static final String FORMAT_EDEFAULT = null;
/**
* The cached value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected String format = FORMAT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MessageDefaultFormatImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MessageDSLPackage.Literals.MESSAGE_DEFAULT_FORMAT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFormat() {
return format;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFormat(String newFormat) {
String oldFormat = format;
format = newFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MessageDSLPackage.MESSAGE_DEFAULT_FORMAT__FORMAT, oldFormat, format));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MessageDSLPackage.MESSAGE_DEFAULT_FORMAT__FORMAT:
return getFormat();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MessageDSLPackage.MESSAGE_DEFAULT_FORMAT__FORMAT:
setFormat((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MessageDSLPackage.MESSAGE_DEFAULT_FORMAT__FORMAT:
setFormat(FORMAT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MessageDSLPackage.MESSAGE_DEFAULT_FORMAT__FORMAT:
return FORMAT_EDEFAULT == null ? format != null : !FORMAT_EDEFAULT.equals(format);
}
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(" (format: ");
result.append(format);
result.append(')');
return result.toString();
}
} //MessageDefaultFormatImpl