/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
*
* 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:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.RedefinesRule;
import org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.UmlPropertyPackage;
import org.eclipse.uml2.uml.Property;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Redefines Rule</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.uml.textedit.property.xtext.umlProperty.impl.RedefinesRuleImpl#getProperty <em>Property</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RedefinesRuleImpl extends MinimalEObjectImpl.Container implements RedefinesRule
{
/**
* The cached value of the '{@link #getProperty() <em>Property</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperty()
* @generated
* @ordered
*/
protected Property property;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RedefinesRuleImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return UmlPropertyPackage.Literals.REDEFINES_RULE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Property getProperty()
{
if (property != null && property.eIsProxy())
{
InternalEObject oldProperty = (InternalEObject)property;
property = (Property)eResolveProxy(oldProperty);
if (property != oldProperty)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UmlPropertyPackage.REDEFINES_RULE__PROPERTY, oldProperty, property));
}
}
return property;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Property basicGetProperty()
{
return property;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProperty(Property newProperty)
{
Property oldProperty = property;
property = newProperty;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UmlPropertyPackage.REDEFINES_RULE__PROPERTY, oldProperty, property));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case UmlPropertyPackage.REDEFINES_RULE__PROPERTY:
if (resolve) return getProperty();
return basicGetProperty();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case UmlPropertyPackage.REDEFINES_RULE__PROPERTY:
setProperty((Property)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case UmlPropertyPackage.REDEFINES_RULE__PROPERTY:
setProperty((Property)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case UmlPropertyPackage.REDEFINES_RULE__PROPERTY:
return property != null;
}
return super.eIsSet(featureID);
}
} //RedefinesRuleImpl