Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 255469 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/ecore/EObject.java (-1 / +28 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2006 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 17-22 Link Here
17
package org.eclipse.emf.ecore;
18
package org.eclipse.emf.ecore;
18
19
19
20
21
import java.lang.reflect.InvocationTargetException;
22
20
import org.eclipse.emf.common.notify.Notifier;
23
import org.eclipse.emf.common.notify.Notifier;
21
import org.eclipse.emf.common.util.EList;
24
import org.eclipse.emf.common.util.EList;
22
import org.eclipse.emf.common.util.TreeIterator;
25
import org.eclipse.emf.common.util.TreeIterator;
Lines 427-430 Link Here
427
   */
430
   */
428
  void eUnset(EStructuralFeature feature);
431
  void eUnset(EStructuralFeature feature);
429
432
433
  /**
434
   * <!-- begin-user-doc -->
435
   * <p>
436
   * Calls the specified operation of the object.  If the operation has
437
   * parameters, then corresponding arguments must be supplied.  There are no
438
   * optional parameters in Ecore operations.
439
   * </p><p>
440
   * If the operation is a void operation, then on successful execution, the
441
   * result of this call is <code>null</code>.  Otherwise, if the operation is
442
   * {@linkplain ETypedElement#isMany() nulti-valued}, then an {@link EList}
443
   * is returned (possibly empty).  If single-valued, then an instance of the
444
   * operation's {@linkplain ETypedElement#getEType() type} is returned, or
445
   * possibly <code>null</code>.
446
   * </p><p>
447
   * If the called operation fails with an
448
   * {@linkplain EOperation#getEExceptions() exception}, then it is re-thrown,
449
   * wrapped in an {@link InvocationTargetException}.
450
   * </p>
451
   * <!-- end-user-doc -->
452
   * @model exceptions="org.eclipse.emf.ecore.EInvocationTargetException" argumentsMany="false"
453
   * @generated
454
   */
455
  Object eCall(EOperation operation, EList<?> arguments) throws InvocationTargetException;
456
430
}
457
}
(-)src/org/eclipse/emf/ecore/EcorePackage.java (-1 / +33 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2006 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 2389-2394 Link Here
2389
2390
2390
2391
2391
  /**
2392
  /**
2393
   * The meta object id for the '<em>EInvocation Target Exception</em>' data type.
2394
   * <!-- begin-user-doc -->
2395
   * <!-- end-user-doc -->
2396
   * @see java.lang.reflect.InvocationTargetException
2397
   * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInvocationTargetException()
2398
   * @generated
2399
   */
2400
  int EINVOCATION_TARGET_EXCEPTION = 52;
2401
2402
  /**
2392
   * The meta object id for the '<em>EFeature Map Entry</em>' data type.
2403
   * The meta object id for the '<em>EFeature Map Entry</em>' data type.
2393
   * <!-- begin-user-doc -->
2404
   * <!-- begin-user-doc -->
2394
   * <!-- end-user-doc -->
2405
   * <!-- end-user-doc -->
Lines 3877-3882 Link Here
3877
  EDataType getETreeIterator();
3888
  EDataType getETreeIterator();
3878
3889
3879
  /**
3890
  /**
3891
   * Returns the meta object for data type '{@link java.lang.reflect.InvocationTargetException <em>EInvocation Target Exception</em>}'.
3892
   * <!-- begin-user-doc -->
3893
   * <!-- end-user-doc -->
3894
   * @return the meta object for data type '<em>EInvocation Target Exception</em>'.
3895
   * @see java.lang.reflect.InvocationTargetException
3896
   * @model instanceClass="java.lang.reflect.InvocationTargetException"
3897
   * @generated
3898
   */
3899
  EDataType getEInvocationTargetException();
3900
3901
  /**
3880
   * Returns the meta object for data type '{@link org.eclipse.emf.ecore.util.FeatureMap.Entry <em>EFeature Map Entry</em>}'.
3902
   * Returns the meta object for data type '{@link org.eclipse.emf.ecore.util.FeatureMap.Entry <em>EFeature Map Entry</em>}'.
3881
   * <!-- begin-user-doc -->
3903
   * <!-- begin-user-doc -->
3882
   * <!-- end-user-doc -->
3904
   * <!-- end-user-doc -->
Lines 5103-5108 Link Here
5103
     */
5125
     */
5104
    EDataType ETREE_ITERATOR = eINSTANCE.getETreeIterator();
5126
    EDataType ETREE_ITERATOR = eINSTANCE.getETreeIterator();
5105
5127
5128
    /**
5129
     * The meta object literal for the '<em>EInvocation Target Exception</em>' data type.
5130
     * <!-- begin-user-doc -->
5131
     * <!-- end-user-doc -->
5132
     * @see java.lang.reflect.InvocationTargetException
5133
     * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInvocationTargetException()
5134
     * @generated
5135
     */
5136
    EDataType EINVOCATION_TARGET_EXCEPTION = eINSTANCE.getEInvocationTargetException();
5137
5106
  }
5138
  }
5107
5139
5108
  // Internal bootstrap uses Literals constants, so we must force initialization this inner interface first.
