/**
*/
package at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.CSSRule;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.CssExtDslPackage;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.Definition;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.Doku;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Definition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl.DefinitionImpl#getDoku <em>Doku</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl.DefinitionImpl#getName <em>Name</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl.DefinitionImpl#getRule <em>Rule</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class DefinitionImpl extends MinimalEObjectImpl.Container implements Definition
{
/**
* The cached value of the '{@link #getDoku() <em>Doku</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDoku()
* @generated
* @ordered
*/
protected Doku doku;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getRule() <em>Rule</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRule()
* @generated
* @ordered
*/
protected CSSRule rule;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DefinitionImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return CssExtDslPackage.Literals.DEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Doku getDoku()
{
return doku;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDoku(Doku newDoku, NotificationChain msgs)
{
Doku oldDoku = doku;
doku = newDoku;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssExtDslPackage.DEFINITION__DOKU, oldDoku, newDoku);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDoku(Doku newDoku)
{
if (newDoku != doku)
{
NotificationChain msgs = null;
if (doku != null)
msgs = ((InternalEObject)doku).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.DEFINITION__DOKU, null, msgs);
if (newDoku != null)
msgs = ((InternalEObject)newDoku).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.DEFINITION__DOKU, null, msgs);
msgs = basicSetDoku(newDoku, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CssExtDslPackage.DEFINITION__DOKU, newDoku, newDoku));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CssExtDslPackage.DEFINITION__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CSSRule getRule()
{
return rule;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRule(CSSRule newRule, NotificationChain msgs)
{
CSSRule oldRule = rule;
rule = newRule;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssExtDslPackage.DEFINITION__RULE, oldRule, newRule);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRule(CSSRule newRule)
{
if (newRule != rule)
{
NotificationChain msgs = null;
if (rule != null)
msgs = ((InternalEObject)rule).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.DEFINITION__RULE, null, msgs);
if (newRule != null)
msgs = ((InternalEObject)newRule).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.DEFINITION__RULE, null, msgs);
msgs = basicSetRule(newRule, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CssExtDslPackage.DEFINITION__RULE, newRule, newRule));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case CssExtDslPackage.DEFINITION__DOKU:
return basicSetDoku(null, msgs);
case CssExtDslPackage.DEFINITION__RULE:
return basicSetRule(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case CssExtDslPackage.DEFINITION__DOKU:
return getDoku();
case CssExtDslPackage.DEFINITION__NAME:
return getName();
case CssExtDslPackage.DEFINITION__RULE:
return getRule();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case CssExtDslPackage.DEFINITION__DOKU:
setDoku((Doku)newValue);
return;
case CssExtDslPackage.DEFINITION__NAME:
setName((String)newValue);
return;
case CssExtDslPackage.DEFINITION__RULE:
setRule((CSSRule)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case CssExtDslPackage.DEFINITION__DOKU:
setDoku((Doku)null);
return;
case CssExtDslPackage.DEFINITION__NAME:
setName(NAME_EDEFAULT);
return;
case CssExtDslPackage.DEFINITION__RULE:
setRule((CSSRule)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case CssExtDslPackage.DEFINITION__DOKU:
return doku != null;
case CssExtDslPackage.DEFINITION__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case CssExtDslPackage.DEFINITION__RULE:
return rule != null;
}
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(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //DefinitionImpl