/** | |
* ******************************************************************************* | |
* Copyright (c) 2009 Mia-Software. | |
* 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 | |
* | |
* Contributors: | |
* | |
* Fabien Giquel (Mia-Software) - initial API and implementation | |
* ******************************************************************************* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.java.emf.classic.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.gmt.modisco.java.Comment; | |
import org.eclipse.gmt.modisco.java.emf.classic.JavaPackage; | |
/** | |
* <!-- 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.gmt.modisco.java.emf.classic.impl.CommentImpl#getContent <em>Content</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.java.emf.classic.impl.CommentImpl#isEnclosedByParent <em>Enclosed By Parent</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.java.emf.classic.impl.CommentImpl#isPrefixOfParent <em>Prefix Of Parent</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public abstract class CommentImpl extends ASTNodeImpl implements Comment { | |
/** | |
* The default value of the '{@link #getContent() <em>Content</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getContent() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String CONTENT_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getContent() <em>Content</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getContent() | |
* @generated | |
* @ordered | |
*/ | |
protected String content = CONTENT_EDEFAULT; | |
/** | |
* The default value of the '{@link #isEnclosedByParent() <em>Enclosed By Parent</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isEnclosedByParent() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean ENCLOSED_BY_PARENT_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isEnclosedByParent() <em>Enclosed By Parent</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isEnclosedByParent() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean enclosedByParent = ENCLOSED_BY_PARENT_EDEFAULT; | |
/** | |
* The default value of the '{@link #isPrefixOfParent() <em>Prefix Of Parent</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isPrefixOfParent() | |
* @generated | |
* @ordered | |
*/ | |
protected static final boolean PREFIX_OF_PARENT_EDEFAULT = false; | |
/** | |
* The cached value of the '{@link #isPrefixOfParent() <em>Prefix Of Parent</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #isPrefixOfParent() | |
* @generated | |
* @ordered | |
*/ | |
protected boolean prefixOfParent = PREFIX_OF_PARENT_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected CommentImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return JavaPackage.eINSTANCE.getComment(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getContent() { | |
return content; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setContent(String newContent) { | |
String oldContent = content; | |
content = newContent; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.COMMENT__CONTENT, oldContent, content)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean isEnclosedByParent() { | |
return enclosedByParent; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setEnclosedByParent(boolean newEnclosedByParent) { | |
boolean oldEnclosedByParent = enclosedByParent; | |
enclosedByParent = newEnclosedByParent; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.COMMENT__ENCLOSED_BY_PARENT, oldEnclosedByParent, enclosedByParent)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean isPrefixOfParent() { | |
return prefixOfParent; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setPrefixOfParent(boolean newPrefixOfParent) { | |
boolean oldPrefixOfParent = prefixOfParent; | |
prefixOfParent = newPrefixOfParent; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.COMMENT__PREFIX_OF_PARENT, oldPrefixOfParent, prefixOfParent)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case JavaPackage.COMMENT__CONTENT: | |
return getContent(); | |
case JavaPackage.COMMENT__ENCLOSED_BY_PARENT: | |
return isEnclosedByParent(); | |
case JavaPackage.COMMENT__PREFIX_OF_PARENT: | |
return isPrefixOfParent(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case JavaPackage.COMMENT__CONTENT: | |
setContent((String)newValue); | |
return; | |
case JavaPackage.COMMENT__ENCLOSED_BY_PARENT: | |
setEnclosedByParent((Boolean)newValue); | |
return; | |
case JavaPackage.COMMENT__PREFIX_OF_PARENT: | |
setPrefixOfParent((Boolean)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case JavaPackage.COMMENT__CONTENT: | |
setContent(CONTENT_EDEFAULT); | |
return; | |
case JavaPackage.COMMENT__ENCLOSED_BY_PARENT: | |
setEnclosedByParent(ENCLOSED_BY_PARENT_EDEFAULT); | |
return; | |
case JavaPackage.COMMENT__PREFIX_OF_PARENT: | |
setPrefixOfParent(PREFIX_OF_PARENT_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case JavaPackage.COMMENT__CONTENT: | |
return CONTENT_EDEFAULT == null ? content != null : !CONTENT_EDEFAULT.equals(content); | |
case JavaPackage.COMMENT__ENCLOSED_BY_PARENT: | |
return enclosedByParent != ENCLOSED_BY_PARENT_EDEFAULT; | |
case JavaPackage.COMMENT__PREFIX_OF_PARENT: | |
return prefixOfParent != PREFIX_OF_PARENT_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(" (content: "); //$NON-NLS-1$ | |
result.append(content); | |
result.append(", enclosedByParent: "); //$NON-NLS-1$ | |
result.append(enclosedByParent); | |
result.append(", prefixOfParent: "); //$NON-NLS-1$ | |
result.append(prefixOfParent); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //CommentImpl |