5140
  // Internal bootstrap uses Literals constants, so we must force initialization this inner interface first.
(-)src/org/eclipse/emf/ecore/EOperation.java (-1 / +96 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2006 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 17-22 Link Here
17
package org.eclipse.emf.ecore;
18
package org.eclipse.emf.ecore;
18
19
19
20
21
import java.lang.reflect.InvocationTargetException;
22
import java.util.HashMap;
23
20
import org.eclipse.emf.common.util.EList;
24
import org.eclipse.emf.common.util.EList;
21
25
22
26
Lines 126-129 Link Here
126
   */
130
   */
127
  EList<ETypeParameter> getETypeParameters();
131
  EList<ETypeParameter> getETypeParameters();
128
132
133
  /**
134
   * Internal API implemented by all operations.
135
   * 
136
   * @since 2.5
137
   */
138
  interface Internal extends EOperation, InternalEObject
139
  {
140
	/**
141
	 * A pluggable, dynamic implementation of operation behaviour.
142
	 */
143
    interface CallDelegate
144
    {
145
      /**
146
       * A factory for creating call delegates.
147
       */
148
      interface Factory
149
      {
150
        /**
151
         * Creates the call delegate for the specified <tt>operation</tt>.
152
         * 
153
         * @param operation the operation
154
         * @return its call delegate
155
         */
156
        CallDelegate createCallDelegate(EOperation operation);
157
        
158
        /**
159
         * A registry of call-delegate factories.
160
         */
161
        interface Registry
162
        {
163
          Registry INSTANCE = new Impl();
164
          
165
          Factory getFactory(String key);
166
          
167
          void registerFactory(String key, Factory factory);
168
          
169
          void deregisterFactory(String key);
170
          
171
          class Impl extends HashMap<String, Factory> implements Registry
172
          {
173
            private static final long serialVersionUID = 1L;
174
            
175
            public Factory getFactory(String key)
176
            {
177
              return get(key);
178
            }
179
            
180
            public void registerFactory(String key, Factory factory)
181
            {
182
              put(key, factory);
183
            }
184
            
185
            public void deregisterFactory(String key)
186
            {
187
              remove(key);
188
            }
189
          }
190
        }
191
      }
192
      
193
      /**
194
       * Invokes the operation behaviour for the specified <tt>target</tt>
195
       * object.
196
       * 
197
       * @param target the object on which to call the operation
198
       * @param arguments the arguments for the operation parameters (an
199
       *    empty list if the operation has no parameters)
200
       * @return the operation's return result, or <code>null</code> if it is
201
       *    a void operation
202
       * @throws InvocationTargetException in case of failure to execute the
203
       *    operation behaviour, usually because of an exception
204
       */
205
      Object dynamicCall(InternalEObject target, EList<?> arguments) throws InvocationTargetException;
206
    }
207
    
208
    /**
209
     * Obtains the delegate for this operation.
210
     * A default delegate is always available, so this should not return
211
     * <code>null</code>.
212
     * 
213
     * @return the operation delegate
214
     */
215
    CallDelegate getCallDelegate();
216
    
217
    /**
218
     * Assigns a delegate to this operation.
219
     * 
220
     * @param callDelegate the new operation delegate
221
     */
222
    void setCallDelegate(CallDelegate callDelegate);
223
  }
129
} //EOperation
224
} //EOperation
(-)src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java (-1 / +27 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2006 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 17-22 Link Here
17
package org.eclipse.emf.ecore.impl;
18
package org.eclipse.emf.ecore.impl;
18
19
19
20
21
import java.lang.reflect.InvocationTargetException;
20
import java.math.BigDecimal;
22
import java.math.BigDecimal;
21
import java.math.BigInteger;
23
import java.math.BigInteger;
22
import java.text.ParseException;
24
import java.text.ParseException;
Lines 161-166 Link Here
161
        return createEShortObjectFromString(eDataType, initialValue);
163
        return createEShortObjectFromString(eDataType, initialValue);
162
      case EcorePackage.ESTRING:
164
      case EcorePackage.ESTRING:
163
        return createEStringFromString(eDataType, initialValue);
165
        return createEStringFromString(eDataType, initialValue);
166
      case EcorePackage.EINVOCATION_TARGET_EXCEPTION:
167
        return createEInvocationTargetExceptionFromString(eDataType, initialValue);
164
      default:
168
      default:
165
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
169
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
166
    }
170
    }
Lines 222-227 Link Here
222
        return convertEShortObjectToString(eDataType, instanceValue);
226
        return convertEShortObjectToString(eDataType, instanceValue);
223
      case EcorePackage.ESTRING:
227
      case EcorePackage.ESTRING:
224
        return convertEStringToString(eDataType, instanceValue);
228
        return convertEStringToString(eDataType, instanceValue);
229
      case EcorePackage.EINVOCATION_TARGET_EXCEPTION:
230
        return convertEInvocationTargetExceptionToString(eDataType, instanceValue);
225
      default:
231
      default:
226
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
232
        throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
227
    }
233
    }
