org.eclipse.xtext.impl.RuleCallImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: RuleCallImpl.java,v 1.15 2010/04/06 14:09:55 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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.XtextPackage;
/**
*
* An implementation of the model object 'Rule Call'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.impl.RuleCallImpl#getRule Rule}
*
*
*
* @generated
*/
public class RuleCallImpl extends AbstractElementImpl implements RuleCall {
/**
* The cached value of the '{@link #getRule() Rule}' reference.
*
*
* @see #getRule()
* @generated
* @ordered
*/
protected AbstractRule rule;
/**
*
*
* @generated
*/
protected RuleCallImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.RULE_CALL;
}
/**
*
*
* @generated
*/
public AbstractRule getRule() {
if (rule != null && rule.eIsProxy()) {
InternalEObject oldRule = (InternalEObject)rule;
rule = (AbstractRule)eResolveProxy(oldRule);
if (rule != oldRule) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, XtextPackage.RULE_CALL__RULE, oldRule, rule));
}
}
return rule;
}
/**
*
*
* @generated
*/
public AbstractRule basicGetRule() {
return rule;
}
/**
*
*
* @generated
*/
public void setRule(AbstractRule newRule) {
AbstractRule oldRule = rule;
rule = newRule;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.RULE_CALL__RULE, oldRule, rule));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.RULE_CALL__RULE:
if (resolve) return getRule();
return basicGetRule();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.RULE_CALL__RULE:
setRule((AbstractRule)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.RULE_CALL__RULE:
setRule((AbstractRule)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.RULE_CALL__RULE:
return rule != null;
}
return super.eIsSet(featureID);
}
} //RuleCallImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy