All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jnario.impl.ShouldImpl Maven / Gradle / Ivy

The newest version!
/*******************************************************************************
 * Copyright (c) 2012 BMW Car IT 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
 *******************************************************************************/
/**
 */
package org.jnario.impl;

import static org.jnario.util.Nodes.textForFeature;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.xtext.xbase.XbasePackage;
import org.eclipse.xtext.xbase.impl.XBinaryOperationImplCustom;
import org.jnario.JnarioPackage;
import org.jnario.Should;

/**
 * 
 * An implementation of the model object 'Should'.
 * 
 * 

* The following features are implemented: *

    *
  • {@link org.jnario.impl.ShouldImpl#isNot Not}
  • *
*

* * @generated NOT */ public class ShouldImpl extends XBinaryOperationImplCustom implements Should { /** * The default value of the '{@link #isNot() Not}' attribute. * * * @see #isNot() * @generated * @ordered */ protected static final boolean NOT_EDEFAULT = false; /** * The cached value of the '{@link #isNot() Not}' attribute. * * * @see #isNot() * @generated * @ordered */ protected boolean not = NOT_EDEFAULT; /** * * * @generated */ protected ShouldImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return JnarioPackage.Literals.SHOULD; } private boolean notHasBeenDerived = false; /** * * * @generated NOT */ public boolean isNot() { if(!notHasBeenDerived){ String text = textForFeature(this, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE); not = text.contains(" not "); notHasBeenDerived = true; } return not; } /** * * * @generated */ public void setNot(boolean newNot) { boolean oldNot = not; not = newNot; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, JnarioPackage.SHOULD__NOT, oldNot, not)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case JnarioPackage.SHOULD__NOT: return isNot(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case JnarioPackage.SHOULD__NOT: setNot((Boolean)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case JnarioPackage.SHOULD__NOT: setNot(NOT_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case JnarioPackage.SHOULD__NOT: return not != NOT_EDEFAULT; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (not: "); result.append(not); result.append(')'); return result.toString(); } public String getMethodName() { return null; } } //ShouldImpl




© 2015 - 2025 Weber Informatics LLC | Privacy Policy