Lines 654-659 Link Here
654
  /**
660
  /**
655
   * <!-- begin-user-doc -->
661
   * <!-- begin-user-doc -->
656
   * <!-- end-user-doc -->
662
   * <!-- end-user-doc -->
663
   * @generated
664
   */
665
  public InvocationTargetException createEInvocationTargetExceptionFromString(EDataType eDataType, String initialValue)
666
  {
667
    return (InvocationTargetException)super.createFromString(eDataType, initialValue);
668
  }
669
670
  /**
671
   * <!-- begin-user-doc -->
672
   * <!-- end-user-doc -->
673
   * @generated
674
   */
675
  public String convertEInvocationTargetExceptionToString(EDataType eDataType, Object instanceValue)
676
  {
677
    return super.convertToString(eDataType, instanceValue);
678
  }
679
680
		/**
681
   * <!-- begin-user-doc -->
682
   * <!-- end-user-doc -->
657
   * @generated NOT
683
   * @generated NOT
658
   */
684
   */
659
  public Integer createEIntFromString(EDataType metaObject, String initialValue) 
685
  public Integer createEIntFromString(EDataType metaObject, String initialValue) 
(-)src/org/eclipse/emf/ecore/impl/EOperationImpl.java (-2 / +39 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2007 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 28-33 Link Here
28
import org.eclipse.emf.common.notify.NotificationChain;
29
import org.eclipse.emf.common.notify.NotificationChain;
29
import org.eclipse.emf.common.notify.impl.NotificationImpl;
30
import org.eclipse.emf.common.notify.impl.NotificationImpl;
30
import org.eclipse.emf.common.util.EList;
31
import org.eclipse.emf.common.util.EList;
32
import org.eclipse.emf.common.util.URI;
31
import org.eclipse.emf.ecore.EAnnotation;
33
import org.eclipse.emf.ecore.EAnnotation;
32
import org.eclipse.emf.ecore.EClass;
34
import org.eclipse.emf.ecore.EClass;
33
import org.eclipse.emf.ecore.EClassifier;
35
import org.eclipse.emf.ecore.EClassifier;
Lines 38-46 Link Here
38
import org.eclipse.emf.ecore.EcoreFactory;
40
import org.eclipse.emf.ecore.EcoreFactory;
39
import org.eclipse.emf.ecore.EcorePackage;
41
import org.eclipse.emf.ecore.EcorePackage;
40
import org.eclipse.emf.ecore.InternalEObject;
42
import org.eclipse.emf.ecore.InternalEObject;
43
import org.eclipse.emf.ecore.util.BasicCallDelegate;
41
import org.eclipse.emf.ecore.util.DelegatingEcoreEList;
44
import org.eclipse.emf.ecore.util.DelegatingEcoreEList;
42
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
45
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
43
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
46
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
47
import org.eclipse.emf.ecore.util.EcoreUtil;
44
// import org.eclipse.emf.ecore.util.EObjectResolvingEList;
48
// import org.eclipse.emf.ecore.util.EObjectResolvingEList;
45
import org.eclipse.emf.ecore.util.InternalEList;
49
import org.eclipse.emf.ecore.util.InternalEList;
46
50
Lines 48-53 Link Here
48
/**
52
/**
49
 * <!-- begin-user-doc -->
53
 * <!-- begin-user-doc -->
50
 * An implementation of the model object '<em><b>EOperation</b></em>'.
54
 * An implementation of the model object '<em><b>EOperation</b></em>'.
55
 * @extends EOperation.Internal
51
 * <!-- end-user-doc -->
56
 * <!-- end-user-doc -->
52
 * <p>
57
 * <p>
53
 * The following features are implemented:
58
 * The following features are implemented:
Lines 62-68 Link Here
62
 *
67
 *
63
 * @generated
68
 * @generated
64
 */
69
 */
65
public class EOperationImpl extends ETypedElementImpl implements EOperation
70
public class EOperationImpl extends ETypedElementImpl implements EOperation, EOperation.Internal
66
{
71
{
67
  /**
72
  /**
68
   * The cached value of the '{@link #getETypeParameters() <em>EType Parameters</em>}' containment reference list.
73
   * The cached value of the '{@link #getETypeParameters() <em>EType Parameters</em>}' containment reference list.
Lines 1007-1010 Link Here
1007
    return eDynamicIsSet(featureID);
1012
    return eDynamicIsSet(featureID);
1008
  }
1013
  }
1009
1014
1015
  protected EOperation.Internal.CallDelegate callDelegate;
1016
  
1017
  public CallDelegate getCallDelegate()
1018
  {
1019
    if (callDelegate == null)
1020
    {
1021
      CallDelegate.Factory factory = null;
1022
      String callDelegateKey = EcoreUtil.getAnnotation(this, EcorePackage.eNS_URI,
1023
    	  "callDelegate");
1024
      if (callDelegateKey != null)
1025
      {
1026
        factory = CallDelegate.Factory.Registry.INSTANCE.getFactory(
1027
        	URI.createURI(callDelegateKey).trimFragment().trimQuery().toString());
1028
      }
1029
      if (factory != null)
1030
      {
1031
        callDelegate = factory.createCallDelegate(this);
1032
      }
1033
      if (callDelegate == null)
1034
      {
1035
         callDelegate = new BasicCallDelegate(this);
1036
      }
1037
    }
1038
    
1039
    return callDelegate;
1040
  }
1041
  
1042
  public void setCallDelegate(CallDelegate callDelegate)
1043
  {
1044
    this.callDelegate = callDelegate;
1045
  }
1046
  
1010
}
1047
}
(-)src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java (-1 / +30 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2002-2007 IBM Corporation and others.
4
 * Copyright (c) 2002-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 17-22 Link Here
17
package org.eclipse.emf.ecore.impl;
18
package org.eclipse.emf.ecore.impl;
18
19
19
20
21
import java.lang.reflect.InvocationTargetException;
20
import java.math.BigDecimal;
22
import java.math.BigDecimal;
21
import java.math.BigInteger;
23
import java.math.BigInteger;
22
import java.util.ArrayList;
24
import java.util.ArrayList;
Lines 410-415 Link Here
410
   * <!-- end-user-doc -->
412
   * <!-- end-user-doc -->
411
   * @generated
413
   * @generated
412
   */
414
   */
415
  private EDataType eInvocationTargetExceptionEDataType = null;
416
417
  /**
418
   * <!-- begin-user-doc -->
419
   * <!-- end-user-doc -->
420
   * @generated
421
   */
413
  private EDataType eFeatureMapEntryEDataType = null;
422
  private EDataType eFeatureMapEntryEDataType = null;
414
423
415
  /**
424
  /**
Lines 1828-1833 Link Here
1828
   * <!-- end-user-doc -->
1837
   * <!-- end-user-doc -->
1829
   * @generated
1838
   * @generated
1830
   */
1839
   */
1840
  public EDataType getEInvocationTargetException()
1841
  {
1842
    return eInvocationTargetExceptionEDataType;
1843
  }
1844
1845
  /**
1846
   * <!-- begin-user-doc -->
1847
   * <!-- end-user-doc -->
1848
   * @generated
1849
   */
1831
  public EDataType getEFeatureMapEntry()
1850
  public EDataType getEFeatureMapEntry()
1832
  {
1851
  {
1833
    return eFeatureMapEntryEDataType;
1852
    return eFeatureMapEntryEDataType;
Lines 2067-2072 Link Here
2067
    eShortObjectEDataType = createEDataType(ESHORT_OBJECT);
2086
    eShortObjectEDataType = createEDataType(ESHORT_OBJECT);
2068
    eStringEDataType = createEDataType(ESTRING);
2087
    eStringEDataType = createEDataType(ESTRING);
2069
    eTreeIteratorEDataType = createEDataType(ETREE_ITERATOR);
2088
    eTreeIteratorEDataType = createEDataType(ETREE_ITERATOR);
2089
    eInvocationTargetExceptionEDataType = createEDataType(EINVOCATION_TARGET_EXCEPTION);
2070
  }
2090
  }
2071
2091
2072
  /**
2092
  /**
Lines 2275-2280 Link Here
2275
    op = addEOperation(eObjectEClass, null, "eUnset", 0, 1, IS_UNIQUE, IS_ORDERED);
2295
    op = addEOperation(eObjectEClass, null, "eUnset", 0, 1, IS_UNIQUE, IS_ORDERED);
2276
    addEParameter(op, this.getEStructuralFeature(), "feature", 0, 1, IS_UNIQUE, IS_ORDERED);
2296
    addEParameter(op, this.getEStructuralFeature(), "feature", 0, 1, IS_UNIQUE, IS_ORDERED);
2277
2297
2298
    op = addEOperation(eObjectEClass, this.getEJavaObject(), "eCall", 0, 1, IS_UNIQUE, IS_ORDERED);
2299
    addEParameter(op, this.getEOperation(), "operation", 0, 1, IS_UNIQUE, IS_ORDERED);
2300
    g1 = createEGenericType(ecorePackage.getEEList());
2301
    g2 = createEGenericType();
2302
    g1.getETypeArguments().add(g2);
2303
    addEParameter(op, g1, "arguments", 0, 1, IS_UNIQUE, IS_ORDERED);
2304
    addEException(op, this.getEInvocationTargetException());
2305
2278
    initEClass(eOperationEClass, EOperation.class, "EOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
2306
    initEClass(eOperationEClass, EOperation.class, "EOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
2279
    initEReference(getEOperation_EContainingClass(), this.getEClass(), this.getEClass_EOperations(), "eContainingClass", null, 0, 1, EOperation.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
2307
    initEReference(getEOperation_EContainingClass(), this.getEClass(), this.getEClass_EOperations(), "eContainingClass", null, 0, 1, EOperation.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
2280
    initEReference(getEOperation_ETypeParameters(), this.getETypeParameter(), null, "eTypeParameters", null, 0, -1, EOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
2308
    initEReference(getEOperation_ETypeParameters(), this.getETypeParameter(), null, "eTypeParameters", null, 0, -1, EOperation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
Lines 2380-2385 Link Here
2380
    initEDataType(eShortObjectEDataType, Short.class, "EShortObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2408
    initEDataType(eShortObjectEDataType, Short.class, "EShortObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2381
    initEDataType(eStringEDataType, String.class, "EString", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2409
    initEDataType(eStringEDataType, String.class, "EString", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2382
    initEDataType(eTreeIteratorEDataType, TreeIterator.class, "ETreeIterator", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2410
    initEDataType(eTreeIteratorEDataType, TreeIterator.class, "ETreeIterator", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2411
    initEDataType(eInvocationTargetExceptionEDataType, InvocationTargetException.class, "EInvocationTargetException", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
2383
2412
2384
    // Create resource
2413
    // Create resource
2385
    createResource(eNS_URI);
2414
    createResource(eNS_URI);
(-)src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java (+9 lines)
Lines 9-14 Link Here
9
 * 
9
 * 
10
 * Contributors: 
10
 * Contributors: 
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 17-22 Link Here
17
package org.eclipse.emf.ecore.impl;
18
package org.eclipse.emf.ecore.impl;
18
19
19
20
21
import java.lang.reflect.InvocationTargetException;
20
import java.util.ArrayList;
22
import java.util.ArrayList;
21
import java.util.Iterator;
23
import java.util.Iterator;
22
import java.util.List;
24
import java.util.List;
Lines 36-41 Link Here
36
import org.eclipse.emf.ecore.EDataType;
38
import org.eclipse.emf.ecore.EDataType;
37
import org.eclipse.emf.ecore.EFactory;
39
import org.eclipse.emf.ecore.EFactory;
38
import org.eclipse.emf.ecore.EObject;
40
import org.eclipse.emf.ecore.EObject;
41
import org.eclipse.emf.ecore.EOperation;
39
import org.eclipse.emf.ecore.EReference;
42
import org.eclipse.emf.ecore.EReference;
40
import org.eclipse.emf.ecore.EStructuralFeature;
43
import org.eclipse.emf.ecore.EStructuralFeature;
41
import org.eclipse.emf.ecore.ETypedElement;
44
import org.eclipse.emf.ecore.ETypedElement;
Lines 1995-2000 Link Here
1995
    }
1998
    }
1996
  }
1999
  }
1997
  
2000
  
2001
  public Object eCall(EOperation operation, EList<?> arguments) throws InvocationTargetException
2002
  {
2003
	return ((EOperation.Internal) operation).getCallDelegate().dynamicCall(this,
2004
		arguments);
2005
  }
2006
  
1998
  @Override
2007
  @Override
1999
  public String toString()
2008
  public String toString()
2000
  {
2009
  {
(-)model/Ecore.ecore (+9 lines)
Lines 221-226 Link Here
221
    <eOperations name="eUnset">
221
    <eOperations name="eUnset">
222
      <eParameters name="feature" eType="#//EStructuralFeature"/>
222
      <eParameters name="feature" eType="#//EStructuralFeature"/>
223
    </eOperations>
223
    </eOperations>
224
    <eOperations name="eCall" eType="#//EJavaObject" eExceptions="#//EInvocationTargetException">
225
      <eParameters name="operation" eType="#//EOperation"/>
226
      <eParameters name="arguments">
227
        <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
228
          <eTypeArguments/>
229
        </eGenericType>
230
      </eParameters>
231
    </eOperations>
224
  </eClassifiers>
232
  </eClassifiers>
225
  <eClassifiers xsi:type="ecore:EClass" name="EOperation" eSuperTypes="#//ETypedElement">
233
  <eClassifiers xsi:type="ecore:EClass" name="EOperation" eSuperTypes="#//ETypedElement">
226
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
234
    <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
Lines 495-498 Link Here
495
    <eStructuralFeatures xsi:type="ecore:EReference" name="eBounds" upperBound="-1"
503
    <eStructuralFeatures xsi:type="ecore:EReference" name="eBounds" upperBound="-1"
496
        eType="#//EGenericType" containment="true" resolveProxies="false"/>
504
        eType="#//EGenericType" containment="true" resolveProxies="false"/>
497
  </eClassifiers>
505
  </eClassifiers>
506
  <eClassifiers xsi:type="ecore:EDataType" name="EInvocationTargetException" instanceClassName="java.lang.reflect.InvocationTargetException"/>
498
</ecore:EPackage>
507
</ecore:EPackage>
(-)model/EcoreAnnotations.ecorediag (-1 / +61 lines)
Lines 14-20 Link Here
14
    </children>
14
    </children>
15
    <styles xmi:type="notation:ShapeStyle" xmi:id="_sFlvLT-OEd2DT6rVsxRmdQ" fontName="Microsoft Sans Serif" fontHeight="10" fillColor="13761016" lineColor="0"/>
15
    <styles xmi:type="notation:ShapeStyle" xmi:id="_sFlvLT-OEd2DT6rVsxRmdQ" fontName="Microsoft Sans Serif" fontHeight="10" fillColor="13761016" lineColor="0"/>
16
    <element xmi:type="ecore:EClass" href="Ecore.ecore#//EAnnotation"/>
16
    <element xmi:type="ecore:EClass" href="Ecore.ecore#//EAnnotation"/>
17
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sFlvLj-OEd2DT6rVsxRmdQ" x="114" y="312"/>
17
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sFlvLj-OEd2DT6rVsxRmdQ" x="108" y="333"/>
18
  </children>
18
  </children>
19
  <children xmi:type="notation:Node" xmi:id="_sFlvLz-OEd2DT6rVsxRmdQ" type="1001">
19
  <children xmi:type="notation:Node" xmi:id="_sFlvLz-OEd2DT6rVsxRmdQ" type="1001">
20
    <children xmi:type="notation:Node" xmi:id="_sFlvMD-OEd2DT6rVsxRmdQ" type="4001"/>
20
    <children xmi:type="notation:Node" xmi:id="_sFlvMD-OEd2DT6rVsxRmdQ" type="4001"/>
Lines 40-45 Link Here
40
      <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvRD-OEd2DT6rVsxRmdQ"/>
40
      <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvRD-OEd2DT6rVsxRmdQ"/>
41
    </children>
41
    </children>
42
    <children xmi:type="notation:Node" xmi:id="_sFlvRT-OEd2DT6rVsxRmdQ" type="5002">
42
    <children xmi:type="notation:Node" xmi:id="_sFlvRT-OEd2DT6rVsxRmdQ" type="5002">
43
      <children xmi:type="notation:Node" xmi:id="_qywyMLP2Ed2JrdFLh2Y_ww" type="2002">
44
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eClass"/>
45
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qywyMbP2Ed2JrdFLh2Y_ww"/>
46
      </children>
47
      <children xmi:type="notation:Node" xmi:id="_qyxZQLP2Ed2JrdFLh2Y_ww" type="2002">
48
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eIsProxy"/>
49
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZQbP2Ed2JrdFLh2Y_ww"/>
50
      </children>
51
      <children xmi:type="notation:Node" xmi:id="_qyxZQrP2Ed2JrdFLh2Y_ww" type="2002">
52
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eResource"/>
53
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZQ7P2Ed2JrdFLh2Y_ww"/>
54
      </children>
55
      <children xmi:type="notation:Node" xmi:id="_qyxZRLP2Ed2JrdFLh2Y_ww" type="2002">
56
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainer"/>
57
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZRbP2Ed2JrdFLh2Y_ww"/>
58
      </children>
59
      <children xmi:type="notation:Node" xmi:id="_qyxZRrP2Ed2JrdFLh2Y_ww" type="2002">
60
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainingFeature"/>
61
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZR7P2Ed2JrdFLh2Y_ww"/>
62
      </children>
63
      <children xmi:type="notation:Node" xmi:id="_qyyAULP2Ed2JrdFLh2Y_ww" type="2002">
64
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainmentFeature"/>
65
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAUbP2Ed2JrdFLh2Y_ww"/>
66
      </children>
67
      <children xmi:type="notation:Node" xmi:id="_qyyAUrP2Ed2JrdFLh2Y_ww" type="2002">
68
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContents"/>
69
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAU7P2Ed2JrdFLh2Y_ww"/>
70
      </children>
71
      <children xmi:type="notation:Node" xmi:id="_qyyAVLP2Ed2JrdFLh2Y_ww" type="2002">
72
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eAllContents"/>
73
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAVbP2Ed2JrdFLh2Y_ww"/>
74
      </children>
75
      <children xmi:type="notation:Node" xmi:id="_qyyAVrP2Ed2JrdFLh2Y_ww" type="2002">
76
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eCrossReferences"/>
77
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAV7P2Ed2JrdFLh2Y_ww"/>
78
      </children>
79
      <children xmi:type="notation:Node" xmi:id="_qyynYLP2Ed2JrdFLh2Y_ww" type="2002">
80
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eGet"/>
81
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyynYbP2Ed2JrdFLh2Y_ww"/>
82
      </children>
83
      <children xmi:type="notation:Node" xmi:id="_qyynYrP2Ed2JrdFLh2Y_ww" type="2002">
84
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eGet.1"/>
85
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyynY7P2Ed2JrdFLh2Y_ww"/>
86
      </children>
87
      <children xmi:type="notation:Node" xmi:id="_qyzOcLP2Ed2JrdFLh2Y_ww" type="2002">
88
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eSet"/>
89
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOcbP2Ed2JrdFLh2Y_ww"/>
90
      </children>
91
      <children xmi:type="notation:Node" xmi:id="_qyzOcrP2Ed2JrdFLh2Y_ww" type="2002">
92
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eIsSet"/>
93
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOc7P2Ed2JrdFLh2Y_ww"/>
94
      </children>
95
      <children xmi:type="notation:Node" xmi:id="_qyzOdLP2Ed2JrdFLh2Y_ww" type="2002">
96
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eUnset"/>
97
        <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOdbP2Ed2JrdFLh2Y_ww"/>
98
      </children>
99
      <children xmi:type="notation:Node" xmi:id="_xxmzoLP2Ed2JrdFLh2Y_ww" type="2002">
100
        <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eCall"/>
101
        <layoutConstraint xmi:type="notation:Location" xmi:id="_xxmzobP2Ed2JrdFLh2Y_ww"/>
102
      </children>
43
      <styles xmi:type="notation:DrawerStyle" xmi:id="_sFlvRj-OEd2DT6rVsxRmdQ"/>
103
      <styles xmi:type="notation:DrawerStyle" xmi:id="_sFlvRj-OEd2DT6rVsxRmdQ"/>
44
      <styles xmi:type="notation:SortingStyle" xmi:id="_sFlvRz-OEd2DT6rVsxRmdQ"/>
104
      <styles xmi:type="notation:SortingStyle" xmi:id="_sFlvRz-OEd2DT6rVsxRmdQ"/>
45
      <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvSD-OEd2DT6rVsxRmdQ"/>
105
      <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvSD-OEd2DT6rVsxRmdQ"/>
(-)model/EcoreDataTypes.ecorediag (+7 lines)
Lines 224-229 Link Here
224
    <element xmi:type="ecore:EDataType" href="Ecore.ecore#//ETreeIterator"/>
224
    <element xmi:type="ecore:EDataType" href="Ecore.ecore#//ETreeIterator"/>
225
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n9W90D-IEd2DT6rVsxRmdQ" x="408" y="228"/>
225
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n9W90D-IEd2DT6rVsxRmdQ" x="408" y="228"/>
226
  </children>
226
  </children>
227
  <children xmi:type="notation:Node" xmi:id="_z-RYILP5Ed2JrdFLh2Y_ww" type="1004">
228
    <children xmi:type="notation:Node" xmi:id="_z-VpkLP5Ed2JrdFLh2Y_ww" type="4008"/>
229
    <children xmi:type="notation:Node" xmi:id="_z-VpkbP5Ed2JrdFLh2Y_ww" type="4009"/>
230
    <styles xmi:type="notation:ShapeStyle" xmi:id="_z-RYIbP5Ed2JrdFLh2Y_ww" fontName="Lucida Grande" fontHeight="10" fillColor="13420443" lineColor="8421504"/>
231
    <element xmi:type="ecore:EDataType" href="Ecore.ecore#//EInvocationTargetException"/>
232
    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_z-RYIrP5Ed2JrdFLh2Y_ww" x="-216" y="585"/>
233
  </children>
227
  <styles xmi:type="notation:DiagramStyle" xmi:id="_n9W90T-IEd2DT6rVsxRmdQ"/>
234
  <styles xmi:type="notation:DiagramStyle" xmi:id="_n9W90T-IEd2DT6rVsxRmdQ"/>
228
  <element xmi:type="ecore:EPackage" href="Ecore.ecore#/"/>
235
  <element xmi:type="ecore:EPackage" href="Ecore.ecore#/"/>
229
</notation:Diagram>
236
</notation:Diagram>
(-)src/org/eclipse/emf/ecore/util/EcoreValidator.java (-1 / +15 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
 * <copyright>
2
 * <copyright>
3
 *
3
 *
4
 * Copyright (c) 2006-2007 IBM Corporation and others.
4
 * Copyright (c) 2006-2008 IBM Corporation, Zeligsoft Inc., and others.
5
 * All rights reserved.   This program and the accompanying materials
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
7
 * which accompanies this distribution, and is available at
Lines 9-14 Link Here
9
 *
9
 *
10
 * Contributors:
10
 * Contributors:
11
 *   IBM - Initial API and implementation
11
 *   IBM - Initial API and implementation
12
 *   Zeligsoft - 255469 Implement basic eCall support
12
 *
13
 *
13
 * </copyright>
14
 * </copyright>
14
 *
15
 *
Lines 16-21 Link Here
16
 */
17
 */
17
package org.eclipse.emf.ecore.util;
18
package org.eclipse.emf.ecore.util;
18
19
20
import java.lang.reflect.InvocationTargetException;
19
import java.math.BigDecimal;
21
import java.math.BigDecimal;
20
import java.math.BigInteger;
22
import java.math.BigInteger;
21
23
Lines 501-506 Link Here
501
        return validateEString((String)value, diagnostics, context);
503
        return validateEString((String)value, diagnostics, context);
502
      case EcorePackage.ETREE_ITERATOR:
504
      case EcorePackage.ETREE_ITERATOR:
503
        return validateETreeIterator((TreeIterator<?>)value, diagnostics, context);
505
        return validateETreeIterator((TreeIterator<?>)value, diagnostics, context);
506
      case EcorePackage.EINVOCATION_TARGET_EXCEPTION:
507
        return validateEInvocationTargetException((InvocationTargetException)value, diagnostics, context);
504
      default:
508
      default:
505
        return true;
509
        return true;
506
    }
510
    }
Lines 4087-4092 Link Here
4087
  }
