| /******************************************************************************* |
| * Copyright (c) 2010, 2014 E.D.Willink 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: |
| * E.D.Willink - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ocl.pivot.internal; |
| |
| import java.lang.reflect.InvocationTargetException; |
| import java.util.Collection; |
| import java.util.Iterator; |
| import java.util.List; |
| import java.util.Map; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.common.util.BasicDiagnostic; |
| import org.eclipse.emf.common.util.Diagnostic; |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.EObjectValidator; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.jdt.annotation.Nullable; |
| import org.eclipse.ocl.pivot.Comment; |
| import org.eclipse.ocl.pivot.Element; |
| import org.eclipse.ocl.pivot.ElementExtension; |
| import org.eclipse.ocl.pivot.Iteration; |
| import org.eclipse.ocl.pivot.LoopExp; |
| import org.eclipse.ocl.pivot.OCLExpression; |
| import org.eclipse.ocl.pivot.PivotPackage; |
| import org.eclipse.ocl.pivot.PivotTables; |
| import org.eclipse.ocl.pivot.Type; |
| import org.eclipse.ocl.pivot.ValueSpecification; |
| import org.eclipse.ocl.pivot.Variable; |
| import org.eclipse.ocl.pivot.evaluation.Evaluator; |
| import org.eclipse.ocl.pivot.ids.IdResolver; |
| import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal; |
| import org.eclipse.ocl.pivot.library.collection.CollectionIsEmptyOperation; |
| import org.eclipse.ocl.pivot.library.oclany.OclAnyOclAsSetOperation; |
| import org.eclipse.ocl.pivot.library.oclany.OclAnyOclIsKindOfOperation; |
| import org.eclipse.ocl.pivot.messages.PivotMessages; |
| import org.eclipse.ocl.pivot.util.PivotValidator; |
| import org.eclipse.ocl.pivot.util.Visitor; |
| import org.eclipse.ocl.pivot.utilities.StringUtil; |
| import org.eclipse.ocl.pivot.utilities.ValueUtil; |
| import org.eclipse.ocl.pivot.values.InvalidValueException; |
| import org.eclipse.ocl.pivot.values.OrderedSetValue; |
| import org.eclipse.ocl.pivot.values.SetValue; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Loop Exp</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.pivot.internal.LoopExpImpl#getOwnedBody <em>Owned Body</em>}</li> |
| * <li>{@link org.eclipse.ocl.pivot.internal.LoopExpImpl#getOwnedIterators <em>Owned Iterators</em>}</li> |
| * <li>{@link org.eclipse.ocl.pivot.internal.LoopExpImpl#getReferredIteration <em>Referred Iteration</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class LoopExpImpl |
| extends CallExpImpl |
| implements LoopExp { |
| |
| /** |
| * The cached value of the '{@link #getOwnedBody() <em>Owned Body</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedBody() |
| * @generated |
| * @ordered |
| */ |
| protected OCLExpression ownedBody; |
| |
| /** |
| * The cached value of the '{@link #getOwnedIterators() <em>Owned Iterators</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedIterators() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Variable> ownedIterators; |
| |
| /** |
| * The cached value of the '{@link #getReferredIteration() <em>Referred Iteration</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReferredIteration() |
| * @generated |
| * @ordered |
| */ |
| protected Iteration referredIteration; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LoopExpImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PivotPackage.Literals.LOOP_EXP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public OCLExpression getOwnedBody() { |
| return ownedBody; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetOwnedBody(OCLExpression newOwnedBody, NotificationChain msgs) |
| { |
| OCLExpression oldOwnedBody = ownedBody; |
| ownedBody = newOwnedBody; |
| if (eNotificationRequired()) |
| { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PivotPackage.LOOP_EXP__OWNED_BODY, oldOwnedBody, newOwnedBody); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setOwnedBody(OCLExpression newOwnedBody) { |
| if (newOwnedBody != ownedBody) |
| { |
| NotificationChain msgs = null; |
| if (ownedBody != null) |
| msgs = ((InternalEObject)ownedBody).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PivotPackage.LOOP_EXP__OWNED_BODY, null, msgs); |
| if (newOwnedBody != null) |
| msgs = ((InternalEObject)newOwnedBody).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PivotPackage.LOOP_EXP__OWNED_BODY, null, msgs); |
| msgs = basicSetOwnedBody(newOwnedBody, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PivotPackage.LOOP_EXP__OWNED_BODY, newOwnedBody, newOwnedBody)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| @SuppressWarnings("null") |
| public @NonNull List<Variable> getOwnedIterators() |
| { |
| if (ownedIterators == null) |
| { |
| ownedIterators = new EObjectContainmentEList<Variable>(Variable.class, this, PivotPackage.LOOP_EXP__OWNED_ITERATORS); |
| } |
| return ownedIterators; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Iteration getReferredIteration() |
| { |
| if (referredIteration != null && referredIteration.eIsProxy()) |
| { |
| InternalEObject oldReferredIteration = (InternalEObject)referredIteration; |
| referredIteration = (Iteration)eResolveProxy(oldReferredIteration); |
| if (referredIteration != oldReferredIteration) |
| { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, PivotPackage.LOOP_EXP__REFERRED_ITERATION, oldReferredIteration, referredIteration)); |
| } |
| } |
| return referredIteration; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Iteration basicGetReferredIteration() |
| { |
| return referredIteration; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setReferredIteration(Iteration newReferredIteration) |
| { |
| Iteration oldReferredIteration = referredIteration; |
| referredIteration = newReferredIteration; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PivotPackage.LOOP_EXP__REFERRED_ITERATION, oldReferredIteration, referredIteration)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean validateSourceIsCollection(final DiagnosticChain diagnostics, final Map<Object, Object> context) |
| { |
| /** |
| * |
| * inv validateSourceIsCollection: |
| * ownedSource.type.oclIsKindOf(CollectionType) |
| */ |
| final @NonNull /*@NonInvalid*/ Evaluator evaluator = PivotUtilInternal.getEvaluator(this); |
| final @NonNull /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver(); |
| @NonNull /*@Caught*/ Object CAUGHT_oclIsKindOf; |
| try { |
| final @NonNull /*@NonInvalid*/ org.eclipse.ocl.pivot.Class TYP_CollectionType_0 = idResolver.getClass(PivotTables.CLSSid_CollectionType, null); |
| final @Nullable /*@Thrown*/ OCLExpression ownedSource = this.getOwnedSource(); |
| if (ownedSource == null) { |
| throw new InvalidValueException("Null source for \'pivot::TypedElement::type\'"); |
| } |
| final @Nullable /*@Thrown*/ Type type = ownedSource.getType(); |
| final /*@Thrown*/ boolean oclIsKindOf = OclAnyOclIsKindOfOperation.INSTANCE.evaluate(evaluator, type, TYP_CollectionType_0).booleanValue(); |
| CAUGHT_oclIsKindOf = oclIsKindOf; |
| } |
| catch (Exception e) { |
| CAUGHT_oclIsKindOf = ValueUtil.createInvalidValue(e); |
| } |
| if (CAUGHT_oclIsKindOf == ValueUtil.TRUE_VALUE) { |
| return true; |
| } |
| if (diagnostics != null) { |
| int severity = Diagnostic.WARNING; |
| String message = StringUtil.bind(PivotMessages.ValidationConstraintIsNotSatisfied_ERROR_, new Object[]{"LoopExp", "SourceIsCollection", EObjectValidator.getObjectLabel(this, context)}); |
| diagnostics.add(new BasicDiagnostic(severity, PivotValidator.DIAGNOSTIC_SOURCE, PivotValidator.LOOP_EXP__VALIDATE_SOURCE_IS_COLLECTION, message, new Object [] { this })); |
| } |
| return false; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean validateNoInitializers(final DiagnosticChain diagnostics, final Map<Object, Object> context) |
| { |
| /** |
| * |
| * inv validateNoInitializers: |
| * self.ownedIterators->forAll(ownedInit->isEmpty()) |
| */ |
| final @NonNull /*@NonInvalid*/ Evaluator evaluator = PivotUtilInternal.getEvaluator(this); |
| final @NonNull /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver(); |
| @NonNull /*@Caught*/ Object CAUGHT_forAll; |
| try { |
| final @NonNull /*@Thrown*/ List<Variable> ownedIterators = this.getOwnedIterators(); |
| final @NonNull /*@Thrown*/ OrderedSetValue BOXED_ownedIterators = idResolver.createOrderedSetOfAll(PivotTables.ORD_CLSSid_Variable, ownedIterators); |
| @NonNull /*@Thrown*/ Object accumulator = ValueUtil.TRUE_VALUE; |
| @Nullable Iterator<?> ITERATOR__1 = BOXED_ownedIterators.iterator(); |
| /*@Thrown*/ boolean forAll; |
| while (true) { |
| if (!ITERATOR__1.hasNext()) { |
| if (accumulator == ValueUtil.TRUE_VALUE) { |
| forAll = (Boolean)accumulator; |
| } |
| else { |
| throw (InvalidValueException)accumulator; |
| } |
| break; |
| } |
| @Nullable /*@NonInvalid*/ Variable _1 = (Variable)ITERATOR__1.next(); |
| /** |
| * ownedInit->isEmpty() |
| */ |
| @NonNull /*@Caught*/ Object CAUGHT_isEmpty; |
| try { |
| if (_1 == null) { |
| throw new InvalidValueException("Null source for \'pivot::Variable::ownedInit\'"); |
| } |
| final @Nullable /*@Thrown*/ OCLExpression ownedInit = _1.getOwnedInit(); |
| final @NonNull /*@Thrown*/ SetValue oclAsSet = OclAnyOclAsSetOperation.INSTANCE.evaluate(evaluator, PivotTables.SET_CLSSid_OCLExpression, ownedInit); |
| final /*@Thrown*/ boolean isEmpty = CollectionIsEmptyOperation.INSTANCE.evaluate(oclAsSet).booleanValue(); |
| CAUGHT_isEmpty = isEmpty; |
| } |
| catch (Exception e) { |
| CAUGHT_isEmpty = ValueUtil.createInvalidValue(e); |
| } |
| // |
| if (CAUGHT_isEmpty == ValueUtil.FALSE_VALUE) { // Normal unsuccessful body evaluation result |
| forAll = ValueUtil.FALSE_VALUE; |
| break; // Stop immediately |
| } |
| else if (CAUGHT_isEmpty == ValueUtil.TRUE_VALUE) { // Normal successful body evaluation result |
| ; // Carry on |
| } |
| else if (CAUGHT_isEmpty instanceof InvalidValueException) { // Abnormal exception evaluation result |
| accumulator = CAUGHT_isEmpty; // Cache an exception failure |
| } |
| else { // Impossible badly typed result |
| accumulator = new InvalidValueException(PivotMessages.NonBooleanBody, "forAll"); |
| } |
| } |
| CAUGHT_forAll = forAll; |
| } |
| catch (Exception e) { |
| CAUGHT_forAll = ValueUtil.createInvalidValue(e); |
| } |
| if (CAUGHT_forAll == ValueUtil.TRUE_VALUE) { |
| return true; |
| } |
| if (diagnostics != null) { |
| int severity = Diagnostic.WARNING; |
| String message = StringUtil.bind(PivotMessages.ValidationConstraintIsNotSatisfied_ERROR_, new Object[]{"LoopExp", "NoInitializers", EObjectValidator.getObjectLabel(this, context)}); |
| diagnostics.add(new BasicDiagnostic(severity, PivotValidator.DIAGNOSTIC_SOURCE, PivotValidator.LOOP_EXP__VALIDATE_NO_INITIALIZERS, message, new Object [] { this })); |
| } |
| return false; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, |
| int featureID, NotificationChain msgs) { |
| switch (featureID) |
| { |
| case PivotPackage.LOOP_EXP__ANNOTATING_COMMENTS: |
| return ((InternalEList<?>)getAnnotatingComments()).basicRemove(otherEnd, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_ANNOTATIONS: |
| return ((InternalEList<?>)getOwnedAnnotations()).basicRemove(otherEnd, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_COMMENTS: |
| return ((InternalEList<?>)getOwnedComments()).basicRemove(otherEnd, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_EXTENSIONS: |
| return ((InternalEList<?>)getOwnedExtensions()).basicRemove(otherEnd, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_SOURCE: |
| return basicSetOwnedSource(null, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_BODY: |
| return basicSetOwnedBody(null, msgs); |
| case PivotPackage.LOOP_EXP__OWNED_ITERATORS: |
| return ((InternalEList<?>)getOwnedIterators()).basicRemove(otherEnd, msgs); |
| } |
| return eDynamicInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) |
| { |
| case PivotPackage.LOOP_EXP__ANNOTATING_COMMENTS: |
| return getAnnotatingComments(); |
| case PivotPackage.LOOP_EXP__OWNED_ANNOTATIONS: |
| return getOwnedAnnotations(); |
| case PivotPackage.LOOP_EXP__OWNED_COMMENTS: |
| return getOwnedComments(); |
| case PivotPackage.LOOP_EXP__OWNED_EXTENSIONS: |
| return getOwnedExtensions(); |
| case PivotPackage.LOOP_EXP__NAME: |
| return getName(); |
| case PivotPackage.LOOP_EXP__IS_MANY: |
| return isIsMany(); |
| case PivotPackage.LOOP_EXP__IS_REQUIRED: |
| return isIsRequired(); |
| case PivotPackage.LOOP_EXP__TYPE: |
| if (resolve) return getType(); |
| return basicGetType(); |
| case PivotPackage.LOOP_EXP__TYPE_VALUE: |
| return getTypeValue(); |
| case PivotPackage.LOOP_EXP__IS_IMPLICIT: |
| return isIsImplicit(); |
| case PivotPackage.LOOP_EXP__IS_SAFE: |
| return isIsSafe(); |
| case PivotPackage.LOOP_EXP__OWNED_SOURCE: |
| return getOwnedSource(); |
| case PivotPackage.LOOP_EXP__OWNED_BODY: |
| return getOwnedBody(); |
| case PivotPackage.LOOP_EXP__OWNED_ITERATORS: |
| return getOwnedIterators(); |
| case PivotPackage.LOOP_EXP__REFERRED_ITERATION: |
| if (resolve) return getReferredIteration(); |
| return basicGetReferredIteration(); |
| } |
| return eDynamicGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) |
| { |
| case PivotPackage.LOOP_EXP__ANNOTATING_COMMENTS: |
| getAnnotatingComments().clear(); |
| getAnnotatingComments().addAll((Collection<? extends Comment>)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_ANNOTATIONS: |
| getOwnedAnnotations().clear(); |
| getOwnedAnnotations().addAll((Collection<? extends Element>)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_COMMENTS: |
| getOwnedComments().clear(); |
| getOwnedComments().addAll((Collection<? extends Comment>)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_EXTENSIONS: |
| getOwnedExtensions().clear(); |
| getOwnedExtensions().addAll((Collection<? extends ElementExtension>)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__NAME: |
| setName((String)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__IS_REQUIRED: |
| setIsRequired((Boolean)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__TYPE: |
| setType((Type)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__TYPE_VALUE: |
| setTypeValue((Type)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__IS_IMPLICIT: |
| setIsImplicit((Boolean)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__IS_SAFE: |
| setIsSafe((Boolean)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_SOURCE: |
| setOwnedSource((OCLExpression)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_BODY: |
| setOwnedBody((OCLExpression)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_ITERATORS: |
| getOwnedIterators().clear(); |
| getOwnedIterators().addAll((Collection<? extends Variable>)newValue); |
| return; |
| case PivotPackage.LOOP_EXP__REFERRED_ITERATION: |
| setReferredIteration((Iteration)newValue); |
| return; |
| } |
| eDynamicSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) |
| { |
| case PivotPackage.LOOP_EXP__ANNOTATING_COMMENTS: |
| getAnnotatingComments().clear(); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_ANNOTATIONS: |
| getOwnedAnnotations().clear(); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_COMMENTS: |
| getOwnedComments().clear(); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_EXTENSIONS: |
| getOwnedExtensions().clear(); |
| return; |
| case PivotPackage.LOOP_EXP__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case PivotPackage.LOOP_EXP__IS_REQUIRED: |
| setIsRequired(IS_REQUIRED_EDEFAULT); |
| return; |
| case PivotPackage.LOOP_EXP__TYPE: |
| setType((Type)null); |
| return; |
| case PivotPackage.LOOP_EXP__TYPE_VALUE: |
| setTypeValue((Type)null); |
| return; |
| case PivotPackage.LOOP_EXP__IS_IMPLICIT: |
| setIsImplicit(IS_IMPLICIT_EDEFAULT); |
| return; |
| case PivotPackage.LOOP_EXP__IS_SAFE: |
| setIsSafe(IS_SAFE_EDEFAULT); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_SOURCE: |
| setOwnedSource((OCLExpression)null); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_BODY: |
| setOwnedBody((OCLExpression)null); |
| return; |
| case PivotPackage.LOOP_EXP__OWNED_ITERATORS: |
| getOwnedIterators().clear(); |
| return; |
| case PivotPackage.LOOP_EXP__REFERRED_ITERATION: |
| setReferredIteration((Iteration)null); |
| return; |
| } |
| eDynamicUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) |
| { |
| case PivotPackage.LOOP_EXP__ANNOTATING_COMMENTS: |
| return annotatingComments != null && !annotatingComments.isEmpty(); |
| case PivotPackage.LOOP_EXP__OWNED_ANNOTATIONS: |
| return ownedAnnotations != null && !ownedAnnotations.isEmpty(); |
| case PivotPackage.LOOP_EXP__OWNED_COMMENTS: |
| return ownedComments != null && !ownedComments.isEmpty(); |
| case PivotPackage.LOOP_EXP__OWNED_EXTENSIONS: |
| return ownedExtensions != null && !ownedExtensions.isEmpty(); |
| case PivotPackage.LOOP_EXP__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case PivotPackage.LOOP_EXP__IS_MANY: |
| return isIsMany() != IS_MANY_EDEFAULT; |
| case PivotPackage.LOOP_EXP__IS_REQUIRED: |
| return ((eFlags & IS_REQUIRED_EFLAG) != 0) != IS_REQUIRED_EDEFAULT; |
| case PivotPackage.LOOP_EXP__TYPE: |
| return type != null; |
| case PivotPackage.LOOP_EXP__TYPE_VALUE: |
| return typeValue != null; |
| case PivotPackage.LOOP_EXP__IS_IMPLICIT: |
| return ((eFlags & IS_IMPLICIT_EFLAG) != 0) != IS_IMPLICIT_EDEFAULT; |
| case PivotPackage.LOOP_EXP__IS_SAFE: |
| return ((eFlags & IS_SAFE_EFLAG) != 0) != IS_SAFE_EDEFAULT; |
| case PivotPackage.LOOP_EXP__OWNED_SOURCE: |
| return ownedSource != null; |
| case PivotPackage.LOOP_EXP__OWNED_BODY: |
| return ownedBody != null; |
| case PivotPackage.LOOP_EXP__OWNED_ITERATORS: |
| return ownedIterators != null && !ownedIterators.isEmpty(); |
| case PivotPackage.LOOP_EXP__REFERRED_ITERATION: |
| return referredIteration != null; |
| } |
| return eDynamicIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| @SuppressWarnings("unchecked") |
| public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException |
| { |
| switch (operationID) |
| { |
| case PivotPackage.LOOP_EXP___ALL_OWNED_ELEMENTS: |
| return allOwnedElements(); |
| case PivotPackage.LOOP_EXP___GET_VALUE__TYPE_STRING: |
| return getValue((Type)arguments.get(0), (String)arguments.get(1)); |
| case PivotPackage.LOOP_EXP___COMPATIBLE_BODY__VALUESPECIFICATION: |
| return CompatibleBody((ValueSpecification)arguments.get(0)); |
| case PivotPackage.LOOP_EXP___VALIDATE_NO_INITIALIZERS__DIAGNOSTICCHAIN_MAP: |
| return validateNoInitializers((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| case PivotPackage.LOOP_EXP___VALIDATE_SOURCE_IS_COLLECTION__DIAGNOSTICCHAIN_MAP: |
| return validateSourceIsCollection((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| } |
| return eDynamicInvoke(operationID, arguments); |
| } |
| |
| @Override |
| public <R> R accept(@NonNull Visitor<R> visitor) { |
| return visitor.visitLoopExp(this); |
| } |
| } //LoopExpImpl |