blob: ac3503de59c1ed7ca4c064f38852e6313ac1c5c2 [file] [log] [blame]
/**
* Copyright (c) 2013 itemis AG and others.
* 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:
* Mark Broerkens - initial API and implementation
*
*/
package org.eclipse.rmf.reqif10.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.rmf.reqif10.AttributeDefinitionString;
import org.eclipse.rmf.reqif10.AttributeValueString;
import org.eclipse.rmf.reqif10.ReqIF10Package;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Attribute Value String</b></em>'. <!--
* end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rmf.reqif10.impl.AttributeValueStringImpl#getTheValue <em>The Value</em>}</li>
* <li>{@link org.eclipse.rmf.reqif10.impl.AttributeValueStringImpl#getDefinition <em>Definition</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class AttributeValueStringImpl extends AttributeValueSimpleImpl implements AttributeValueString {
/**
* The default value of the '{@link #getTheValue() <em>The Value</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getTheValue()
* @generated
* @ordered
*/
protected static final String THE_VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getTheValue() <em>The Value</em>}' attribute. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getTheValue()
* @generated
* @ordered
*/
protected String theValue = THE_VALUE_EDEFAULT;
/**
* This is true if the The Value attribute has been set. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
protected boolean theValueESet;
/**
* The cached value of the '{@link #getDefinition() <em>Definition</em>}' reference. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
* @see #getDefinition()
* @generated
* @ordered
*/
protected AttributeDefinitionString definition;
/**
* This is true if the Definition reference has been set. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
protected boolean definitionESet;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected AttributeValueStringImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReqIF10Package.Literals.ATTRIBUTE_VALUE_STRING;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getTheValue() {
return theValue;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setTheValue(String newTheValue) {
String oldTheValue = theValue;
theValue = newTheValue;
boolean oldTheValueESet = theValueESet;
theValueESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE, oldTheValue, theValue,
!oldTheValueESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void unsetTheValue() {
String oldTheValue = theValue;
boolean oldTheValueESet = theValueESet;
theValue = THE_VALUE_EDEFAULT;
theValueESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE, oldTheValue,
THE_VALUE_EDEFAULT, oldTheValueESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean isSetTheValue() {
return theValueESet;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public AttributeDefinitionString getDefinition() {
if (definition != null && definition.eIsProxy()) {
InternalEObject oldDefinition = (InternalEObject) definition;
definition = (AttributeDefinitionString) eResolveProxy(oldDefinition);
if (definition != oldDefinition) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION, oldDefinition,
definition));
}
}
return definition;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public AttributeDefinitionString basicGetDefinition() {
return definition;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setDefinition(AttributeDefinitionString newDefinition) {
AttributeDefinitionString oldDefinition = definition;
definition = newDefinition;
boolean oldDefinitionESet = definitionESet;
definitionESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION, oldDefinition, definition,
!oldDefinitionESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void unsetDefinition() {
AttributeDefinitionString oldDefinition = definition;
boolean oldDefinitionESet = definitionESet;
definition = null;
definitionESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION, oldDefinition, null,
oldDefinitionESet));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public boolean isSetDefinition() {
return definitionESet;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE:
return getTheValue();
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION:
if (resolve)
return getDefinition();
return basicGetDefinition();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE:
setTheValue((String) newValue);
return;
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION:
setDefinition((AttributeDefinitionString) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE:
unsetTheValue();
return;
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION:
unsetDefinition();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__THE_VALUE:
return isSetTheValue();
case ReqIF10Package.ATTRIBUTE_VALUE_STRING__DEFINITION:
return isSetDefinition();
}
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(" (theValue: "); //$NON-NLS-1$
if (theValueESet)
result.append(theValue);
else
result.append("<unset>"); //$NON-NLS-1$
result.append(')');
return result.toString();
}
} // AttributeValueStringImpl