| /******************************************************************************* |
| * Copyright (c) 2006, 2018 IBM Corporation, Zeligsoft Inc., and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * IBM - Initial API and implementation |
| * Zeligsoft - Bug 207365 |
| *******************************************************************************/ |
| package org.eclipse.ocl.expressions.impl; |
| |
| import java.util.Map; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.ocl.expressions.BooleanLiteralExp; |
| import org.eclipse.ocl.expressions.ExpressionsPackage; |
| import org.eclipse.ocl.expressions.operations.BooleanLiteralExpOperations; |
| import org.eclipse.ocl.utilities.Visitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Boolean Literal Exp</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.expressions.impl.BooleanLiteralExpImpl#getBooleanSymbol <em>Boolean Symbol</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BooleanLiteralExpImpl<C> |
| extends PrimitiveLiteralExpImpl<C> |
| implements BooleanLiteralExp<C> { |
| |
| /** |
| * The default value of the '{@link #getBooleanSymbol() <em>Boolean Symbol</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBooleanSymbol() |
| * @generated |
| * @ordered |
| */ |
| protected static final Boolean BOOLEAN_SYMBOL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getBooleanSymbol() <em>Boolean Symbol</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBooleanSymbol() |
| * @generated |
| * @ordered |
| */ |
| protected Boolean booleanSymbol = BOOLEAN_SYMBOL_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BooleanLiteralExpImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ExpressionsPackage.Literals.BOOLEAN_LITERAL_EXP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Boolean getBooleanSymbol() { |
| return booleanSymbol; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBooleanSymbol(Boolean newBooleanSymbol) { |
| Boolean oldBooleanSymbol = booleanSymbol; |
| booleanSymbol = newBooleanSymbol; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| ExpressionsPackage.BOOLEAN_LITERAL_EXP__BOOLEAN_SYMBOL, |
| oldBooleanSymbol, booleanSymbol)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean checkBooleanType(DiagnosticChain diagnostics, |
| Map<Object, Object> context) { |
| return BooleanLiteralExpOperations.checkBooleanType(this, diagnostics, |
| context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ExpressionsPackage.BOOLEAN_LITERAL_EXP__BOOLEAN_SYMBOL : |
| return getBooleanSymbol(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ExpressionsPackage.BOOLEAN_LITERAL_EXP__BOOLEAN_SYMBOL : |
| setBooleanSymbol((Boolean) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ExpressionsPackage.BOOLEAN_LITERAL_EXP__BOOLEAN_SYMBOL : |
| setBooleanSymbol(BOOLEAN_SYMBOL_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ExpressionsPackage.BOOLEAN_LITERAL_EXP__BOOLEAN_SYMBOL : |
| return BOOLEAN_SYMBOL_EDEFAULT == null |
| ? booleanSymbol != null |
| : !BOOLEAN_SYMBOL_EDEFAULT.equals(booleanSymbol); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| @Override |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * @generated NOT |
| */ |
| @Override |
| @SuppressWarnings("unchecked") |
| public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) { |
| return ((Visitor<T, C, ?, ?, ?, ?, ?, ?, ?, ?>) v) |
| .visitBooleanLiteralExp(this); |
| } |
| |
| } //BooleanLiteralExpImpl |