blob: 84931181feb1a83d729ec3de8ce30c45601355f8 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2015 Xored Software Inc 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:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.ecl.core.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.rcptt.ecl.core.CorePackage;
import org.eclipse.rcptt.ecl.core.LiteralParameter;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Literal Parameter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.core.impl.LiteralParameterImpl#getLiteral <em>Literal</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.core.impl.LiteralParameterImpl#getFormat <em>Format</em>}</li>
* </ul>
*
* @generated
*/
public class LiteralParameterImpl extends ParameterImpl implements LiteralParameter {
/**
* The default value of the '{@link #getLiteral() <em>Literal</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLiteral()
* @generated
* @ordered
*/
protected static final String LITERAL_EDEFAULT = null;
/**
* The cached value of the '{@link #getLiteral() <em>Literal</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLiteral()
* @generated
* @ordered
*/
protected String literal = LITERAL_EDEFAULT;
/**
* The default value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected static final String FORMAT_EDEFAULT = null;
/**
* The cached value of the '{@link #getFormat() <em>Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFormat()
* @generated
* @ordered
*/
protected String format = FORMAT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LiteralParameterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CorePackage.Literals.LITERAL_PARAMETER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLiteral() {
return literal;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLiteral(String newLiteral) {
String oldLiteral = literal;
literal = newLiteral;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.LITERAL_PARAMETER__LITERAL, oldLiteral, literal));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getFormat() {
return format;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFormat(String newFormat) {
String oldFormat = format;
format = newFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.LITERAL_PARAMETER__FORMAT, oldFormat, format));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CorePackage.LITERAL_PARAMETER__LITERAL:
return getLiteral();
case CorePackage.LITERAL_PARAMETER__FORMAT:
return getFormat();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CorePackage.LITERAL_PARAMETER__LITERAL:
setLiteral((String)newValue);
return;
case CorePackage.LITERAL_PARAMETER__FORMAT:
setFormat((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CorePackage.LITERAL_PARAMETER__LITERAL:
setLiteral(LITERAL_EDEFAULT);
return;
case CorePackage.LITERAL_PARAMETER__FORMAT:
setFormat(FORMAT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CorePackage.LITERAL_PARAMETER__LITERAL:
return LITERAL_EDEFAULT == null ? literal != null : !LITERAL_EDEFAULT.equals(literal);
case CorePackage.LITERAL_PARAMETER__FORMAT:
return FORMAT_EDEFAULT == null ? format != null : !FORMAT_EDEFAULT.equals(format);
}
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(" (literal: ");
result.append(literal);
result.append(", format: ");
result.append(format);
result.append(')');
return result.toString();
}
} //LiteralParameterImpl