/** | |
* <copyright> | |
* Copyright (c) 2009, 2010 Open Canarias, S.L. | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v2.0 | |
* which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v20.html | |
* | |
* Contributors: | |
* Adolfo Sanchez-Barbudo Herrera - Initial API and implementation | |
* | |
* </copyright> | |
*/ | |
package org.eclipse.modisco.omg.gastm.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.modisco.omg.gastm.Comment; | |
import org.eclipse.modisco.omg.gastm.GASTMPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Comment</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.omg.gastm.impl.CommentImpl#getBody <em>Body</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class CommentImpl extends PreprocessorElementImpl implements Comment { | |
/** | |
* The default value of the '{@link #getBody() <em>Body</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getBody() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String BODY_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getBody() <em>Body</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getBody() | |
* @generated | |
* @ordered | |
*/ | |
protected String body = BODY_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected CommentImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return GASTMPackage.eINSTANCE.getComment(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getBody() { | |
return body; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setBody(String newBody) { | |
String oldBody = body; | |
body = newBody; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, GASTMPackage.COMMENT__BODY, oldBody, body)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case GASTMPackage.COMMENT__BODY: | |
return getBody(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case GASTMPackage.COMMENT__BODY: | |
setBody((String)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case GASTMPackage.COMMENT__BODY: | |
setBody(BODY_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case GASTMPackage.COMMENT__BODY: | |
return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body); | |
} | |
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(" (body: "); //$NON-NLS-1$ | |
result.append(body); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //CommentImpl |