Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 148791 Details for
Bug 255469
Investigate support for dynamic EOperation call API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch, based on HEAD
255469.patch (text/plain), 62.02 KB, created by
Kenn Hussey
on 2009-10-05 11:26:20 EDT
(
hide
)
Description:
updated patch, based on HEAD
Filename:
MIME Type:
Creator:
Kenn Hussey
Created:
2009-10-05 11:26:20 EDT
Size:
62.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.test.core >Index: src/org/eclipse/emf/test/core/dynamic/SimpleModelTest.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/dynamic/SimpleModelTest.java,v >retrieving revision 1.18 >diff -u -r1.18 SimpleModelTest.java >--- src/org/eclipse/emf/test/core/dynamic/SimpleModelTest.java 22 Dec 2008 14:26:10 -0000 1.18 >+++ src/org/eclipse/emf/test/core/dynamic/SimpleModelTest.java 5 Oct 2009 15:05:10 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2007 IBM Corporation and others. >+ * Copyright (c) 2002-2009 IBM Corporation 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 >@@ -33,6 +33,7 @@ > import org.eclipse.emf.common.EMFPlugin; > import org.eclipse.emf.common.util.BasicEList; > import org.eclipse.emf.common.util.URI; >+import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EAttribute; > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EFactory; >@@ -62,6 +63,8 @@ > > private EAttribute employeeName; > >+ private EAttribute derivedEmployeeName; >+ > private EAttribute employeeManager; > > private EClass departmentClass; >@@ -82,6 +85,7 @@ > TestSuite ts = new TestSuite("SimpleModelTest"); > ts.addTest(new SimpleModelTest("testPackageAndFactory")); > ts.addTest(new SimpleModelTest("testAttributes")); >+ ts.addTest(new SimpleModelTest("testDerivedAttributes")); > ts.addTest(new SimpleModelTest("testReference")); > ts.addTest(new SimpleModelTest("testMetaData")); > ts.addTest(new SimpleModelTest("testSaveAndLoad")); >@@ -111,6 +115,18 @@ > employeeName.setEType(ecorePackage.getEString()); > employeeClass.getEStructuralFeatures().add(employeeName); > >+ derivedEmployeeName = ecoreFactory.createEAttribute(); >+ derivedEmployeeName.setName("derivedName"); >+ derivedEmployeeName.setEType(ecorePackage.getEString()); >+ derivedEmployeeName.setDerived(true); >+ derivedEmployeeName.setTransient(true); >+ EAnnotation eAnnotation = ecoreFactory.createEAnnotation(); >+ eAnnotation.setSource(EcorePackage.eNS_URI); >+ eAnnotation.getDetails().put("settingDelegate", "xxx"); >+ eAnnotation.getDetails().put("path", "name"); >+ derivedEmployeeName.getEAnnotations().add(eAnnotation); >+ employeeClass.getEStructuralFeatures().add(derivedEmployeeName); >+ > employeeManager = ecoreFactory.createEAttribute(); > employeeManager.setName("manager"); > employeeManager.setEType(ecorePackage.getEBoolean()); >@@ -204,6 +220,22 @@ > assertEquals(123, department.eGet(departmentNumber)); > } > >+ public void testDerivedAttributes() >+ { >+ EFactory companyFactory = companyPackage.getEFactoryInstance(); >+ >+ EObject employee1 = companyFactory.create(employeeClass); >+ employee1.eSet(employeeName, "John"); >+ assertEquals("John", employee1.eGet(derivedEmployeeName)); >+ assertEquals(Boolean.FALSE, employee1.eGet(employeeManager)); >+ >+ EObject employee2 = companyFactory.create(employeeClass); >+ employee2.eSet(derivedEmployeeName, "Katherine"); >+ assertEquals("Katherine", employee2.eGet(employeeName)); >+ employee2.eSet(employeeManager, Boolean.TRUE); >+ assertEquals(Boolean.TRUE, employee2.eGet(employeeManager)); >+ } >+ > public void testReference() > { > EFactory companyFactory = companyPackage.getEFactoryInstance(); >#P org.eclipse.emf.ecore >Index: src/org/eclipse/emf/ecore/EObject.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EObject.java,v >retrieving revision 1.11 >diff -u -r1.11 EObject.java >--- src/org/eclipse/emf/ecore/EObject.java 14 Jun 2007 18:32:46 -0000 1.11 >+++ src/org/eclipse/emf/ecore/EObject.java 5 Oct 2009 15:05:29 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -17,6 +18,8 @@ > package org.eclipse.emf.ecore; > > >+import java.lang.reflect.InvocationTargetException; >+ > import org.eclipse.emf.common.notify.Notifier; > import org.eclipse.emf.common.util.EList; > import org.eclipse.emf.common.util.TreeIterator; >@@ -427,4 +430,28 @@ > */ > void eUnset(EStructuralFeature feature); > >+ /** >+ * <!-- begin-user-doc --> >+ * <p> >+ * Calls the specified operation of the object. If the operation has >+ * parameters, then corresponding arguments must be supplied. There are no >+ * optional parameters in Ecore operations. >+ * </p><p> >+ * If the operation is a void operation, then on successful execution, the >+ * result of this call is <code>null</code>. Otherwise, if the operation is >+ * {@linkplain ETypedElement#isMany() nulti-valued}, then an {@link EList} >+ * is returned (possibly empty). If single-valued, then an instance of the >+ * operation's {@linkplain ETypedElement#getEType() type} is returned, or >+ * possibly <code>null</code>. >+ * </p><p> >+ * If the called operation fails with an >+ * {@linkplain EOperation#getEExceptions() exception}, then it is re-thrown, >+ * wrapped in an {@link InvocationTargetException}. >+ * </p> >+ * <!-- end-user-doc --> >+ * @model exceptions="org.eclipse.emf.ecore.EInvocationTargetException" argumentsMany="false" >+ * @generated >+ */ >+ Object eCall(EOperation operation, EList<?> arguments) throws InvocationTargetException; >+ > } >Index: src/org/eclipse/emf/ecore/EcorePackage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EcorePackage.java,v >retrieving revision 1.16 >diff -u -r1.16 EcorePackage.java >--- src/org/eclipse/emf/ecore/EcorePackage.java 27 Apr 2008 20:26:15 -0000 1.16 >+++ src/org/eclipse/emf/ecore/EcorePackage.java 5 Oct 2009 15:05:32 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -2389,6 +2390,16 @@ > > > /** >+ * The meta object id for the '<em>EInvocation Target Exception</em>' data type. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see java.lang.reflect.InvocationTargetException >+ * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInvocationTargetException() >+ * @generated >+ */ >+ int EINVOCATION_TARGET_EXCEPTION = 52; >+ >+ /** > * The meta object id for the '<em>EFeature Map Entry</em>' data type. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -3877,6 +3888,17 @@ > EDataType getETreeIterator(); > > /** >+ * Returns the meta object for data type '{@link java.lang.reflect.InvocationTargetException <em>EInvocation Target Exception</em>}'. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @return the meta object for data type '<em>EInvocation Target Exception</em>'. >+ * @see java.lang.reflect.InvocationTargetException >+ * @model instanceClass="java.lang.reflect.InvocationTargetException" >+ * @generated >+ */ >+ EDataType getEInvocationTargetException(); >+ >+ /** > * Returns the meta object for data type '{@link org.eclipse.emf.ecore.util.FeatureMap.Entry <em>EFeature Map Entry</em>}'. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >@@ -5103,6 +5125,16 @@ > */ > EDataType ETREE_ITERATOR = eINSTANCE.getETreeIterator(); > >+ /** >+ * The meta object literal for the '<em>EInvocation Target Exception</em>' data type. >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @see java.lang.reflect.InvocationTargetException >+ * @see org.eclipse.emf.ecore.impl.EcorePackageImpl#getEInvocationTargetException() >+ * @generated >+ */ >+ EDataType EINVOCATION_TARGET_EXCEPTION = eINSTANCE.getEInvocationTargetException(); >+ > } > > // Internal bootstrap uses Literals constants, so we must force initialization this inner interface first. >Index: src/org/eclipse/emf/ecore/EOperation.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EOperation.java,v >retrieving revision 1.8 >diff -u -r1.8 EOperation.java >--- src/org/eclipse/emf/ecore/EOperation.java 12 Jun 2007 15:07:48 -0000 1.8 >+++ src/org/eclipse/emf/ecore/EOperation.java 5 Oct 2009 15:05:29 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -17,6 +18,9 @@ > package org.eclipse.emf.ecore; > > >+import java.lang.reflect.InvocationTargetException; >+import java.util.HashMap; >+ > import org.eclipse.emf.common.util.EList; > > >@@ -126,4 +130,95 @@ > */ > EList<ETypeParameter> getETypeParameters(); > >+ /** >+ * Internal API implemented by all operations. >+ * >+ * @since 2.5 >+ */ >+ interface Internal extends EOperation, InternalEObject >+ { >+ /** >+ * A pluggable, dynamic implementation of operation behaviour. >+ */ >+ interface CallDelegate >+ { >+ /** >+ * A factory for creating call delegates. >+ */ >+ interface Factory >+ { >+ /** >+ * Creates the call delegate for the specified <tt>operation</tt>. >+ * >+ * @param operation the operation >+ * @return its call delegate >+ */ >+ CallDelegate createCallDelegate(EOperation operation); >+ >+ /** >+ * A registry of call-delegate factories. >+ */ >+ interface Registry >+ { >+ Registry INSTANCE = new Impl(); >+ >+ Factory getFactory(String key); >+ >+ void registerFactory(String key, Factory factory); >+ >+ void deregisterFactory(String key); >+ >+ class Impl extends HashMap<String, Factory> implements Registry >+ { >+ private static final long serialVersionUID = 1L; >+ >+ public Factory getFactory(String key) >+ { >+ return get(key); >+ } >+ >+ public void registerFactory(String key, Factory factory) >+ { >+ put(key, factory); >+ } >+ >+ public void deregisterFactory(String key) >+ { >+ remove(key); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Invokes the operation behaviour for the specified <tt>target</tt> >+ * object. >+ * >+ * @param target the object on which to call the operation >+ * @param arguments the arguments for the operation parameters (an >+ * empty list if the operation has no parameters) >+ * @return the operation's return result, or <code>null</code> if it is >+ * a void operation >+ * @throws InvocationTargetException in case of failure to execute the >+ * operation behaviour, usually because of an exception >+ */ >+ Object dynamicCall(InternalEObject target, EList<?> arguments) throws InvocationTargetException; >+ } >+ >+ /** >+ * Obtains the delegate for this operation. >+ * A default delegate is always available, so this should not return >+ * <code>null</code>. >+ * >+ * @return the operation delegate >+ */ >+ CallDelegate getCallDelegate(); >+ >+ /** >+ * Assigns a delegate to this operation. >+ * >+ * @param callDelegate the new operation delegate >+ */ >+ void setCallDelegate(CallDelegate callDelegate); >+ } > } //EOperation >Index: src/org/eclipse/emf/ecore/EStructuralFeature.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EStructuralFeature.java,v >retrieving revision 1.14 >diff -u -r1.14 EStructuralFeature.java >--- src/org/eclipse/emf/ecore/EStructuralFeature.java 14 Jun 2007 18:32:46 -0000 1.14 >+++ src/org/eclipse/emf/ecore/EStructuralFeature.java 5 Oct 2009 15:05:30 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 216701 Add support for mutating the delegate-factory registry > * > * </copyright> > * >@@ -17,7 +18,10 @@ > package org.eclipse.emf.ecore; > > >+import java.util.HashMap; >+ > import org.eclipse.emf.common.notify.NotificationChain; >+import org.eclipse.emf.ecore.util.PathSettingDelegate; > import org.eclipse.emf.ecore.util.FeatureMap; > > >@@ -365,6 +369,66 @@ > interface SettingDelegate > { > /** >+ * A factory for creating setting delegates. >+ * @since 2.5 >+ */ >+ interface Factory >+ { >+ /** >+ * Creates a setting delegate for the given feature. >+ * @param eStructuralFeature the feature for which a setting delegate is to be created. >+ * @return a new a setting delegate for the given feature. >+ */ >+ SettingDelegate createSettingDelegate(EStructuralFeature eStructuralFeature); >+ >+ /** >+ * A registry of factories for creating setting delegates. >+ */ >+ interface Registry >+ { >+ Registry INSTANCE = new Impl(); >+ >+ Factory getFactory(String key); >+ >+ void registerFactory(String key, Factory factory); >+ >+ void deregisterFactory(String key); >+ >+ class Impl extends HashMap<String, Factory> implements Registry >+ { >+ private static final long serialVersionUID = 1L; >+ >+ { >+ put >+ ("org.eclipse.emf.ecore.Path", >+ new Factory() >+ { >+ public SettingDelegate createSettingDelegate(EStructuralFeature eStructuralFeature) >+ { >+ return new PathSettingDelegate(eStructuralFeature); >+ } >+ }); >+ } >+ >+ public Factory getFactory(String key) >+ { >+ return get(key); >+ } >+ >+ public void registerFactory(String key, Factory factory) >+ { >+ put(key, factory); >+ } >+ >+ public void deregisterFactory(String key) >+ { >+ remove(key); >+ } >+ } >+ } >+ } >+ >+ /** > * Returns a setting that can be used to access the owner's feature. > * @param owner the owner of the feature. > * @param settings the owner's array of cached values. >Index: model/Ecore.ecore >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/model/Ecore.ecore,v >retrieving revision 1.16 >diff -u -r1.16 Ecore.ecore >--- model/Ecore.ecore 22 Dec 2008 19:51:05 -0000 1.16 >+++ model/Ecore.ecore 5 Oct 2009 15:05:28 -0000 >@@ -221,6 +221,14 @@ > <eOperations name="eUnset"> > <eParameters name="feature" eType="#//EStructuralFeature"/> > </eOperations> >+ <eOperations name="eCall" eType="#//EJavaObject" eExceptions="#//EInvocationTargetException"> >+ <eParameters name="operation" eType="#//EOperation"/> >+ <eParameters name="arguments"> >+ <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList"> >+ <eTypeArguments/> >+ </eGenericType> >+ </eParameters> >+ </eOperations> > </eClassifiers> > <eClassifiers xsi:type="ecore:EClass" name="EOperation" eSuperTypes="#//ETypedElement"> > <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> >@@ -495,4 +503,5 @@ > <eStructuralFeatures xsi:type="ecore:EReference" name="eBounds" upperBound="-1" > eType="#//EGenericType" containment="true" resolveProxies="false"/> > </eClassifiers> >+ <eClassifiers xsi:type="ecore:EDataType" name="EInvocationTargetException" instanceClassName="java.lang.reflect.InvocationTargetException"/> > </ecore:EPackage> >Index: model/EcoreAnnotations.ecorediag >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/model/EcoreAnnotations.ecorediag,v >retrieving revision 1.2 >diff -u -r1.2 EcoreAnnotations.ecorediag >--- model/EcoreAnnotations.ecorediag 14 Dec 2008 16:44:30 -0000 1.2 >+++ model/EcoreAnnotations.ecorediag 5 Oct 2009 15:05:29 -0000 >@@ -14,7 +14,7 @@ > </children> > <styles xmi:type="notation:ShapeStyle" xmi:id="_sFlvLT-OEd2DT6rVsxRmdQ" fontName="Microsoft Sans Serif" fontHeight="10" fillColor="13761016" lineColor="0"/> > <element xmi:type="ecore:EClass" href="Ecore.ecore#//EAnnotation"/> >- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sFlvLj-OEd2DT6rVsxRmdQ" x="114" y="312"/> >+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sFlvLj-OEd2DT6rVsxRmdQ" x="108" y="333"/> > </children> > <children xmi:type="notation:Node" xmi:id="_sFlvLz-OEd2DT6rVsxRmdQ" type="1001"> > <children xmi:type="notation:Node" xmi:id="_sFlvMD-OEd2DT6rVsxRmdQ" type="4001"/> >@@ -40,6 +40,66 @@ > <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvRD-OEd2DT6rVsxRmdQ"/> > </children> > <children xmi:type="notation:Node" xmi:id="_sFlvRT-OEd2DT6rVsxRmdQ" type="5002"> >+ <children xmi:type="notation:Node" xmi:id="_qywyMLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eClass"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qywyMbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyxZQLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eIsProxy"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZQbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyxZQrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eResource"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZQ7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyxZRLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainer"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZRbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyxZRrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainingFeature"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyxZR7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyyAULP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContainmentFeature"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAUbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyyAUrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eContents"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAU7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyyAVLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eAllContents"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAVbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyyAVrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eCrossReferences"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyyAV7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyynYLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eGet"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyynYbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyynYrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eGet.1"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyynY7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyzOcLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eSet"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOcbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyzOcrP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eIsSet"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOc7P2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_qyzOdLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eUnset"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_qyzOdbP2Ed2JrdFLh2Y_ww"/> >+ </children> >+ <children xmi:type="notation:Node" xmi:id="_xxmzoLP2Ed2JrdFLh2Y_ww" type="2002"> >+ <element xmi:type="ecore:EOperation" href="Ecore.ecore#//EObject/eCall"/> >+ <layoutConstraint xmi:type="notation:Location" xmi:id="_xxmzobP2Ed2JrdFLh2Y_ww"/> >+ </children> > <styles xmi:type="notation:DrawerStyle" xmi:id="_sFlvRj-OEd2DT6rVsxRmdQ"/> > <styles xmi:type="notation:SortingStyle" xmi:id="_sFlvRz-OEd2DT6rVsxRmdQ"/> > <styles xmi:type="notation:FilteringStyle" xmi:id="_sFlvSD-OEd2DT6rVsxRmdQ"/> >Index: model/EcoreDataTypes.ecorediag >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/model/EcoreDataTypes.ecorediag,v >retrieving revision 1.1 >diff -u -r1.1 EcoreDataTypes.ecorediag >--- model/EcoreDataTypes.ecorediag 2 Aug 2008 15:22:20 -0000 1.1 >+++ model/EcoreDataTypes.ecorediag 5 Oct 2009 15:05:29 -0000 >@@ -224,6 +224,13 @@ > <element xmi:type="ecore:EDataType" href="Ecore.ecore#//ETreeIterator"/> > <layoutConstraint xmi:type="notation:Bounds" xmi:id="_n9W90D-IEd2DT6rVsxRmdQ" x="408" y="228"/> > </children> >+ <children xmi:type="notation:Node" xmi:id="_z-RYILP5Ed2JrdFLh2Y_ww" type="1004"> >+ <children xmi:type="notation:Node" xmi:id="_z-VpkLP5Ed2JrdFLh2Y_ww" type="4008"/> >+ <children xmi:type="notation:Node" xmi:id="_z-VpkbP5Ed2JrdFLh2Y_ww" type="4009"/> >+ <styles xmi:type="notation:ShapeStyle" xmi:id="_z-RYIbP5Ed2JrdFLh2Y_ww" fontName="Lucida Grande" fontHeight="10" fillColor="13420443" lineColor="8421504"/> >+ <element xmi:type="ecore:EDataType" href="Ecore.ecore#//EInvocationTargetException"/> >+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_z-RYIrP5Ed2JrdFLh2Y_ww" x="-216" y="585"/> >+ </children> > <styles xmi:type="notation:DiagramStyle" xmi:id="_n9W90T-IEd2DT6rVsxRmdQ"/> > <element xmi:type="ecore:EPackage" href="Ecore.ecore#/"/> > </notation:Diagram> >Index: src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java,v >retrieving revision 1.29 >diff -u -r1.29 EcorePackageImpl.java >--- src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java 12 May 2009 15:54:45 -0000 1.29 >+++ src/org/eclipse/emf/ecore/impl/EcorePackageImpl.java 5 Oct 2009 15:05:37 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2007 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -17,6 +18,7 @@ > package org.eclipse.emf.ecore.impl; > > >+import java.lang.reflect.InvocationTargetException; > import java.math.BigDecimal; > import java.math.BigInteger; > import java.util.ArrayList; >@@ -410,6 +412,13 @@ > * <!-- end-user-doc --> > * @generated > */ >+ private EDataType eInvocationTargetExceptionEDataType = null; >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ > private EDataType eFeatureMapEntryEDataType = null; > > /** >@@ -1828,6 +1837,16 @@ > * <!-- end-user-doc --> > * @generated > */ >+ public EDataType getEInvocationTargetException() >+ { >+ return eInvocationTargetExceptionEDataType; >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ > public EDataType getEFeatureMapEntry() > { > return eFeatureMapEntryEDataType; >@@ -2067,6 +2086,7 @@ > eShortObjectEDataType = createEDataType(ESHORT_OBJECT); > eStringEDataType = createEDataType(ESTRING); > eTreeIteratorEDataType = createEDataType(ETREE_ITERATOR); >+ eInvocationTargetExceptionEDataType = createEDataType(EINVOCATION_TARGET_EXCEPTION); > } > > /** >@@ -2275,6 +2295,14 @@ > op = addEOperation(eObjectEClass, null, "eUnset", 0, 1, IS_UNIQUE, IS_ORDERED); > addEParameter(op, this.getEStructuralFeature(), "feature", 0, 1, IS_UNIQUE, IS_ORDERED); > >+ op = addEOperation(eObjectEClass, this.getEJavaObject(), "eCall", 0, 1, IS_UNIQUE, IS_ORDERED); >+ addEParameter(op, this.getEOperation(), "operation", 0, 1, IS_UNIQUE, IS_ORDERED); >+ g1 = createEGenericType(ecorePackage.getEEList()); >+ g2 = createEGenericType(); >+ g1.getETypeArguments().add(g2); >+ addEParameter(op, g1, "arguments", 0, 1, IS_UNIQUE, IS_ORDERED); >+ addEException(op, this.getEInvocationTargetException()); >+ > initEClass(eOperationEClass, EOperation.class, "EOperation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); > 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); > 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); >@@ -2380,6 +2408,7 @@ > initEDataType(eShortObjectEDataType, Short.class, "EShortObject", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); > initEDataType(eStringEDataType, String.class, "EString", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); > initEDataType(eTreeIteratorEDataType, TreeIterator.class, "ETreeIterator", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); >+ initEDataType(eInvocationTargetExceptionEDataType, InvocationTargetException.class, "EInvocationTargetException", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); > > // Create resource > createResource(eNS_URI); >Index: src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java,v >retrieving revision 1.16 >diff -u -r1.16 EcoreFactoryImpl.java >--- src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java 22 Dec 2008 14:24:54 -0000 1.16 >+++ src/org/eclipse/emf/ecore/impl/EcoreFactoryImpl.java 5 Oct 2009 15:05:36 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2006 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -17,6 +18,7 @@ > package org.eclipse.emf.ecore.impl; > > >+import java.lang.reflect.InvocationTargetException; > import java.math.BigDecimal; > import java.math.BigInteger; > import java.text.ParseException; >@@ -161,6 +163,8 @@ > return createEShortObjectFromString(eDataType, initialValue); > case EcorePackage.ESTRING: > return createEStringFromString(eDataType, initialValue); >+ case EcorePackage.EINVOCATION_TARGET_EXCEPTION: >+ return createEInvocationTargetExceptionFromString(eDataType, initialValue); > default: > throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); > } >@@ -222,6 +226,8 @@ > return convertEShortObjectToString(eDataType, instanceValue); > case EcorePackage.ESTRING: > return convertEStringToString(eDataType, instanceValue); >+ case EcorePackage.EINVOCATION_TARGET_EXCEPTION: >+ return convertEInvocationTargetExceptionToString(eDataType, instanceValue); > default: > throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); > } >@@ -654,6 +660,26 @@ > /** > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >+ * @generated >+ */ >+ public InvocationTargetException createEInvocationTargetExceptionFromString(EDataType eDataType, String initialValue) >+ { >+ return (InvocationTargetException)super.createFromString(eDataType, initialValue); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public String convertEInvocationTargetExceptionToString(EDataType eDataType, Object instanceValue) >+ { >+ return super.convertToString(eDataType, instanceValue); >+ } >+ >+ /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> > * @generated NOT > */ > public Integer createEIntFromString(EDataType metaObject, String initialValue) >Index: src/org/eclipse/emf/ecore/impl/EOperationImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EOperationImpl.java,v >retrieving revision 1.23 >diff -u -r1.23 EOperationImpl.java >--- src/org/eclipse/emf/ecore/impl/EOperationImpl.java 16 Jan 2009 12:55:11 -0000 1.23 >+++ src/org/eclipse/emf/ecore/impl/EOperationImpl.java 5 Oct 2009 15:05:34 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2002-2007 IBM Corporation and others. >+ * Copyright (c) 2002-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -28,6 +29,7 @@ > import org.eclipse.emf.common.notify.NotificationChain; > import org.eclipse.emf.common.notify.impl.NotificationImpl; > import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.common.util.URI; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EClassifier; >@@ -38,9 +40,11 @@ > import org.eclipse.emf.ecore.EcoreFactory; > import org.eclipse.emf.ecore.EcorePackage; > import org.eclipse.emf.ecore.InternalEObject; >+import org.eclipse.emf.ecore.util.BasicCallDelegate; > import org.eclipse.emf.ecore.util.DelegatingEcoreEList; > import org.eclipse.emf.ecore.util.EObjectContainmentEList; > import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; >+import org.eclipse.emf.ecore.util.EcoreUtil; > // import org.eclipse.emf.ecore.util.EObjectResolvingEList; > import org.eclipse.emf.ecore.util.InternalEList; > >@@ -48,6 +52,7 @@ > /** > * <!-- begin-user-doc --> > * An implementation of the model object '<em><b>EOperation</b></em>'. >+ * @extends EOperation.Internal > * <!-- end-user-doc --> > * <p> > * The following features are implemented: >@@ -62,7 +67,7 @@ > * > * @generated > */ >-public class EOperationImpl extends ETypedElementImpl implements EOperation >+public class EOperationImpl extends ETypedElementImpl implements EOperation, EOperation.Internal > { > /** > * The cached value of the '{@link #getETypeParameters() <em>EType Parameters</em>}' containment reference list. >@@ -1007,4 +1012,36 @@ > return eDynamicIsSet(featureID); > } > >+ protected EOperation.Internal.CallDelegate callDelegate; >+ >+ public CallDelegate getCallDelegate() >+ { >+ if (callDelegate == null) >+ { >+ CallDelegate.Factory factory = null; >+ String callDelegateKey = EcoreUtil.getAnnotation(this, EcorePackage.eNS_URI, >+ "callDelegate"); >+ if (callDelegateKey != null) >+ { >+ factory = CallDelegate.Factory.Registry.INSTANCE.getFactory( >+ URI.createURI(callDelegateKey).trimFragment().trimQuery().toString()); >+ } >+ if (factory != null) >+ { >+ callDelegate = factory.createCallDelegate(this); >+ } >+ if (callDelegate == null) >+ { >+ callDelegate = new BasicCallDelegate(this); >+ } >+ } >+ >+ return callDelegate; >+ } >+ >+ public void setCallDelegate(CallDelegate callDelegate) >+ { >+ this.callDelegate = callDelegate; >+ } >+ > } >Index: src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java,v >retrieving revision 1.39 >diff -u -r1.39 BasicEObjectImpl.java >--- src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java 16 Jan 2009 12:55:11 -0000 1.39 >+++ src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java 5 Oct 2009 15:05:33 -0000 >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -17,6 +18,7 @@ > package org.eclipse.emf.ecore.impl; > > >+import java.lang.reflect.InvocationTargetException; > import java.util.ArrayList; > import java.util.Iterator; > import java.util.List; >@@ -36,6 +38,7 @@ > import org.eclipse.emf.ecore.EDataType; > import org.eclipse.emf.ecore.EFactory; > import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EOperation; > import org.eclipse.emf.ecore.EReference; > import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.ETypedElement; >@@ -1995,6 +1998,12 @@ > } > } > >+ public Object eCall(EOperation operation, EList<?> arguments) throws InvocationTargetException >+ { >+ return ((EOperation.Internal) operation).getCallDelegate().dynamicCall(this, >+ arguments); >+ } >+ > @Override > public String toString() > { >Index: src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java,v >retrieving revision 1.39 >diff -u -r1.39 EStructuralFeatureImpl.java >--- src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java 7 Aug 2009 14:30:00 -0000 1.39 >+++ src/org/eclipse/emf/ecore/impl/EStructuralFeatureImpl.java 5 Oct 2009 15:05:35 -0000 >@@ -17,6 +17,12 @@ > package org.eclipse.emf.ecore.impl; > > >+import java.io.Externalizable; >+import java.io.IOException; >+import java.io.ObjectInput; >+import java.io.ObjectOutput; >+import java.io.ObjectStreamException; >+import java.io.Serializable; > import java.util.Collection; > import java.util.List; > import java.util.Map; >@@ -26,6 +32,7 @@ > import org.eclipse.emf.common.notify.impl.NotificationChainImpl; > import org.eclipse.emf.common.util.BasicEMap; > import org.eclipse.emf.common.util.EMap; >+import org.eclipse.emf.common.util.URI; > import org.eclipse.emf.ecore.EAnnotation; > import org.eclipse.emf.ecore.EClass; > import org.eclipse.emf.ecore.EClassifier; >@@ -33,6 +40,7 @@ > import org.eclipse.emf.ecore.EDataType; > import org.eclipse.emf.ecore.EFactory; > import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EPackage; > import org.eclipse.emf.ecore.EReference; > import org.eclipse.emf.ecore.EStructuralFeature; > import org.eclipse.emf.ecore.EcorePackage; >@@ -52,6 +60,7 @@ > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.ecore.util.ExtendedMetaData; > import org.eclipse.emf.ecore.util.FeatureMap; >+import org.eclipse.emf.ecore.util.FeatureMapUtil; > import org.eclipse.emf.ecore.util.InternalEList; > import org.eclipse.emf.ecore.xml.type.XMLTypePackage; > >@@ -816,10 +825,23 @@ > Object intrinsicDefaultValue = eType.getDefaultValue(); > > EStructuralFeature featureMapFeature; >- if (isDerived() && >- (((featureMapFeature = ExtendedMetaData.INSTANCE.getMixedFeature(eClass)) != null && >- featureMapFeature != this) || >- ((featureMapFeature = ExtendedMetaData.INSTANCE.getGroup(this)) != null))) >+ EAnnotation eAnnotation; >+ String settingDelegateKey; >+ SettingDelegate.Factory settingDelegateFactory; >+ boolean derived = isDerived(); >+ if (derived && >+ (eAnnotation = getEAnnotation(EcorePackage.eNS_URI)) != null && >+ (settingDelegateKey = eAnnotation.getDetails().get("settingDelegate")) != null && >+ (settingDelegateFactory = >+ SettingDelegate.Factory.Registry.INSTANCE.getFactory >+ (URI.createURI(settingDelegateKey).trimFragment().trimQuery().toString())) != null) >+ { >+ settingDelegate = settingDelegateFactory.createSettingDelegate(this); >+ } >+ else if (derived && >+ (((featureMapFeature = ExtendedMetaData.INSTANCE.getMixedFeature(eClass)) != null && >+ featureMapFeature != this) || >+ ((featureMapFeature = ExtendedMetaData.INSTANCE.getGroup(this)) != null))) > { > settingDelegate = new InternalSettingDelegateFeatureMapDelegator(this, featureMapFeature); > } >@@ -2892,7 +2914,7 @@ > return cachedIsFeatureMap; > } > >- public static abstract class BasicFeatureMapEntry implements FeatureMap.Entry.Internal >+ public static abstract class BasicFeatureMapEntry implements FeatureMap.Entry.Internal, Serializable > { > protected final EStructuralFeature.Internal eStructuralFeature; > >@@ -2973,6 +2995,50 @@ > eStructuralFeature.getName()) + > "=" + getValue(); > } >+ >+ protected static class WriteReplacement implements Externalizable >+ { >+ FeatureMap.Entry featureMapEntry; >+ >+ public WriteReplacement() >+ { >+ super(); >+ } >+ >+ public WriteReplacement(FeatureMap.Entry featureMapEntry) >+ { >+ this.featureMapEntry = featureMapEntry; >+ } >+ >+ public void writeExternal(ObjectOutput out) throws IOException >+ { >+ EStructuralFeature eStructuralFeature = featureMapEntry.getEStructuralFeature(); >+ EClass eClass = eStructuralFeature.getEContainingClass(); >+ out.writeUTF(eClass.getEPackage().getNsURI()); >+ out.writeUTF(eClass.getName()); >+ out.writeUTF(eStructuralFeature.getName()); >+ out.writeObject(featureMapEntry.getValue()); >+ } >+ >+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException >+ { >+ EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(in.readUTF()); >+ EClass eClass = (EClass)ePackage.getEClassifier(in.readUTF()); >+ EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(in.readUTF()); >+ Object value = in.readObject(); >+ featureMapEntry = FeatureMapUtil.createRawEntry(eStructuralFeature, value); >+ } >+ >+ private Object readResolve() >+ { >+ return featureMapEntry; >+ } >+ } >+ >+ public Object writeReplace() throws ObjectStreamException >+ { >+ return new WriteReplacement(this); >+ } > } > > public final static class SimpleFeatureMapEntry extends BasicFeatureMapEntry >Index: src/org/eclipse/emf/ecore/util/EcoreValidator.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/util/EcoreValidator.java,v >retrieving revision 1.38 >diff -u -r1.38 EcoreValidator.java >--- src/org/eclipse/emf/ecore/util/EcoreValidator.java 9 Aug 2009 09:49:54 -0000 1.38 >+++ src/org/eclipse/emf/ecore/util/EcoreValidator.java 5 Oct 2009 15:05:39 -0000 >@@ -1,7 +1,7 @@ > /** > * <copyright> > * >- * Copyright (c) 2006-2007 IBM Corporation and others. >+ * Copyright (c) 2006-2008 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 v1.0 > * which accompanies this distribution, and is available at >@@ -9,6 +9,7 @@ > * > * Contributors: > * IBM - Initial API and implementation >+ * Zeligsoft - 255469 Implement basic eCall support > * > * </copyright> > * >@@ -16,6 +17,7 @@ > */ > package org.eclipse.emf.ecore.util; > >+import java.lang.reflect.InvocationTargetException; > import java.math.BigDecimal; > import java.math.BigInteger; > >@@ -501,6 +503,8 @@ > return validateEString((String)value, diagnostics, context); > case EcorePackage.ETREE_ITERATOR: > return validateETreeIterator((TreeIterator<?>)value, diagnostics, context); >+ case EcorePackage.EINVOCATION_TARGET_EXCEPTION: >+ return validateEInvocationTargetException((InvocationTargetException)value, diagnostics, context); > default: > return true; > } >@@ -4087,6 +4091,16 @@ > } > > /** >+ * <!-- begin-user-doc --> >+ * <!-- end-user-doc --> >+ * @generated >+ */ >+ public boolean validateEInvocationTargetException(InvocationTargetException eInvocationTargetException, DiagnosticChain diagnostics, Map<Object, Object> context) >+ { >+ return true; >+ } >+ >+ /** > * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. > * <!-- begin-user-doc --> > * <!-- end-user-doc --> >Index: src/org/eclipse/emf/ecore/util/BasicSettingDelegate.java >=================================================================== >RCS file: src/org/eclipse/emf/ecore/util/BasicSettingDelegate.java >diff -N src/org/eclipse/emf/ecore/util/BasicSettingDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/ecore/util/BasicSettingDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,306 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2008 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 v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ * Zeligsoft - 216701 Removed redundant eStructuralFeature field from Stateless >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.ecore.util; >+ >+import org.eclipse.emf.common.notify.NotificationChain; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.emf.ecore.InternalEObject; >+import org.eclipse.emf.ecore.EStructuralFeature.Setting; >+import org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder; >+ >+/** >+ * A basic implementation of a stateful setting delegate. >+ * At least the first two of these methods needs to be overridden. >+ * <ul> >+ * <li>{@link #dynamicGet(InternalEObject, DynamicValueHolder, int, boolean, boolean)}</li> >+ * <li>{@link #dynamicIsSet(InternalEObject, DynamicValueHolder, int)}</li> >+ * <li>{@link #dynamicSet(InternalEObject, DynamicValueHolder, int, Object)}</li> >+ * <li>{@link #dynamicUnset(InternalEObject, DynamicValueHolder, int)}</li> >+ * <li>{@link #dynamicInverseAdd(InternalEObject, DynamicValueHolder, int, InternalEObject, NotificationChain)}</li> >+ * <li>{@link #dynamicInverseRemove(InternalEObject, DynamicValueHolder, int, InternalEObject, NotificationChain)}</li> >+ * </ul> >+ */ >+public abstract class BasicSettingDelegate implements EStructuralFeature.Internal.SettingDelegate >+{ >+ protected EStructuralFeature eStructuralFeature; >+ >+ public BasicSettingDelegate(EStructuralFeature eStructuralFeature) >+ { >+ this.eStructuralFeature = eStructuralFeature; >+ } >+ >+ public Setting dynamicSetting(final InternalEObject owner, final DynamicValueHolder settings, final int dynamicFeatureID) >+ { >+ return >+ new EStructuralFeature.Setting() >+ { >+ public EObject getEObject() >+ { >+ return owner; >+ } >+ >+ public EStructuralFeature getEStructuralFeature() >+ { >+ return eStructuralFeature; >+ } >+ >+ public Object get(boolean resolve) >+ { >+ return BasicSettingDelegate.this.dynamicGet(owner, settings, dynamicFeatureID, resolve, true); >+ } >+ >+ public boolean isSet() >+ { >+ return BasicSettingDelegate.this.dynamicIsSet(owner, settings, dynamicFeatureID); >+ } >+ >+ public void set(Object newValue) >+ { >+ BasicSettingDelegate.this.dynamicSet(owner, settings, dynamicFeatureID, newValue); >+ } >+ >+ public void unset() >+ { >+ BasicSettingDelegate.this.dynamicUnset(owner, settings, dynamicFeatureID); >+ } >+ }; >+ } >+ >+ public abstract Object dynamicGet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID, boolean resolve, boolean coreType); >+ >+ >+ public abstract boolean dynamicIsSet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID); >+ >+ >+ public void dynamicSet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID, Object newValue) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ public void dynamicUnset(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ public NotificationChain dynamicInverseAdd >+ (InternalEObject owner, >+ DynamicValueHolder settings, >+ int dynamicFeatureID, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ public NotificationChain dynamicInverseRemove >+ (InternalEObject owner, >+ DynamicValueHolder settings, >+ int dynamicFeatureID, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ /** >+ * A basic implementation of a stateless setting delegate. >+ * At least the first two of these methods should be overridden. >+ * <ul> >+ * <li>{@link #setting(InternalEObject)}</li> >+ * <li>{@link #get(InternalEObject, boolean, boolean)}</li> >+ * <li>{@link #set(InternalEObject, Object)}</li> >+ * <li>{@link #isSet(InternalEObject)}</li> >+ * <li>{@link #unset(InternalEObject)}</li> >+ * <li>{@link #inverseAdd(InternalEObject, InternalEObject, NotificationChain)}</li> >+ * <li>{@link #inverseRemove(InternalEObject, InternalEObject, NotificationChain)}</li> >+ * </ul> >+ */ >+ public static abstract class Stateless extends BasicSettingDelegate >+ { >+ public Stateless(EStructuralFeature eStructuralFeature) >+ { >+ super(eStructuralFeature); >+ } >+ >+ @Override >+ public final Setting dynamicSetting(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID) >+ { >+ return setting(owner); >+ } >+ >+ /** >+ * Creates a setting for the owner and this delegate's feature. >+ * @param owner the owner for the setting. >+ * @return a new setting. >+ */ >+ protected Setting setting(final InternalEObject owner) >+ { >+ return >+ new EStructuralFeature.Setting() >+ { >+ public EObject getEObject() >+ { >+ return owner; >+ } >+ >+ public EStructuralFeature getEStructuralFeature() >+ { >+ return eStructuralFeature; >+ } >+ >+ public Object get(boolean resolve) >+ { >+ return Stateless.this.get(owner, resolve, true); >+ } >+ >+ public boolean isSet() >+ { >+ return Stateless.this.isSet(owner); >+ } >+ >+ public void set(Object newValue) >+ { >+ Stateless.this.set(owner, newValue); >+ } >+ >+ public void unset() >+ { >+ Stateless.this.unset(owner); >+ } >+ }; >+ } >+ >+ @Override >+ public final Object dynamicGet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID, boolean resolve, boolean coreType) >+ { >+ return get(owner, resolve, coreType); >+ } >+ >+ /** >+ * Returns the value of this delegate's feature for the owner. >+ * @param owner the object for with to fetch the value. >+ * @param resolve whether the returned object should be resolved it if is a proxy. >+ * @param coreType whether to return the core type value or the API type value. >+ * @return the value of this delegate's feature for the owner. >+ * @see InternalEObject#eGet(EStructuralFeature, boolean, boolean) >+ */ >+ protected abstract Object get(InternalEObject owner, boolean resolve, boolean coreType); >+ >+ @Override >+ public final boolean dynamicIsSet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID) >+ { >+ return isSet(owner); >+ } >+ >+ /** >+ * Returns whether the value of this delegate's feature is considered set for the owner. >+ * @param owner the object for with to test is set. >+ * @return whether the value of this delegate's feature is considered set for the owner. >+ * @see EObject#eIsSet(EStructuralFeature) >+ */ >+ protected abstract boolean isSet(InternalEObject owner); >+ >+ @Override >+ public final void dynamicSet(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID, Object newValue) >+ { >+ set(owner, newValue); >+ } >+ >+ /** >+ * Sets this new value of this delegate's feature for the owner. >+ * @param owner the owner for which to set the value >+ * @param newValue the new value for the feature. >+ * @see EObject#eSet(EStructuralFeature, Object) >+ */ >+ protected void set(InternalEObject owner, Object newValue) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ @Override >+ public final void dynamicUnset(InternalEObject owner, DynamicValueHolder settings, int dynamicFeatureID) >+ { >+ unset(owner); >+ } >+ >+ /** >+ * Unsets the values of this delegate's feature for the owner. >+ * @param owner the owner for which to unset the value. >+ * @see EObject#eUnset(EStructuralFeature) >+ */ >+ protected void unset(InternalEObject owner) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ @Override >+ public final NotificationChain dynamicInverseAdd >+ (InternalEObject owner, >+ DynamicValueHolder settings, >+ int dynamicFeatureID, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ return inverseAdd(owner, otherEnd, notifications); >+ } >+ >+ /** >+ * Adds the object at the other end of a bidirectional reference to this delegate's feature >+ * and returns accumulated notifications. >+ * @param owner the owner for which to do the inverse add. >+ * @param otherEnd the object to inverse add. >+ * @param notifications the notifications accumulated so far. >+ * @return the accumulated notifications. >+ */ >+ protected NotificationChain inverseAdd >+ (InternalEObject owner, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ >+ @Override >+ public final NotificationChain dynamicInverseRemove >+ (InternalEObject owner, >+ DynamicValueHolder settings, >+ int dynamicFeatureID, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ return inverseRemove(owner, otherEnd, notifications); >+ } >+ >+ /** >+ * Remove the object at the other end of a bidirectional reference from this delegate's feature >+ * and returns accumulated notifications. >+ * @param owner the owner for which to do the inverse remove. >+ * @param otherEnd the object to inverse remove. >+ * @param notifications the notifications accumulated so far. >+ * @return the accumulated notifications. >+ */ >+ protected NotificationChain inverseRemove >+ (InternalEObject owner, >+ InternalEObject otherEnd, >+ NotificationChain notifications) >+ { >+ throw new UnsupportedOperationException(); >+ } >+ } >+} >Index: src/org/eclipse/emf/ecore/util/PathSettingDelegate.java >=================================================================== >RCS file: src/org/eclipse/emf/ecore/util/PathSettingDelegate.java >diff -N src/org/eclipse/emf/ecore/util/PathSettingDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/ecore/util/PathSettingDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,115 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2008 IBM Corporation 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: >+ * IBM - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+package org.eclipse.emf.ecore.util; >+ >+ >+import java.util.ArrayList; >+import java.util.List; >+ >+import org.eclipse.emf.common.util.URI; >+import org.eclipse.emf.ecore.EClass; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecore.InternalEObject; >+ >+public class PathSettingDelegate extends BasicSettingDelegate.Stateless >+{ >+ protected EStructuralFeature[] path; >+ >+ public PathSettingDelegate(EStructuralFeature eStructuralFeature) >+ { >+ super(eStructuralFeature); >+ String namePath = URI.createURI(eStructuralFeature.getEAnnotation(EcorePackage.eNS_URI).getDetails().get("settingDelegate")).fragment(); >+ String[] segments = namePath.split("/"); >+ path = new EStructuralFeature[segments.length]; >+ for (int i = 0; i < segments.length; ++i) >+ { >+ String featureName = segments[i]; >+ EClass eClass = i == 0 ? eStructuralFeature.getEContainingClass() : (EClass)path[i - 1].getEType(); >+ path[i] = eClass.getEStructuralFeature(featureName); >+ } >+ } >+ >+ public PathSettingDelegate(EStructuralFeature eStructuralFeature, EStructuralFeature[] path) >+ { >+ super(eStructuralFeature); >+ this.path = path; >+ } >+ >+ @Override >+ protected Object get(InternalEObject owner, boolean resolve, boolean coreType) >+ { >+ InternalEObject eObject = owner; >+ for (int i = 0, limit = path.length - 1; i < limit; ++i) >+ { >+ EStructuralFeature feature = path[i]; >+ if (feature.isMany()) >+ { >+ ArrayList<Object> result = new ArrayList<Object>(); >+ @SuppressWarnings("unchecked") >+ List<EObject> elements = (List<EObject>)eObject.eGet(feature, resolve, coreType); >+ for (EObject element : elements) >+ { >+ Object value = element.eGet(path[i + 1]); >+ result.add(value); >+ } >+ return >+ new EcoreEList.UnmodifiableEList.FastCompare<Object> >+ (owner, eStructuralFeature, result.size(), result.toArray()); >+ } >+ else >+ { >+ eObject = (InternalEObject)eObject.eGet(feature); >+ } >+ } >+ return eObject.eGet(path[path.length - 1], resolve, coreType); >+ } >+ >+ @Override >+ protected boolean isSet(InternalEObject owner) >+ { >+ InternalEObject eObject = owner; >+ for (int i = 0, limit = path.length - 1; i < limit; ++i) >+ { >+ eObject = (InternalEObject)eObject.eGet(path[i]); >+ } >+ return eObject.eIsSet(path[path.length - 1]); >+ } >+ >+ @Override >+ protected void set(InternalEObject owner, Object newValue) >+ { >+ InternalEObject eObject = owner; >+ for (int i = 0, limit = path.length - 1; i < limit; ++i) >+ { >+ eObject = (InternalEObject)eObject.eGet(path[i]); >+ } >+ eObject.eSet(path[path.length - 1], newValue); >+ } >+ >+ @Override >+ protected void unset(InternalEObject owner) >+ { >+ InternalEObject eObject = owner; >+ for (int i = 0, limit = path.length - 1; i < limit; ++i) >+ { >+ eObject = (InternalEObject)eObject.eGet(path[i]); >+ } >+ eObject.eUnset(path[path.length - 1]); >+ } >+} >Index: src/org/eclipse/emf/ecore/util/BasicCallDelegate.java >=================================================================== >RCS file: src/org/eclipse/emf/ecore/util/BasicCallDelegate.java >diff -N src/org/eclipse/emf/ecore/util/BasicCallDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/emf/ecore/util/BasicCallDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,99 @@ >+/** >+ * <copyright> >+ * >+ * Copyright (c) 2008 Zeligsoft 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: >+ * Zeligsoft - Initial API and implementation >+ * >+ * </copyright> >+ * >+ * $Id$ >+ */ >+ >+package org.eclipse.emf.ecore.util; >+ >+import java.lang.reflect.InvocationTargetException; >+ >+import org.eclipse.emf.common.util.EList; >+import org.eclipse.emf.ecore.EObject; >+import org.eclipse.emf.ecore.EStructuralFeature; >+import org.eclipse.emf.ecore.EcorePackage; >+import org.eclipse.emf.ecore.InternalEObject; >+import org.eclipse.emf.ecore.EOperation; >+ >+ >+/** >+ * A basic implementation of the dynamic operation-call delegate API. In fact, >+ * it is so basic that it isn't much an implementation at all, but merely >+ * throws {@link UnsupportedOperationException} on every invocation, except for >+ * the operations define for the {@link EObject} class. >+ * Subclasses should override the {@link #dynamicCall(InternalEObject, EList)} >+ * method to not do that. >+ */ >+public class BasicCallDelegate implements EOperation.Internal.CallDelegate >+{ >+ protected EOperation eOperation; >+ >+ /** >+ * Initializes me with the operation that delegates calls to me. >+ * >+ * @param operation my operation >+ */ >+ public BasicCallDelegate(EOperation operation) >+ { >+ this.eOperation = operation; >+ } >+ >+ public Object dynamicCall(InternalEObject target, EList<?> arguments) throws InvocationTargetException >+ { >+ if (eOperation.getEContainingClass() == EcorePackage.Literals.EOBJECT) >+ { >+ //TODO: EOperations should have IDs, like structural features. >+ // These IDs should be listed in the generated package interface >+ int id = eOperation.getEContainingClass().getEAllOperations().indexOf(eOperation); >+ >+ switch (id) { >+ case 0: // EcorePackage.EOBJECT___ECLASS >+ return target.eClass(); >+ case 1: // EcorePackage.EOBJECT___EIS_PROXY >+ return target.eIsProxy(); >+ case 2: // EcorePackage.EOBJECT___ERESOURCE >+ return target.eResource(); >+ case 3: // EcorePackage.EOBJECT___ECONTAINER >+ return target.eContainer(); >+ case 4: // EcorePackage.EOBJECT___ECONTAINING_FEATURE >+ return target.eContainingFeature(); >+ case 5: // EcorePackage.EOBJECT___ECONTAINMENT_FEATURE >+ return target.eContainmentFeature(); >+ case 6: // EcorePackage.EOBJECT___ECONTENTS >+ return target.eContents(); >+ case 7: // EcorePackage.EOBJECT___EALL_CONTENTS >+ return target.eAllContents(); >+ case 8: // EcorePackage.EOBJECT___ECROSS_REFERENCES >+ return target.eCrossReferences(); >+ case 9: // EcorePackage.EOBJECT___EGET__FEATURE >+ return target.eGet((EStructuralFeature) arguments.get(0)); >+ case 10: // EcorePackage.EOBJECT___EGET__FEATURE__RESOLVE >+ return target.eGet((EStructuralFeature) arguments.get(0), (Boolean) arguments.get(1)); >+ case 11: // EcorePackage.EOBJECT___ESET__FEATURE__NEW_VALUE >+ target.eSet((EStructuralFeature) arguments.get(0), arguments.get(1)); >+ return null; >+ case 12: // EcorePackage.EOBJECT___EIS_SET__FEATURE >+ return target.eIsSet((EStructuralFeature) arguments.get(0)); >+ case 13: // EcorePackage.EOBJECT___EUNSET__FEATURE >+ target.eUnset((EStructuralFeature) arguments.get(0)); >+ return null; >+ case 14: // EcorePackage.EOBJECT___ECALL__OPERATION__ARGUMENTS >+ return target.eCall((EOperation) arguments.get(0), (EList<?>) arguments.get(1)); >+ } >+ } >+ >+ throw new UnsupportedOperationException("eCall not implemented for " + eOperation.getName()); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255469
:
118008
|
118009
|
148791
|
149767
|
150408
|
150693
|
151088
|
155103