4091
  }
4088
4092
4089
  /**
4093
  /**
4094
   * <!-- begin-user-doc -->
4095
   * <!-- end-user-doc -->
4096
   * @generated
4097
   */
4098
  public boolean validateEInvocationTargetException(InvocationTargetException eInvocationTargetException, DiagnosticChain diagnostics, Map<Object, Object> context)
4099
  {
4100
    return true;
4101
  }
4102
4103
  /**
4090
   * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
4104
   * Returns the resource locator that will be used to fetch messages for this validator's diagnostics.
4091
   * <!-- begin-user-doc -->
4105
   * <!-- begin-user-doc -->
4092
   * <!-- end-user-doc -->
4106
   * <!-- end-user-doc -->
(-)src/org/eclipse/emf/ecore/util/BasicCallDelegate.java (+99 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * 
4
 * Copyright (c) 2008 Zeligsoft Inc. and others.
5
 * All rights reserved.   This program and the accompanying materials
6
 * are made available under the terms of the Eclipse Public License v1.0
7
 * which accompanies this distribution, and is available at
8
 * http://www.eclipse.org/legal/epl-v10.html
9
 * 
10
 * Contributors:
11
 *   Zeligsoft - Initial API and implementation
12
 * 
13
 * </copyright>
14
 *
15
 * $Id$
16
 */
