org.eclipse.xtext.impl.TerminalRuleImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: TerminalRuleImpl.java,v 1.1 2010/04/06 14:09:53 sefftinge Exp $
*/
package org.eclipse.xtext.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.xtext.TerminalRule;
import org.eclipse.xtext.XtextPackage;
/**
*
* An implementation of the model object 'Terminal Rule'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.impl.TerminalRuleImpl#isFragment Fragment}
*
*
*
* @generated
*/
public class TerminalRuleImpl extends AbstractRuleImpl implements TerminalRule {
/**
* The default value of the '{@link #isFragment() Fragment}' attribute.
*
*
* @see #isFragment()
* @generated
* @ordered
*/
protected static final boolean FRAGMENT_EDEFAULT = false;
/**
* The cached value of the '{@link #isFragment() Fragment}' attribute.
*
*
* @see #isFragment()
* @generated
* @ordered
*/
protected boolean fragment = FRAGMENT_EDEFAULT;
/**
*
*
* @generated
*/
protected TerminalRuleImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.TERMINAL_RULE;
}
/**
*
*
* @generated
*/
public boolean isFragment() {
return fragment;
}
/**
*
*
* @generated
*/
public void setFragment(boolean newFragment) {
boolean oldFragment = fragment;
fragment = newFragment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.TERMINAL_RULE__FRAGMENT, oldFragment, fragment));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.TERMINAL_RULE__FRAGMENT:
return isFragment();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.TERMINAL_RULE__FRAGMENT:
setFragment((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.TERMINAL_RULE__FRAGMENT:
setFragment(FRAGMENT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.TERMINAL_RULE__FRAGMENT:
return fragment != FRAGMENT_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (fragment: ");
result.append(fragment);
result.append(')');
return result.toString();
}
} //TerminalRuleImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy