/******************************************************************************* * Copyright (c) 2008 xored software, Inc. * * 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: * xored software, Inc. - initial API and Implementation (Andrei Sobolev) *******************************************************************************/ package org.eclipse.dltk.tcl.ast.impl; import org.eclipse.dltk.tcl.ast.AstPackage; import org.eclipse.dltk.tcl.ast.StringArgument; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>String Argument</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.dltk.tcl.ast.impl.StringArgumentImpl#getValue <em>Value</em>}</li> * <li>{@link org.eclipse.dltk.tcl.ast.impl.StringArgumentImpl#getRawValue <em>Raw Value</em>}</li> * </ul> * </p> * * @generated */ public class StringArgumentImpl extends TclArgumentImpl implements StringArgument { /** * The default value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected static final String VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected String value = VALUE_EDEFAULT; /** * The default value of the '{@link #getRawValue() <em>Raw Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRawValue() * @generated * @ordered */ protected static final String RAW_VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getRawValue() <em>Raw Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRawValue() * @generated * @ordered */ protected String rawValue = RAW_VALUE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected StringArgumentImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return AstPackage.Literals.STRING_ARGUMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(String newValue) { String oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.STRING_ARGUMENT__VALUE, oldValue, value)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getRawValue() { return rawValue; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRawValue(String newRawValue) { String oldRawValue = rawValue; rawValue = newRawValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AstPackage.STRING_ARGUMENT__RAW_VALUE, oldRawValue, rawValue)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AstPackage.STRING_ARGUMENT__VALUE: return getValue(); case AstPackage.STRING_ARGUMENT__RAW_VALUE: return getRawValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.STRING_ARGUMENT__VALUE: setValue((String) newValue); return; case AstPackage.STRING_ARGUMENT__RAW_VALUE: setRawValue((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case AstPackage.STRING_ARGUMENT__VALUE: setValue(VALUE_EDEFAULT); return; case AstPackage.STRING_ARGUMENT__RAW_VALUE: setRawValue(RAW_VALUE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.STRING_ARGUMENT__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT .equals(value); case AstPackage.STRING_ARGUMENT__RAW_VALUE: return RAW_VALUE_EDEFAULT == null ? rawValue != null : !RAW_VALUE_EDEFAULT.equals(rawValue); } 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(" (value: "); //$NON-NLS-1$ result.append(value); result.append(", rawValue: "); //$NON-NLS-1$ result.append(rawValue); result.append(')'); return result.toString(); } } //StringArgumentImpl