17
18
package org.eclipse.emf.ecore.util;
19
20
import java.lang.reflect.InvocationTargetException;
21
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EStructuralFeature;
25
import org.eclipse.emf.ecore.EcorePackage;
26
import org.eclipse.emf.ecore.InternalEObject;
27
import org.eclipse.emf.ecore.EOperation;
28
29
30
/**
31
 * A basic implementation of the dynamic operation-call delegate API.  In fact,
32
 * it is so basic that it isn't much an implementation at all, but merely
33
 * throws {@link UnsupportedOperationException} on every invocation, except for
34
 * the operations define for the {@link EObject} class.
35
 * Subclasses should override the {@link #dynamicCall(InternalEObject, EList)}
36
 * method to not do that.
37
 */
38
public class BasicCallDelegate implements EOperation.Internal.CallDelegate
39
{
40
  protected EOperation eOperation;
41
  
42
  /**
43
   * Initializes me with the operation that delegates calls to me.
44
   * 
45
   * @param operation my operation
46
   */
47
  public BasicCallDelegate(EOperation operation)
48
  {
49
    this.eOperation = operation;
50
  }
51
52
  public Object dynamicCall(InternalEObject target, EList<?> arguments)	throws InvocationTargetException
53
  {
54
    if (eOperation.getEContainingClass() == EcorePackage.Literals.EOBJECT)
55
    {
56
      //TODO: EOperations should have IDs, like structural features.
57
      // These IDs should be listed in the generated package interface
58
      int id = eOperation.getEContainingClass().getEAllOperations().indexOf(eOperation);
59
      
60
      switch (id) {
61
      case 0: // EcorePackage.EOBJECT___ECLASS
62
        return target.eClass();
63
      case 1: // EcorePackage.EOBJECT___EIS_PROXY
64
        return target.eIsProxy();
65
      case 2: // EcorePackage.EOBJECT___ERESOURCE
66
        return target.eResource();
67
      case 3: // EcorePackage.EOBJECT___ECONTAINER
68
        return target.eContainer();
69
      case 4: // EcorePackage.EOBJECT___ECONTAINING_FEATURE
70
        return target.eContainingFeature();
71
      case 5: // EcorePackage.EOBJECT___ECONTAINMENT_FEATURE
72
        return target.eContainmentFeature();
73
      case 6: // EcorePackage.EOBJECT___ECONTENTS
74
        return target.eContents();
75
      case 7: // EcorePackage.EOBJECT___EALL_CONTENTS
76
        return target.eAllContents();
77
      case 8: // EcorePackage.EOBJECT___ECROSS_REFERENCES
78
        return target.eCrossReferences();
79
      case 9: // EcorePackage.EOBJECT___EGET__FEATURE
80
        return target.eGet((EStructuralFeature) arguments.get(0));
81
      case 10: // EcorePackage.EOBJECT___EGET__FEATURE__RESOLVE
82
        return target.eGet((EStructuralFeature) arguments.get(0), (Boolean) arguments.get(1));
83
      case 11: // EcorePackage.EOBJECT___ESET__FEATURE__NEW_VALUE
84
        target.eSet((EStructuralFeature) arguments.get(0), arguments.get(1));
85
        return null;
86
      case 12: // EcorePackage.EOBJECT___EIS_SET__FEATURE
87
        return target.eIsSet((EStructuralFeature) arguments.get(0));
88
      case 13: // EcorePackage.EOBJECT___EUNSET__FEATURE
89
        target.eUnset((EStructuralFeature) arguments.get(0));
90
        return null;
91
      case 14: // EcorePackage.EOBJECT___ECALL__OPERATION__ARGUMENTS
92
        return target.eCall((EOperation) arguments.get(0), (EList<?>) arguments.get(1));
93
      }
94
    }
95
    
96
    throw new UnsupportedOperationException("eCall not implemented for " + eOperation.getName());
97
  }
98
99
}

Return to bug 255469