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 387689
Collapse All | Expand All

(-)plugins/org.eclipse.emf.common/src/org/eclipse/emf/common/notify/impl/NotificationImpl.java (-32 / +112 lines)
Lines 874-971 public class NotificationImpl implements Notification, NotificationChain Link Here
874
874
875
  public boolean getOldBooleanValue()
875
  public boolean getOldBooleanValue()
876
  {
876
  {
877
    if (primitiveType != PRIMITIVE_TYPE_BOOLEAN) throw new IllegalStateException();
877
    if (primitiveType == PRIMITIVE_TYPE_BOOLEAN) 
878
    return oldSimplePrimitiveValue != 0;
878
    	return oldSimplePrimitiveValue != 0;
879
880
    if (oldValue instanceof Boolean) 
881
		return ((Boolean) oldValue).booleanValue();
882
883
    throw new IllegalStateException();
879
  }
884
  }
880
885
881
  public boolean getNewBooleanValue()
886
  public boolean getNewBooleanValue()
882
  {
887
  {
883
    if (primitiveType != PRIMITIVE_TYPE_BOOLEAN) throw new IllegalStateException();
888
    if (primitiveType == PRIMITIVE_TYPE_BOOLEAN) 
884
    return newSimplePrimitiveValue != 0;
889
    	return newSimplePrimitiveValue != 0;
890
891
    if (newValue instanceof Boolean) 
892
		return ((Boolean) newValue).booleanValue();
893
    
894
    throw new IllegalStateException();
885
  }
895
  }
886
896
887
  public byte getOldByteValue()
897
  public byte getOldByteValue()
888
  {
898
  {
889
    if (primitiveType != PRIMITIVE_TYPE_BYTE) throw new IllegalStateException();
899
    if (primitiveType == PRIMITIVE_TYPE_BYTE)
890
    return (byte)oldSimplePrimitiveValue;
900
    	return (byte)oldSimplePrimitiveValue;
901
902
    if (oldValue instanceof Byte) 
903
		return ((Byte) oldValue).byteValue();
904
    
905
    throw new IllegalStateException();
891
  }
906
  }
892
907
893
  public byte getNewByteValue()
908
  public byte getNewByteValue()
894
  {
909
  {
895
    if (primitiveType != PRIMITIVE_TYPE_BYTE) throw new IllegalStateException();
910
    if (primitiveType == PRIMITIVE_TYPE_BYTE)
896
    return (byte)newSimplePrimitiveValue;
911
    	return (byte)newSimplePrimitiveValue;
912
913
    if (newValue instanceof Byte) 
914
		return ((Byte) newValue).byteValue();
915
916
	throw new IllegalStateException();
897
  }
917
  }
898
918
899
  public char getOldCharValue()
919
  public char getOldCharValue()
900
  {
920
  {
901
    if (primitiveType != PRIMITIVE_TYPE_CHAR) throw new IllegalStateException();
921
    if (primitiveType == PRIMITIVE_TYPE_CHAR)
902
    return (char)oldSimplePrimitiveValue;
922
    	return (char)oldSimplePrimitiveValue;
923
924
    if (oldValue instanceof Character) 
925
		return ((Character) oldValue).charValue();
926
    
927
    throw new IllegalStateException();
903
  }
928
  }
904
929
905
  public char getNewCharValue()
930
  public char getNewCharValue()
906
  {
931
  {
907
    if (primitiveType != PRIMITIVE_TYPE_CHAR) throw new IllegalStateException();
932
    if (primitiveType == PRIMITIVE_TYPE_CHAR)
908
    return (char)newSimplePrimitiveValue;
933
    	return (char)newSimplePrimitiveValue;
934
    	
935
    if (newValue instanceof Character) 
936
		return ((Character) newValue).charValue();
937
    
938
	throw new IllegalStateException();
909
  }
939
  }
910
940
911
  public double getOldDoubleValue()
941
  public double getOldDoubleValue()
912
  {
942
  {
913
    if (primitiveType != PRIMITIVE_TYPE_DOUBLE) throw new IllegalStateException();
943
    if (primitiveType == PRIMITIVE_TYPE_DOUBLE)
914
    return oldIEEEPrimitiveValue;
944
    	return oldIEEEPrimitiveValue;
945
    
946
    if (oldValue instanceof Double) 
947
		return ((Double) oldValue).doubleValue();
948
    
949
	throw new IllegalStateException();
915
  }
950
  }
916
951
917
  public double getNewDoubleValue()
952
  public double getNewDoubleValue()
918
  {
953
  {
919
    if (primitiveType != PRIMITIVE_TYPE_DOUBLE) throw new IllegalStateException();
954
    if (primitiveType == PRIMITIVE_TYPE_DOUBLE) 
920
    return newIEEEPrimitiveValue;
955
    	return newIEEEPrimitiveValue;
956
    
957
    if (newValue instanceof Double) 
958
		return ((Double) newValue).doubleValue();
959
    
960
	throw new IllegalStateException();
921
  }
961
  }
922
962
923
  public float getOldFloatValue()
963
  public float getOldFloatValue()
924
  {
964
  {
925
    if (primitiveType != PRIMITIVE_TYPE_FLOAT) throw new IllegalStateException();
965
    if (primitiveType == PRIMITIVE_TYPE_FLOAT) 
926
    return (float)oldIEEEPrimitiveValue;
966
    	return (float)oldIEEEPrimitiveValue;
967
968
    if (oldValue instanceof Float) 
969
		return ((Float) oldValue).floatValue();
970
971
	throw new IllegalStateException();
927
  }
972
  }
928
973
929
  public float getNewFloatValue()
974
  public float getNewFloatValue()
930
  {
975
  {
931
    if (primitiveType != PRIMITIVE_TYPE_FLOAT) throw new IllegalStateException();
976
    if (primitiveType == PRIMITIVE_TYPE_FLOAT)
932
    return (float)newIEEEPrimitiveValue;
977
    	return (float)newIEEEPrimitiveValue;
978
979
    if (newValue instanceof Float) 
980
		return ((Float) newValue).floatValue();
981
    
982
    throw new IllegalStateException();
933
  }
983
  }
934
984
935
  public int getOldIntValue()
985
  public int getOldIntValue()
936
  {
986
  {
937
    if (primitiveType != PRIMITIVE_TYPE_INT) throw new IllegalStateException();
987
    if (primitiveType == PRIMITIVE_TYPE_INT) 
938
    return (int)oldSimplePrimitiveValue;
988
    	return (int)oldSimplePrimitiveValue;
989
990
    if (oldValue instanceof Integer) 
991
		return ((Integer) oldValue).intValue();
992
993
    throw new IllegalStateException();
939
  }
994
  }
940
995
941
  public int getNewIntValue()
996
  public int getNewIntValue()
942
  {
997
  {
943
    if (primitiveType != PRIMITIVE_TYPE_INT) throw new IllegalStateException();
998
    if (primitiveType == PRIMITIVE_TYPE_INT) 
944
    return (int)newSimplePrimitiveValue;
999
    	return (int)newSimplePrimitiveValue;
1000
    
1001
    if (newValue instanceof Integer) 
1002
		return ((Integer) newValue).intValue();
1003
1004
    throw new IllegalStateException();
945
  }
1005
  }
946
1006
947
  public long getOldLongValue()
1007
  public long getOldLongValue()
948
  {
1008
  {
949
    if (primitiveType != PRIMITIVE_TYPE_LONG) throw new IllegalStateException();
1009
    if (primitiveType == PRIMITIVE_TYPE_LONG) 
950
    return oldSimplePrimitiveValue;
1010
    	return oldSimplePrimitiveValue;
1011
    
1012
    if (oldValue instanceof Long) 
1013
		return ((Long) oldValue).longValue();
1014
    
1015
    throw new IllegalStateException();
951
  }
1016
  }
952
1017
953
  public long getNewLongValue()
1018
  public long getNewLongValue()
954
  {
1019
  {
955
    if (primitiveType != PRIMITIVE_TYPE_LONG) throw new IllegalStateException();
1020
    if (primitiveType == PRIMITIVE_TYPE_LONG) 
956
    return newSimplePrimitiveValue;
1021
    	return newSimplePrimitiveValue;
1022
    
1023
    if (newValue instanceof Long) 
1024
		return ((Long) newValue).longValue();
1025
    
1026
    throw new IllegalStateException();
957
  }
1027
  }
958
1028
959
  public short getOldShortValue()
1029
  public short getOldShortValue()
960
  {
1030
  {
961
    if (primitiveType != PRIMITIVE_TYPE_SHORT) throw new IllegalStateException();
1031
    if (primitiveType == PRIMITIVE_TYPE_SHORT) 
962
    return (short)oldSimplePrimitiveValue;
1032
    	return (short)oldSimplePrimitiveValue;
1033
    
1034
    if (oldValue instanceof Short) 
1035
		return ((Short) oldValue).shortValue();
1036
    
1037
    throw new IllegalStateException();
963
  }
1038
  }
964
1039
965
  public short getNewShortValue()
1040
  public short getNewShortValue()
966
  {
1041
  {
967
    if (primitiveType != PRIMITIVE_TYPE_SHORT) throw new IllegalStateException();
1042
    if (primitiveType == PRIMITIVE_TYPE_SHORT) 
968
    return (short)newSimplePrimitiveValue;
1043
    	return (short)newSimplePrimitiveValue;
1044
    
1045
    if (newValue instanceof Short) 
1046
		return ((Short) newValue).shortValue();
1047
    
1048
	throw new IllegalStateException();
969
  }
1049
  }
970
1050
971
  public String getOldStringValue()
1051
  public String getOldStringValue()
(-)tests/org.eclipse.emf.test.common/META-INF/MANIFEST.MF (+4 lines)
Lines 23-28 Export-Package: org.eclipse.emf.test.common, Link Here
23
 org.eclipse.emf.test.models.dbprice,
23
 org.eclipse.emf.test.models.dbprice,
24
 org.eclipse.emf.test.models.dbprice.impl,
24
 org.eclipse.emf.test.models.dbprice.impl,
25
 org.eclipse.emf.test.models.dbprice.util,
25
 org.eclipse.emf.test.models.dbprice.util,
26
 org.eclipse.emf.test.models.dynamicDelegation,
27
 org.eclipse.emf.test.models.dynamicDelegation.impl,
28
 org.eclipse.emf.test.models.dynamicDelegation.impl.none,
29
 org.eclipse.emf.test.models.dynamicDelegation.util,
26
 org.eclipse.emf.test.models.ext,
30
 org.eclipse.emf.test.models.ext,
27
 org.eclipse.emf.test.models.ext.impl,
31
 org.eclipse.emf.test.models.ext.impl,
28
 org.eclipse.emf.test.models.ext.provider,
32
 org.eclipse.emf.test.models.ext.provider,
(-)tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.ecore (+19 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ecore:EPackage xmi:version="2.0"
3
    xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="dynamicDelegation"
5
    nsURI="http:///org.eclipse.emf.test.models/DynamicDelegation" nsPrefix="dynamicDelegation">
6
  <eClassifiers xsi:type="ecore:EClass" name="Class0">
7
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
8
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testByte" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EByte"/>
9
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testChar" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EChar"/>
10
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testDouble" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDouble"/>
11
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testFloat" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
12
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testInt" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
13
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testLong" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
14
    <eStructuralFeatures xsi:type="ecore:EAttribute" name="testShort" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EShort"/>
15
    <eStructuralFeatures xsi:type="ecore:EReference" name="class1" eType="#//Class1"
16
        containment="true"/>
17
  </eClassifiers>
18
  <eClassifiers xsi:type="ecore:EClass" name="Class1"/>
19
</ecore:EPackage>
(-)tests/org.eclipse.emf.test.common/models/dynamicDelegation/dynamicDelegation.genmodel (+23 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<genmodel:GenModel xmi:version="2.0"
3
    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
4
    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.test.common/src"
5
    modelPluginID="org.eclipse.emf.test.common" modelName="DynamicDelegation" importerID="org.eclipse.emf.importer.ecore"
6
    featureDelegation="Dynamic" complianceLevel="5.0" copyrightFields="false">
7
  <foreignModel>dynamicDelegation.ecore</foreignModel>
8
  <genPackages prefix="DynamicDelegation" basePackage="org.eclipse.emf.test.models"
9
      disposableProviderFactory="true" ecorePackage="dynamicDelegation.ecore#/">
10
    <genClasses ecoreClass="dynamicDelegation.ecore#//Class0">
11
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testBoolean"/>
12
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testByte"/>
13
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testChar"/>
14
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testDouble"/>
15
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testFloat"/>
16
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testInt"/>
17
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testLong"/>
18
      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute dynamicDelegation.ecore#//Class0/testShort"/>
19
      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference dynamicDelegation.ecore#//Class0/class1"/>
20
    </genClasses>
21
    <genClasses ecoreClass="dynamicDelegation.ecore#//Class1"/>
22
  </genPackages>
23
</genmodel:GenModel>
(-)tests/org.eclipse.emf.test.common/plugin.xml (+14 lines)
Lines 12-17 Link Here
12
       class = "org.eclipse.emf.test.models.lib.LibPackage"
12
       class = "org.eclipse.emf.test.models.lib.LibPackage"
13
       genModel = "models/crossresourcecontainment.SimpleLib/SimpleLib.genmodel" /> 
13
       genModel = "models/crossresourcecontainment.SimpleLib/SimpleLib.genmodel" /> 
14
14
15
    <!-- Dynamic Delegation -->
16
17
    <package 
18
       uri = "http:///org.eclipse.emf.test.models/DynamicDelegation" 
19
       class = "org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage"
20
       genModel = "models/dynamicDelegation/dynamicDelegation.genmodel" /> 
21
15
    <!-- edit.RefTest -->
22
    <!-- edit.RefTest -->
16
23
17
    <package 
24
    <package 
Lines 105-110 Link Here
105
       class = "org.eclipse.emf.test.models.switch3.Switch3Package"
112
       class = "org.eclipse.emf.test.models.switch3.Switch3Package"
106
       genModel = "models/Switch/switch.genmodel" /> 
113
       genModel = "models/Switch/switch.genmodel" /> 
107
114
115
    <!-- Dynamic Delegation -->
116
117
    <package 
118
       uri = "http:///org.eclipse.emf.test.models/DynamicDelegation" 
119
       class = "org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage"
120
       genModel = "models/dynamicDelegation/dynamicDelegation.genmodel" /> 
121
108
  </extension>
122
  </extension>
109
123
110
  <extension point="org.eclipse.emf.ecore.extension_parser">
124
  <extension point="org.eclipse.emf.ecore.extension_parser">
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/common/templates/DiagnosticTestGen.java (-170 / +170 lines)
Lines 1-170 Link Here
1
package org.eclipse.emf.test.common.templates;
1
package org.eclipse.emf.test.common.templates;
2
2
3
import java.util.*;
3
import java.util.*;
4
import org.eclipse.emf.common.util.*;
4
import org.eclipse.emf.common.util.*;
5
5
6
public class DiagnosticTestGen
6
public class DiagnosticTestGen
7
{
7
{
8
  protected static String nl;
8
  protected static String nl;
9
  public static synchronized DiagnosticTestGen create(String lineSeparator)
9
  public static synchronized DiagnosticTestGen create(String lineSeparator)
10
  {
10
  {
11
    nl = lineSeparator;
11
    nl = lineSeparator;
12
    DiagnosticTestGen result = new DiagnosticTestGen();
12
    DiagnosticTestGen result = new DiagnosticTestGen();
13
    nl = null;
13
    nl = null;
14
    return result;
14
    return result;
15
  }
15
  }
16
16
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String TEXT_1 = NL + "import java.util.Iterator;" + NL + "" + NL + "import junit.framework.Test;" + NL + "import junit.framework.TestCase;" + NL + "import junit.framework.TestSuite;" + NL + "" + NL + "import org.eclipse.emf.common.util.AbstractTreeIterator;" + NL + "import org.eclipse.emf.common.util.Diagnostic;" + NL + "import org.eclipse.emf.common.util.TreeIterator;" + NL + "import org.eclipse.emf.common.util.URI;" + NL + "import org.eclipse.emf.ecore.EPackage;" + NL + "import org.eclipse.emf.ecore.resource.Resource;" + NL + "import org.eclipse.emf.ecore.util.Diagnostician;" + NL + "import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;" + NL + "import org.eclipse.emf.test.common.TestUtil;" + NL + "" + NL + "public class ";
18
  protected final String TEXT_1 = NL + "import java.util.Iterator;" + NL + "" + NL + "import junit.framework.Test;" + NL + "import junit.framework.TestCase;" + NL + "import junit.framework.TestSuite;" + NL + "" + NL + "import org.eclipse.emf.common.util.AbstractTreeIterator;" + NL + "import org.eclipse.emf.common.util.Diagnostic;" + NL + "import org.eclipse.emf.common.util.TreeIterator;" + NL + "import org.eclipse.emf.common.util.URI;" + NL + "import org.eclipse.emf.ecore.EPackage;" + NL + "import org.eclipse.emf.ecore.resource.Resource;" + NL + "import org.eclipse.emf.ecore.util.Diagnostician;" + NL + "import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;" + NL + "import org.eclipse.emf.test.common.TestUtil;" + NL + "" + NL + "public class ";
19
  protected final String TEXT_2 = "DiagnosticTest extends TestCase" + NL + "{" + NL + "\tprotected Diagnostic diagnostic;" + NL + "\t" + NL + "\tpublic ";
19
  protected final String TEXT_2 = "DiagnosticTest extends TestCase" + NL + "{" + NL + "\tprotected Diagnostic diagnostic;" + NL + "\t" + NL + "\tpublic ";
20
  protected final String TEXT_3 = "DiagnosticTest(String name)" + NL + "\t{" + NL + "\t\tsuper(name);" + NL + "\t}" + NL + "\t" + NL + "\tpublic static Test suite()" + NL + "\t{" + NL + "\t\tTestSuite ts = new TestSuite(\"DianosticTest\");" + NL + "\t\tts.addTest(new ";
20
  protected final String TEXT_3 = "DiagnosticTest(String name)" + NL + "\t{" + NL + "\t\tsuper(name);" + NL + "\t}" + NL + "\t" + NL + "\tpublic static Test suite()" + NL + "\t{" + NL + "\t\tTestSuite ts = new TestSuite(\"DianosticTest\");" + NL + "\t\tts.addTest(new ";
21
  protected final String TEXT_4 = "DiagnosticTest(\"testDiagnostic\"));" + NL + "\t\treturn ts;" + NL + "\t}" + NL + "\t" + NL + "\t@Override" + NL + "\tprotected void setUp() throws Exception" + NL + "\t{" + NL + "\t\t//TODO:Instantiates the diagnostic here" + NL + "\t\t" + NL + "\t\tassertNotNull(diagnostic);" + NL + "\t}" + NL + "\t" + NL + "\tpublic void testDiagnostic() throws Exception" + NL + "\t{" + NL + "\t\tTreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(diagnostic)" + NL + "\t\t{" + NL + "\t\t\tprivate static final long serialVersionUID = 1L;" + NL + "\t\t\t@Override" + NL + "\t\t\tprotected Iterator<? extends Diagnostic> getChildren(Object object)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn ((Diagnostic)object).getChildren().iterator();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t";
21
  protected final String TEXT_4 = "DiagnosticTest(\"testDiagnostic\"));" + NL + "\t\treturn ts;" + NL + "\t}" + NL + "\t" + NL + "\t@Override" + NL + "\tprotected void setUp() throws Exception" + NL + "\t{" + NL + "\t\t//TODO:Instantiates the diagnostic here" + NL + "\t\t" + NL + "\t\tassertNotNull(diagnostic);" + NL + "\t}" + NL + "\t" + NL + "\tpublic void testDiagnostic() throws Exception" + NL + "\t{" + NL + "\t\tTreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(diagnostic)" + NL + "\t\t{" + NL + "\t\t\tprivate static final long serialVersionUID = 1L;" + NL + "\t\t\t@Override" + NL + "\t\t\tprotected Iterator<? extends Diagnostic> getChildren(Object object)" + NL + "\t\t\t{" + NL + "\t\t\t\treturn ((Diagnostic)object).getChildren().iterator();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t";
22
  protected final String TEXT_5 = NL + "\t\tDiagnostic diagnostic";
22
  protected final String TEXT_5 = NL + "\t\tDiagnostic diagnostic";
23
  protected final String TEXT_6 = " = diagnosticIterator.next();" + NL + "\t\tassertEquals(";
23
  protected final String TEXT_6 = " = diagnosticIterator.next();" + NL + "\t\tassertEquals(";
24
  protected final String TEXT_7 = ", diagnostic";
24
  protected final String TEXT_7 = ", diagnostic";
25
  protected final String TEXT_8 = ".getSeverity());" + NL + "\t\tassertEquals(";
25
  protected final String TEXT_8 = ".getSeverity());" + NL + "\t\tassertEquals(";
26
  protected final String TEXT_9 = ", diagnostic";
26
  protected final String TEXT_9 = ", diagnostic";
27
  protected final String TEXT_10 = ".getSource());" + NL + "\t\tassertEquals(";
27
  protected final String TEXT_10 = ".getSource());" + NL + "\t\tassertEquals(";
28
  protected final String TEXT_11 = ", removeObjectHashCode(diagnostic";
28
  protected final String TEXT_11 = ", removeObjectHashCode(diagnostic";
29
  protected final String TEXT_12 = ".getMessage()));" + NL + "\t\tassertEquals(";
29
  protected final String TEXT_12 = ".getMessage()));" + NL + "\t\tassertEquals(";
30
  protected final String TEXT_13 = ", diagnostic";
30
  protected final String TEXT_13 = ", diagnostic";
31
  protected final String TEXT_14 = ".getCode());" + NL + "\t\tassertEquals(";
31
  protected final String TEXT_14 = ".getCode());" + NL + "\t\tassertEquals(";
32
  protected final String TEXT_15 = ", diagnostic";
32
  protected final String TEXT_15 = ", diagnostic";
33
  protected final String TEXT_16 = ".getChildren().size());" + NL + "\t\tassertEquals(";
33
  protected final String TEXT_16 = ".getChildren().size());" + NL + "\t\tassertEquals(";
34
  protected final String TEXT_17 = ", diagnostic";
34
  protected final String TEXT_17 = ", diagnostic";
35
  protected final String TEXT_18 = ".getData().size());" + NL + "\t\t";
35
  protected final String TEXT_18 = ".getData().size());" + NL + "\t\t";
36
  protected final String TEXT_19 = "assertEquals(";
36
  protected final String TEXT_19 = "assertEquals(";
37
  protected final String TEXT_20 = ", toString(diagnostic";
37
  protected final String TEXT_20 = ", toString(diagnostic";
38
  protected final String TEXT_21 = ".getException()));" + NL + "\t\t";
38
  protected final String TEXT_21 = ".getException()));" + NL + "\t\t";
39
  protected final String TEXT_22 = "assertNull(diagnostic";
39
  protected final String TEXT_22 = "assertNull(diagnostic";
40
  protected final String TEXT_23 = ".getException());";
40
  protected final String TEXT_23 = ".getException());";
41
  protected final String TEXT_24 = NL + "\t\t" + NL + "\t\tassertFalse(diagnosticIterator.hasNext());" + NL + "\t}" + NL + "\t" + NL + "\tprotected String toString(Throwable throwable)" + NL + "\t{" + NL + "\t\tStringBuilder sb = new StringBuilder();" + NL + "\t\tsb.append(throwable.getClass().getName());" + NL + "\t\tsb.append(\"#\").append(throwable.getMessage());" + NL + "" + NL + "\t\tThrowable cause = throwable.getCause();" + NL + "\t\tif (cause != null && cause != throwable)" + NL + "\t\t{" + NL + "\t\t\tsb.append(\"--\").append(toString(cause));" + NL + "\t\t}" + NL + "\t\treturn sb.toString();" + NL + "\t}" + NL + "\t" + NL + "\tprotected String removeObjectHashCode(String string)" + NL + "\t{" + NL + "\t\treturn string.replaceAll(\"@\\\\w+\", \"\");" + NL + "\t}" + NL + "}";
41
  protected final String TEXT_24 = NL + "\t\t" + NL + "\t\tassertFalse(diagnosticIterator.hasNext());" + NL + "\t}" + NL + "\t" + NL + "\tprotected String toString(Throwable throwable)" + NL + "\t{" + NL + "\t\tStringBuilder sb = new StringBuilder();" + NL + "\t\tsb.append(throwable.getClass().getName());" + NL + "\t\tsb.append(\"#\").append(throwable.getMessage());" + NL + "" + NL + "\t\tThrowable cause = throwable.getCause();" + NL + "\t\tif (cause != null && cause != throwable)" + NL + "\t\t{" + NL + "\t\t\tsb.append(\"--\").append(toString(cause));" + NL + "\t\t}" + NL + "\t\treturn sb.toString();" + NL + "\t}" + NL + "\t" + NL + "\tprotected String removeObjectHashCode(String string)" + NL + "\t{" + NL + "\t\treturn string.replaceAll(\"@\\\\w+\", \"\");" + NL + "\t}" + NL + "}";
42
  protected final String TEXT_25 = NL;
42
  protected final String TEXT_25 = NL;
43
43
44
  public String generate(Object argument)
44
  public String generate(Object argument)
45
  {
45
  {
46
    final StringBuffer stringBuffer = new StringBuffer();
46
    final StringBuffer stringBuffer = new StringBuffer();
47
    
47
    
48
/**
48
/**
49
 * Copyright (c) 2006-2007 IBM Corporation and others.
49
 * Copyright (c) 2006-2007 IBM Corporation and others.
50
 * All rights reserved.   This program and the accompanying materials
50
 * All rights reserved.   This program and the accompanying materials
51
 * are made available under the terms of the Eclipse Public License v1.0
51
 * are made available under the terms of the Eclipse Public License v1.0
52
 * which accompanies this distribution, and is available at
52
 * which accompanies this distribution, and is available at
53
 * http://www.eclipse.org/legal/epl-v10.html
53
 * http://www.eclipse.org/legal/epl-v10.html
54
 * 
54
 * 
55
 * Contributors: 
55
 * Contributors: 
56
 *   IBM - Initial API and implementation
56
 *   IBM - Initial API and implementation
57
 */
57
 */
58
58
59
    
59
    
60
  String name = (String)((Object[])argument)[0];
60
  String name = (String)((Object[])argument)[0];
61
  Diagnostic rootDiagnostic = (Diagnostic)((Object[])argument)[1];
61
  Diagnostic rootDiagnostic = (Diagnostic)((Object[])argument)[1];
62
  TreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(rootDiagnostic)
62
  TreeIterator<Diagnostic> diagnosticIterator = new AbstractTreeIterator<Diagnostic>(rootDiagnostic)
63
  {
63
  {
64
    private static final long serialVersionUID = 1L;
64
    private static final long serialVersionUID = 1L;
65
    @Override
65
    @Override
66
    protected Iterator<? extends Diagnostic> getChildren(Object object)
66
    protected Iterator<? extends Diagnostic> getChildren(Object object)
67
    {
67
    {
68
      return ((Diagnostic)object).getChildren().iterator();
68
      return ((Diagnostic)object).getChildren().iterator();
69
    }
69
    }
70
  };
70
  };
71
    
71
    
72
  class Helper
72
  class Helper
73
  {
73
  {
74
    public String toString(Throwable throwable)
74
    public String toString(Throwable throwable)
75
    {
75
    {
76
      StringBuilder sb = new StringBuilder();
76
      StringBuilder sb = new StringBuilder();
77
      sb.append(throwable.getClass().getName());
77
      sb.append(throwable.getClass().getName());
78
      sb.append("#").append(throwable.getMessage());
78
      sb.append("#").append(throwable.getMessage());
79
79
80
      Throwable cause = throwable.getCause();
80
      Throwable cause = throwable.getCause();
81
      if (cause != null && cause != throwable)
81
      if (cause != null && cause != throwable)
82
      {
82
      {
83
          sb.append("--").append(toString(cause));
83
          sb.append("--").append(toString(cause));
84
      }
84
      }
85
      return sb.toString();
85
      return sb.toString();
86
    }
86
    }
87
    
87
    
88
    protected String removeObjectHashCode(String string)
88
    protected String removeObjectHashCode(String string)
89
    {
89
    {
90
      return string.replaceAll("@\\w+", "");
90
      return string.replaceAll("@\\w+", "");
91
    }
91
    }
92
    
92
    
93
    
93
    
94
    public String toCodeString(String string)
94
    public String toCodeString(String string)
95
    {
95
    {
96
      return "\"" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\\"", "\\\\\"") + "\"";
96
      return "\"" + string.replaceAll("\\\\", "\\\\\\\\").replaceAll("\\\"", "\\\\\"") + "\"";
97
    }
97
    }
98
    
98
    
99
    public String getDiagnosticSeverity(int value)
99
    public String getDiagnosticSeverity(int value)
100
    {
100
    {
101
      switch(value)
101
      switch(value)
102
      {
102
      {
103
        case Diagnostic.CANCEL:
103
        case Diagnostic.CANCEL:
104
          return "Diagnostic.CANCEL";
104
          return "Diagnostic.CANCEL";
105
        case Diagnostic.OK:
105
        case Diagnostic.OK:
106
          return "Diagnostic.OK";
106
          return "Diagnostic.OK";
107
        case Diagnostic.INFO:
107
        case Diagnostic.INFO:
108
          return "Diagnostic.INFO";
108
          return "Diagnostic.INFO";
109
        case Diagnostic.ERROR:
109
        case Diagnostic.ERROR:
110
          return "Diagnostic.ERROR";
110
          return "Diagnostic.ERROR";
111
        case Diagnostic.WARNING:
111
        case Diagnostic.WARNING:
112
          return "Diagnostic.WARNING";
112
          return "Diagnostic.WARNING";
113
        default:
113
        default:
114
          return Integer.toString(value);
114
          return Integer.toString(value);
115
      }
115
      }
116
    }
116
    }
117
  }
117
  }
118
  Helper helper = new Helper();
118
  Helper helper = new Helper();
119
119
120
    stringBuffer.append(TEXT_1);
120
    stringBuffer.append(TEXT_1);
121
    stringBuffer.append(name);
121
    stringBuffer.append(name);
122
    stringBuffer.append(TEXT_2);
122
    stringBuffer.append(TEXT_2);
123
    stringBuffer.append(name);
123
    stringBuffer.append(name);
124
    stringBuffer.append(TEXT_3);
124
    stringBuffer.append(TEXT_3);
125
    stringBuffer.append(name);
125
    stringBuffer.append(name);
126
    stringBuffer.append(TEXT_4);
126
    stringBuffer.append(TEXT_4);
127
    int count=0; while(diagnosticIterator.hasNext()){Diagnostic diagnostic = diagnosticIterator.next(); count++;
127
    int count=0; while(diagnosticIterator.hasNext()){Diagnostic diagnostic = diagnosticIterator.next(); count++;
128
    stringBuffer.append(TEXT_5);
128
    stringBuffer.append(TEXT_5);
129
    stringBuffer.append(count);
129
    stringBuffer.append(count);
130
    stringBuffer.append(TEXT_6);
130
    stringBuffer.append(TEXT_6);
131
    stringBuffer.append(helper.getDiagnosticSeverity(diagnostic.getSeverity()));
131
    stringBuffer.append(helper.getDiagnosticSeverity(diagnostic.getSeverity()));
132
    stringBuffer.append(TEXT_7);
132
    stringBuffer.append(TEXT_7);
133
    stringBuffer.append(count);
133
    stringBuffer.append(count);
134
    stringBuffer.append(TEXT_8);
134
    stringBuffer.append(TEXT_8);
135
    stringBuffer.append(helper.toCodeString(diagnostic.getSource()));
135
    stringBuffer.append(helper.toCodeString(diagnostic.getSource()));
136
    stringBuffer.append(TEXT_9);
136
    stringBuffer.append(TEXT_9);
137
    stringBuffer.append(count);
137
    stringBuffer.append(count);
138
    stringBuffer.append(TEXT_10);
138
    stringBuffer.append(TEXT_10);
139
    stringBuffer.append(helper.removeObjectHashCode(helper.toCodeString(diagnostic.getMessage())));
139
    stringBuffer.append(helper.removeObjectHashCode(helper.toCodeString(diagnostic.getMessage())));
140
    stringBuffer.append(TEXT_11);
140
    stringBuffer.append(TEXT_11);
141
    stringBuffer.append(count);
141
    stringBuffer.append(count);
142
    stringBuffer.append(TEXT_12);
142
    stringBuffer.append(TEXT_12);
143
    stringBuffer.append(diagnostic.getCode());
143
    stringBuffer.append(diagnostic.getCode());
144
    stringBuffer.append(TEXT_13);
144
    stringBuffer.append(TEXT_13);
145
    stringBuffer.append(count);
145
    stringBuffer.append(count);
146
    stringBuffer.append(TEXT_14);
146
    stringBuffer.append(TEXT_14);
147
    stringBuffer.append(diagnostic.getChildren().size());
147
    stringBuffer.append(diagnostic.getChildren().size());
148
    stringBuffer.append(TEXT_15);
148
    stringBuffer.append(TEXT_15);
149
    stringBuffer.append(count);
149
    stringBuffer.append(count);
150
    stringBuffer.append(TEXT_16);
150
    stringBuffer.append(TEXT_16);
151
    stringBuffer.append(diagnostic.getData().size());
151
    stringBuffer.append(diagnostic.getData().size());
152
    stringBuffer.append(TEXT_17);
152
    stringBuffer.append(TEXT_17);
153
    stringBuffer.append(count);
153
    stringBuffer.append(count);
154
    stringBuffer.append(TEXT_18);
154
    stringBuffer.append(TEXT_18);
155
    Throwable throwable = diagnostic.getException(); if (throwable != null) {
155
    Throwable throwable = diagnostic.getException(); if (throwable != null) {
156
    stringBuffer.append(TEXT_19);
156
    stringBuffer.append(TEXT_19);
157
    stringBuffer.append(helper.toCodeString(helper.toString(diagnostic.getException())));
157
    stringBuffer.append(helper.toCodeString(helper.toString(diagnostic.getException())));
158
    stringBuffer.append(TEXT_20);
158
    stringBuffer.append(TEXT_20);
159
    stringBuffer.append(count);
159
    stringBuffer.append(count);
160
    stringBuffer.append(TEXT_21);
160
    stringBuffer.append(TEXT_21);
161
    } else {
161
    } else {
162
    stringBuffer.append(TEXT_22);
162
    stringBuffer.append(TEXT_22);
163
    stringBuffer.append(count);
163
    stringBuffer.append(count);
164
    stringBuffer.append(TEXT_23);
164
    stringBuffer.append(TEXT_23);
165
    } if (diagnosticIterator.hasNext()) {stringBuffer.append(NL);}}
165
    } if (diagnosticIterator.hasNext()) {stringBuffer.append(NL);}}
166
    stringBuffer.append(TEXT_24);
166
    stringBuffer.append(TEXT_24);
167
    stringBuffer.append(TEXT_25);
167
    stringBuffer.append(TEXT_25);
168
    return stringBuffer.toString();
168
    return stringBuffer.toString();
169
  }
169
  }
170
}
170
}
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class0.java (+270 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation;
8
9
import org.eclipse.emf.ecore.EObject;
10
11
/**
12
 * <!-- begin-user-doc -->
13
 * A representation of the model object '<em><b>Class0</b></em>'.
14
 * <!-- end-user-doc -->
15
 *
16
 * <p>
17
 * The following features are supported:
18
 * <ul>
19
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}</li>
20
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}</li>
21
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}</li>
22
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}</li>
23
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}</li>
24
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}</li>
25
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}</li>
26
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}</li>
27
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}</li>
28
 * </ul>
29
 * </p>
30
 *
31
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0()
32
 * @model
33
 * @generated
34
 */
35
public interface Class0 extends EObject {
36
	/**
37
	 * Returns the value of the '<em><b>Test Boolean</b></em>' attribute.
38
	 * <!-- begin-user-doc -->
39
	 * <p>
40
	 * If the meaning of the '<em>Test Boolean</em>' attribute isn't clear,
41
	 * there really should be more of a description here...
42
	 * </p>
43
	 * <!-- end-user-doc -->
44
	 * @return the value of the '<em>Test Boolean</em>' attribute.
45
	 * @see #setTestBoolean(boolean)
46
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestBoolean()
47
	 * @model
48
	 * @generated
49
	 */
50
	boolean isTestBoolean();
51
52
	/**
53
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}' attribute.
54
	 * <!-- begin-user-doc -->
55
	 * <!-- end-user-doc -->
56
	 * @param value the new value of the '<em>Test Boolean</em>' attribute.
57
	 * @see #isTestBoolean()
58
	 * @generated
59
	 */
60
	void setTestBoolean(boolean value);
61
62
	/**
63
	 * Returns the value of the '<em><b>Test Byte</b></em>' attribute.
64
	 * <!-- begin-user-doc -->
65
	 * <p>
66
	 * If the meaning of the '<em>Test Byte</em>' attribute isn't clear,
67
	 * there really should be more of a description here...
68
	 * </p>
69
	 * <!-- end-user-doc -->
70
	 * @return the value of the '<em>Test Byte</em>' attribute.
71
	 * @see #setTestByte(byte)
72
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestByte()
73
	 * @model
74
	 * @generated
75
	 */
76
	byte getTestByte();
77
78
	/**
79
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}' attribute.
80
	 * <!-- begin-user-doc -->
81
	 * <!-- end-user-doc -->
82
	 * @param value the new value of the '<em>Test Byte</em>' attribute.
83
	 * @see #getTestByte()
84
	 * @generated
85
	 */
86
	void setTestByte(byte value);
87
88
	/**
89
	 * Returns the value of the '<em><b>Test Char</b></em>' attribute.
90
	 * <!-- begin-user-doc -->
91
	 * <p>
92
	 * If the meaning of the '<em>Test Char</em>' attribute isn't clear,
93
	 * there really should be more of a description here...
94
	 * </p>
95
	 * <!-- end-user-doc -->
96
	 * @return the value of the '<em>Test Char</em>' attribute.
97
	 * @see #setTestChar(char)
98
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestChar()
99
	 * @model
100
	 * @generated
101
	 */
102
	char getTestChar();
103
104
	/**
105
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}' attribute.
106
	 * <!-- begin-user-doc -->
107
	 * <!-- end-user-doc -->
108
	 * @param value the new value of the '<em>Test Char</em>' attribute.
109
	 * @see #getTestChar()
110
	 * @generated
111
	 */
112
	void setTestChar(char value);
113
114
	/**
115
	 * Returns the value of the '<em><b>Test Double</b></em>' attribute.
116
	 * <!-- begin-user-doc -->
117
	 * <p>
118
	 * If the meaning of the '<em>Test Double</em>' attribute isn't clear,
119
	 * there really should be more of a description here...
120
	 * </p>
121
	 * <!-- end-user-doc -->
122
	 * @return the value of the '<em>Test Double</em>' attribute.
123
	 * @see #setTestDouble(double)
124
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestDouble()
125
	 * @model
126
	 * @generated
127
	 */
128
	double getTestDouble();
129
130
	/**
131
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}' attribute.
132
	 * <!-- begin-user-doc -->
133
	 * <!-- end-user-doc -->
134
	 * @param value the new value of the '<em>Test Double</em>' attribute.
135
	 * @see #getTestDouble()
136
	 * @generated
137
	 */
138
	void setTestDouble(double value);
139
140
	/**
141
	 * Returns the value of the '<em><b>Test Float</b></em>' attribute.
142
	 * <!-- begin-user-doc -->
143
	 * <p>
144
	 * If the meaning of the '<em>Test Float</em>' attribute isn't clear,
145
	 * there really should be more of a description here...
146
	 * </p>
147
	 * <!-- end-user-doc -->
148
	 * @return the value of the '<em>Test Float</em>' attribute.
149
	 * @see #setTestFloat(float)
150
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestFloat()
151
	 * @model
152
	 * @generated
153
	 */
154
	float getTestFloat();
155
156
	/**
157
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}' attribute.
158
	 * <!-- begin-user-doc -->
159
	 * <!-- end-user-doc -->
160
	 * @param value the new value of the '<em>Test Float</em>' attribute.
161
	 * @see #getTestFloat()
162
	 * @generated
163
	 */
164
	void setTestFloat(float value);
165
166
	/**
167
	 * Returns the value of the '<em><b>Test Int</b></em>' attribute.
168
	 * <!-- begin-user-doc -->
169
	 * <p>
170
	 * If the meaning of the '<em>Test Int</em>' attribute isn't clear,
171
	 * there really should be more of a description here...
172
	 * </p>
173
	 * <!-- end-user-doc -->
174
	 * @return the value of the '<em>Test Int</em>' attribute.
175
	 * @see #setTestInt(int)
176
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestInt()
177
	 * @model
178
	 * @generated
179
	 */
180
	int getTestInt();
181
182
	/**
183
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}' attribute.
184
	 * <!-- begin-user-doc -->
185
	 * <!-- end-user-doc -->
186
	 * @param value the new value of the '<em>Test Int</em>' attribute.
187
	 * @see #getTestInt()
188
	 * @generated
189
	 */
190
	void setTestInt(int value);
191
192
	/**
193
	 * Returns the value of the '<em><b>Test Long</b></em>' attribute.
194
	 * <!-- begin-user-doc -->
195
	 * <p>
196
	 * If the meaning of the '<em>Test Long</em>' attribute isn't clear,
197
	 * there really should be more of a description here...
198
	 * </p>
199
	 * <!-- end-user-doc -->
200
	 * @return the value of the '<em>Test Long</em>' attribute.
201
	 * @see #setTestLong(long)
202
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestLong()
203
	 * @model
204
	 * @generated
205
	 */
206
	long getTestLong();
207
208
	/**
209
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}' attribute.
210
	 * <!-- begin-user-doc -->
211
	 * <!-- end-user-doc -->
212
	 * @param value the new value of the '<em>Test Long</em>' attribute.
213
	 * @see #getTestLong()
214
	 * @generated
215
	 */
216
	void setTestLong(long value);
217
218
	/**
219
	 * Returns the value of the '<em><b>Test Short</b></em>' attribute.
220
	 * <!-- begin-user-doc -->
221
	 * <p>
222
	 * If the meaning of the '<em>Test Short</em>' attribute isn't clear,
223
	 * there really should be more of a description here...
224
	 * </p>
225
	 * <!-- end-user-doc -->
226
	 * @return the value of the '<em>Test Short</em>' attribute.
227
	 * @see #setTestShort(short)
228
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_TestShort()
229
	 * @model
230
	 * @generated
231
	 */
232
	short getTestShort();
233
234
	/**
235
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}' attribute.
236
	 * <!-- begin-user-doc -->
237
	 * <!-- end-user-doc -->
238
	 * @param value the new value of the '<em>Test Short</em>' attribute.
239
	 * @see #getTestShort()
240
	 * @generated
241
	 */
242
	void setTestShort(short value);
243
244
	/**
245
	 * Returns the value of the '<em><b>Class1</b></em>' containment reference.
246
	 * <!-- begin-user-doc -->
247
	 * <p>
248
	 * If the meaning of the '<em>Class1</em>' containment reference isn't clear,
249
	 * there really should be more of a description here...
250
	 * </p>
251
	 * <!-- end-user-doc -->
252
	 * @return the value of the '<em>Class1</em>' containment reference.
253
	 * @see #setClass1(Class1)
254
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass0_Class1()
255
	 * @model containment="true"
256
	 * @generated
257
	 */
258
	Class1 getClass1();
259
260
	/**
261
	 * Sets the value of the '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}' containment reference.
262
	 * <!-- begin-user-doc -->
263
	 * <!-- end-user-doc -->
264
	 * @param value the new value of the '<em>Class1</em>' containment reference.
265
	 * @see #getClass1()
266
	 * @generated
267
	 */
268
	void setClass1(Class1 value);
269
270
} // Class0
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/Class1.java (+22 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation;
8
9
import org.eclipse.emf.ecore.EObject;
10
11
/**
12
 * <!-- begin-user-doc -->
13
 * A representation of the model object '<em><b>Class1</b></em>'.
14
 * <!-- end-user-doc -->
15
 *
16
 *
17
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#getClass1()
18
 * @model
19
 * @generated
20
 */
21
public interface Class1 extends EObject {
22
} // Class1
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationFactory.java (+55 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation;
8
9
import org.eclipse.emf.ecore.EFactory;
10
11
/**
12
 * <!-- begin-user-doc -->
13
 * The <b>Factory</b> for the model.
14
 * It provides a create method for each non-abstract class of the model.
15
 * <!-- end-user-doc -->
16
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage
17
 * @generated
18
 */
19
public interface DynamicDelegationFactory extends EFactory {
20
	/**
21
	 * The singleton instance of the factory.
22
	 * <!-- begin-user-doc -->
23
	 * <!-- end-user-doc -->
24
	 * @generated
25
	 */
26
	DynamicDelegationFactory eINSTANCE = org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl.init();
27
28
	/**
29
	 * Returns a new object of class '<em>Class0</em>'.
30
	 * <!-- begin-user-doc -->
31
	 * <!-- end-user-doc -->
32
	 * @return a new object of class '<em>Class0</em>'.
33
	 * @generated
34
	 */
35
	Class0 createClass0();
36
37
	/**
38
	 * Returns a new object of class '<em>Class1</em>'.
39
	 * <!-- begin-user-doc -->
40
	 * <!-- end-user-doc -->
41
	 * @return a new object of class '<em>Class1</em>'.
42
	 * @generated
43
	 */
44
	Class1 createClass1();
45
46
	/**
47
	 * Returns the package supported by this factory.
48
	 * <!-- begin-user-doc -->
49
	 * <!-- end-user-doc -->
50
	 * @return the package supported by this factory.
51
	 * @generated
52
	 */
53
	DynamicDelegationPackage getDynamicDelegationPackage();
54
55
} //DynamicDelegationFactory
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/DynamicDelegationPackage.java (+417 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation;
8
9
import org.eclipse.emf.ecore.EAttribute;
10
import org.eclipse.emf.ecore.EClass;
11
import org.eclipse.emf.ecore.EPackage;
12
import org.eclipse.emf.ecore.EReference;
13
14
/**
15
 * <!-- begin-user-doc -->
16
 * The <b>Package</b> for the model.
17
 * It contains accessors for the meta objects to represent
18
 * <ul>
19
 *   <li>each class,</li>
20
 *   <li>each feature of each class,</li>
21
 *   <li>each enum,</li>
22
 *   <li>and each data type</li>
23
 * </ul>
24
 * <!-- end-user-doc -->
25
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory
26
 * @model kind="package"
27
 * @generated
28
 */
29
public interface DynamicDelegationPackage extends EPackage {
30
	/**
31
	 * The package name.
32
	 * <!-- begin-user-doc -->
33
	 * <!-- end-user-doc -->
34
	 * @generated
35
	 */
36
	String eNAME = "dynamicDelegation";
37
38
	/**
39
	 * The package namespace URI.
40
	 * <!-- begin-user-doc -->
41
	 * <!-- end-user-doc -->
42
	 * @generated
43
	 */
44
	String eNS_URI = "http:///org.eclipse.emf.test.models/DynamicDelegation";
45
46
	/**
47
	 * The package namespace name.
48
	 * <!-- begin-user-doc -->
49
	 * <!-- end-user-doc -->
50
	 * @generated
51
	 */
52
	String eNS_PREFIX = "dynamicDelegation";
53
54
	/**
55
	 * The singleton instance of the package.
56
	 * <!-- begin-user-doc -->
57
	 * <!-- end-user-doc -->
58
	 * @generated
59
	 */
60
	DynamicDelegationPackage eINSTANCE = org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl.init();
61
62
	/**
63
	 * The meta object id for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl <em>Class0</em>}' class.
64
	 * <!-- begin-user-doc -->
65
	 * <!-- end-user-doc -->
66
	 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl
67
	 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass0()
68
	 * @generated
69
	 */
70
	int CLASS0 = 0;
71
72
	/**
73
	 * The feature id for the '<em><b>Test Boolean</b></em>' attribute.
74
	 * <!-- begin-user-doc -->
75
	 * <!-- end-user-doc -->
76
	 * @generated
77
	 * @ordered
78
	 */
79
	int CLASS0__TEST_BOOLEAN = 0;
80
81
	/**
82
	 * The feature id for the '<em><b>Test Byte</b></em>' attribute.
83
	 * <!-- begin-user-doc -->
84
	 * <!-- end-user-doc -->
85
	 * @generated
86
	 * @ordered
87
	 */
88
	int CLASS0__TEST_BYTE = 1;
89
90
	/**
91
	 * The feature id for the '<em><b>Test Char</b></em>' attribute.
92
	 * <!-- begin-user-doc -->
93
	 * <!-- end-user-doc -->
94
	 * @generated
95
	 * @ordered
96
	 */
97
	int CLASS0__TEST_CHAR = 2;
98
99
	/**
100
	 * The feature id for the '<em><b>Test Double</b></em>' attribute.
101
	 * <!-- begin-user-doc -->
102
	 * <!-- end-user-doc -->
103
	 * @generated
104
	 * @ordered
105
	 */
106
	int CLASS0__TEST_DOUBLE = 3;
107
108
	/**
109
	 * The feature id for the '<em><b>Test Float</b></em>' attribute.
110
	 * <!-- begin-user-doc -->
111
	 * <!-- end-user-doc -->
112
	 * @generated
113
	 * @ordered
114
	 */
115
	int CLASS0__TEST_FLOAT = 4;
116
117
	/**
118
	 * The feature id for the '<em><b>Test Int</b></em>' attribute.
119
	 * <!-- begin-user-doc -->
120
	 * <!-- end-user-doc -->
121
	 * @generated
122
	 * @ordered
123
	 */
124
	int CLASS0__TEST_INT = 5;
125
126
	/**
127
	 * The feature id for the '<em><b>Test Long</b></em>' attribute.
128
	 * <!-- begin-user-doc -->
129
	 * <!-- end-user-doc -->
130
	 * @generated
131
	 * @ordered
132
	 */
133
	int CLASS0__TEST_LONG = 6;
134
135
	/**
136
	 * The feature id for the '<em><b>Test Short</b></em>' attribute.
137
	 * <!-- begin-user-doc -->
138
	 * <!-- end-user-doc -->
139
	 * @generated
140
	 * @ordered
141
	 */
142
	int CLASS0__TEST_SHORT = 7;
143
144
	/**
145
	 * The feature id for the '<em><b>Class1</b></em>' containment reference.
146
	 * <!-- begin-user-doc -->
147
	 * <!-- end-user-doc -->
148
	 * @generated
149
	 * @ordered
150
	 */
151
	int CLASS0__CLASS1 = 8;
152
153
	/**
154
	 * The number of structural features of the '<em>Class0</em>' class.
155
	 * <!-- begin-user-doc -->
156
	 * <!-- end-user-doc -->
157
	 * @generated
158
	 * @ordered
159
	 */
160
	int CLASS0_FEATURE_COUNT = 9;
161
162
	/**
163
	 * The meta object id for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl <em>Class1</em>}' class.
164
	 * <!-- begin-user-doc -->
165
	 * <!-- end-user-doc -->
166
	 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl
167
	 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass1()
168
	 * @generated
169
	 */
170
	int CLASS1 = 1;
171
172
	/**
173
	 * The number of structural features of the '<em>Class1</em>' class.
174
	 * <!-- begin-user-doc -->
175
	 * <!-- end-user-doc -->
176
	 * @generated
177
	 * @ordered
178
	 */
179
	int CLASS1_FEATURE_COUNT = 0;
180
181
182
	/**
183
	 * Returns the meta object for class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0 <em>Class0</em>}'.
184
	 * <!-- begin-user-doc -->
185
	 * <!-- end-user-doc -->
186
	 * @return the meta object for class '<em>Class0</em>'.
187
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0
188
	 * @generated
189
	 */
190
	EClass getClass0();
191
192
	/**
193
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean <em>Test Boolean</em>}'.
194
	 * <!-- begin-user-doc -->
195
	 * <!-- end-user-doc -->
196
	 * @return the meta object for the attribute '<em>Test Boolean</em>'.
197
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#isTestBoolean()
198
	 * @see #getClass0()
199
	 * @generated
200
	 */
201
	EAttribute getClass0_TestBoolean();
202
203
	/**
204
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte <em>Test Byte</em>}'.
205
	 * <!-- begin-user-doc -->
206
	 * <!-- end-user-doc -->
207
	 * @return the meta object for the attribute '<em>Test Byte</em>'.
208
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestByte()
209
	 * @see #getClass0()
210
	 * @generated
211
	 */
212
	EAttribute getClass0_TestByte();
213
214
	/**
215
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar <em>Test Char</em>}'.
216
	 * <!-- begin-user-doc -->
217
	 * <!-- end-user-doc -->
218
	 * @return the meta object for the attribute '<em>Test Char</em>'.
219
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestChar()
220
	 * @see #getClass0()
221
	 * @generated
222
	 */
223
	EAttribute getClass0_TestChar();
224
225
	/**
226
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble <em>Test Double</em>}'.
227
	 * <!-- begin-user-doc -->
228
	 * <!-- end-user-doc -->
229
	 * @return the meta object for the attribute '<em>Test Double</em>'.
230
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestDouble()
231
	 * @see #getClass0()
232
	 * @generated
233
	 */
234
	EAttribute getClass0_TestDouble();
235
236
	/**
237
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat <em>Test Float</em>}'.
238
	 * <!-- begin-user-doc -->
239
	 * <!-- end-user-doc -->
240
	 * @return the meta object for the attribute '<em>Test Float</em>'.
241
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestFloat()
242
	 * @see #getClass0()
243
	 * @generated
244
	 */
245
	EAttribute getClass0_TestFloat();
246
247
	/**
248
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt <em>Test Int</em>}'.
249
	 * <!-- begin-user-doc -->
250
	 * <!-- end-user-doc -->
251
	 * @return the meta object for the attribute '<em>Test Int</em>'.
252
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestInt()
253
	 * @see #getClass0()
254
	 * @generated
255
	 */
256
	EAttribute getClass0_TestInt();
257
258
	/**
259
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong <em>Test Long</em>}'.
260
	 * <!-- begin-user-doc -->
261
	 * <!-- end-user-doc -->
262
	 * @return the meta object for the attribute '<em>Test Long</em>'.
263
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestLong()
264
	 * @see #getClass0()
265
	 * @generated
266
	 */
267
	EAttribute getClass0_TestLong();
268
269
	/**
270
	 * Returns the meta object for the attribute '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort <em>Test Short</em>}'.
271
	 * <!-- begin-user-doc -->
272
	 * <!-- end-user-doc -->
273
	 * @return the meta object for the attribute '<em>Test Short</em>'.
274
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getTestShort()
275
	 * @see #getClass0()
276
	 * @generated
277
	 */
278
	EAttribute getClass0_TestShort();
279
280
	/**
281
	 * Returns the meta object for the containment reference '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1 <em>Class1</em>}'.
282
	 * <!-- begin-user-doc -->
283
	 * <!-- end-user-doc -->
284
	 * @return the meta object for the containment reference '<em>Class1</em>'.
285
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0#getClass1()
286
	 * @see #getClass0()
287
	 * @generated
288
	 */
289
	EReference getClass0_Class1();
290
291
	/**
292
	 * Returns the meta object for class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class1 <em>Class1</em>}'.
293
	 * <!-- begin-user-doc -->
294
	 * <!-- end-user-doc -->
295
	 * @return the meta object for class '<em>Class1</em>'.
296
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class1
297
	 * @generated
298
	 */
299
	EClass getClass1();
300
301
	/**
302
	 * Returns the factory that creates the instances of the model.
303
	 * <!-- begin-user-doc -->
304
	 * <!-- end-user-doc -->
305
	 * @return the factory that creates the instances of the model.
306
	 * @generated
307
	 */
308
	DynamicDelegationFactory getDynamicDelegationFactory();
309
310
	/**
311
	 * <!-- begin-user-doc -->
312
	 * Defines literals for the meta objects that represent
313
	 * <ul>
314
	 *   <li>each class,</li>
315
	 *   <li>each feature of each class,</li>
316
	 *   <li>each enum,</li>
317
	 *   <li>and each data type</li>
318
	 * </ul>
319
	 * <!-- end-user-doc -->
320
	 * @generated
321
	 */
322
	interface Literals {
323
		/**
324
		 * The meta object literal for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl <em>Class0</em>}' class.
325
		 * <!-- begin-user-doc -->
326
		 * <!-- end-user-doc -->
327
		 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl
328
		 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass0()
329
		 * @generated
330
		 */
331
		EClass CLASS0 = eINSTANCE.getClass0();
332
333
		/**
334
		 * The meta object literal for the '<em><b>Test Boolean</b></em>' attribute feature.
335
		 * <!-- begin-user-doc -->
336
		 * <!-- end-user-doc -->
337
		 * @generated
338
		 */
339
		EAttribute CLASS0__TEST_BOOLEAN = eINSTANCE.getClass0_TestBoolean();
340
341
		/**
342
		 * The meta object literal for the '<em><b>Test Byte</b></em>' attribute feature.
343
		 * <!-- begin-user-doc -->
344
		 * <!-- end-user-doc -->
345
		 * @generated
346
		 */
347
		EAttribute CLASS0__TEST_BYTE = eINSTANCE.getClass0_TestByte();
348
349
		/**
350
		 * The meta object literal for the '<em><b>Test Char</b></em>' attribute feature.
351
		 * <!-- begin-user-doc -->
352
		 * <!-- end-user-doc -->
353
		 * @generated
354
		 */
355
		EAttribute CLASS0__TEST_CHAR = eINSTANCE.getClass0_TestChar();
356
357
		/**
358
		 * The meta object literal for the '<em><b>Test Double</b></em>' attribute feature.
359
		 * <!-- begin-user-doc -->
360
		 * <!-- end-user-doc -->
361
		 * @generated
362
		 */
363
		EAttribute CLASS0__TEST_DOUBLE = eINSTANCE.getClass0_TestDouble();
364
365
		/**
366
		 * The meta object literal for the '<em><b>Test Float</b></em>' attribute feature.
367
		 * <!-- begin-user-doc -->
368
		 * <!-- end-user-doc -->
369
		 * @generated
370
		 */
371
		EAttribute CLASS0__TEST_FLOAT = eINSTANCE.getClass0_TestFloat();
372
373
		/**
374
		 * The meta object literal for the '<em><b>Test Int</b></em>' attribute feature.
375
		 * <!-- begin-user-doc -->
376
		 * <!-- end-user-doc -->
377
		 * @generated
378
		 */
379
		EAttribute CLASS0__TEST_INT = eINSTANCE.getClass0_TestInt();
380
381
		/**
382
		 * The meta object literal for the '<em><b>Test Long</b></em>' attribute feature.
383
		 * <!-- begin-user-doc -->
384
		 * <!-- end-user-doc -->
385
		 * @generated
386
		 */
387
		EAttribute CLASS0__TEST_LONG = eINSTANCE.getClass0_TestLong();
388
389
		/**
390
		 * The meta object literal for the '<em><b>Test Short</b></em>' attribute feature.
391
		 * <!-- begin-user-doc -->
392
		 * <!-- end-user-doc -->
393
		 * @generated
394
		 */
395
		EAttribute CLASS0__TEST_SHORT = eINSTANCE.getClass0_TestShort();
396
397
		/**
398
		 * The meta object literal for the '<em><b>Class1</b></em>' containment reference feature.
399
		 * <!-- begin-user-doc -->
400
		 * <!-- end-user-doc -->
401
		 * @generated
402
		 */
403
		EReference CLASS0__CLASS1 = eINSTANCE.getClass0_Class1();
404
405
		/**
406
		 * The meta object literal for the '{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl <em>Class1</em>}' class.
407
		 * <!-- begin-user-doc -->
408
		 * <!-- end-user-doc -->
409
		 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.Class1Impl
410
		 * @see org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationPackageImpl#getClass1()
411
		 * @generated
412
		 */
413
		EClass CLASS1 = eINSTANCE.getClass1();
414
415
	}
416
417
} //DynamicDelegationPackage
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class0Impl.java (+475 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl;
8
9
import org.eclipse.emf.common.notify.NotificationChain;
10
11
import org.eclipse.emf.ecore.EClass;
12
import org.eclipse.emf.ecore.InternalEObject;
13
14
import org.eclipse.emf.ecore.impl.EObjectImpl;
15
16
import org.eclipse.emf.test.models.dynamicDelegation.Class0;
17
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
18
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
19
20
/**
21
 * <!-- begin-user-doc -->
22
 * An implementation of the model object '<em><b>Class0</b></em>'.
23
 * <!-- end-user-doc -->
24
 * <p>
25
 * The following features are implemented:
26
 * <ul>
27
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#isTestBoolean <em>Test Boolean</em>}</li>
28
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestByte <em>Test Byte</em>}</li>
29
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestChar <em>Test Char</em>}</li>
30
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestDouble <em>Test Double</em>}</li>
31
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestFloat <em>Test Float</em>}</li>
32
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestInt <em>Test Int</em>}</li>
33
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestLong <em>Test Long</em>}</li>
34
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getTestShort <em>Test Short</em>}</li>
35
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.Class0Impl#getClass1 <em>Class1</em>}</li>
36
 * </ul>
37
 * </p>
38
 *
39
 * @generated
40
 */
41
public class Class0Impl extends EObjectImpl implements Class0 {
42
	/**
43
	 * The default value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute.
44
	 * <!-- begin-user-doc -->
45
	 * <!-- end-user-doc -->
46
	 * @see #isTestBoolean()
47
	 * @generated
48
	 * @ordered
49
	 */
50
	protected static final boolean TEST_BOOLEAN_EDEFAULT = false;
51
52
	/**
53
	 * The default value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute.
54
	 * <!-- begin-user-doc -->
55
	 * <!-- end-user-doc -->
56
	 * @see #getTestByte()
57
	 * @generated
58
	 * @ordered
59
	 */
60
	protected static final byte TEST_BYTE_EDEFAULT = 0x00;
61
62
	/**
63
	 * The default value of the '{@link #getTestChar() <em>Test Char</em>}' attribute.
64
	 * <!-- begin-user-doc -->
65
	 * <!-- end-user-doc -->
66
	 * @see #getTestChar()
67
	 * @generated
68
	 * @ordered
69
	 */
70
	protected static final char TEST_CHAR_EDEFAULT = '\u0000';
71
72
	/**
73
	 * The default value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute.
74
	 * <!-- begin-user-doc -->
75
	 * <!-- end-user-doc -->
76
	 * @see #getTestDouble()
77
	 * @generated
78
	 * @ordered
79
	 */
80
	protected static final double TEST_DOUBLE_EDEFAULT = 0.0;
81
82
	/**
83
	 * The default value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute.
84
	 * <!-- begin-user-doc -->
85
	 * <!-- end-user-doc -->
86
	 * @see #getTestFloat()
87
	 * @generated
88
	 * @ordered
89
	 */
90
	protected static final float TEST_FLOAT_EDEFAULT = 0.0F;
91
92
	/**
93
	 * The default value of the '{@link #getTestInt() <em>Test Int</em>}' attribute.
94
	 * <!-- begin-user-doc -->
95
	 * <!-- end-user-doc -->
96
	 * @see #getTestInt()
97
	 * @generated
98
	 * @ordered
99
	 */
100
	protected static final int TEST_INT_EDEFAULT = 0;
101
102
	/**
103
	 * The default value of the '{@link #getTestLong() <em>Test Long</em>}' attribute.
104
	 * <!-- begin-user-doc -->
105
	 * <!-- end-user-doc -->
106
	 * @see #getTestLong()
107
	 * @generated
108
	 * @ordered
109
	 */
110
	protected static final long TEST_LONG_EDEFAULT = 0L;
111
112
	/**
113
	 * The default value of the '{@link #getTestShort() <em>Test Short</em>}' attribute.
114
	 * <!-- begin-user-doc -->
115
	 * <!-- end-user-doc -->
116
	 * @see #getTestShort()
117
	 * @generated
118
	 * @ordered
119
	 */
120
	protected static final short TEST_SHORT_EDEFAULT = 0;
121
122
	/**
123
	 * <!-- begin-user-doc -->
124
	 * <!-- end-user-doc -->
125
	 * @generated
126
	 */
127
	protected Class0Impl() {
128
		super();
129
	}
130
131
	/**
132
	 * <!-- begin-user-doc -->
133
	 * <!-- end-user-doc -->
134
	 * @generated
135
	 */
136
	@Override
137
	protected EClass eStaticClass() {
138
		return DynamicDelegationPackage.Literals.CLASS0;
139
	}
140
141
	/**
142
	 * <!-- begin-user-doc -->
143
	 * <!-- end-user-doc -->
144
	 * @generated
145
	 */
146
	@Override
147
	protected int eStaticFeatureCount() {
148
		return 0;
149
	}
150
151
	/**
152
	 * <!-- begin-user-doc -->
153
	 * <!-- end-user-doc -->
154
	 * @generated
155
	 */
156
	public boolean isTestBoolean() {
157
		return (Boolean)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, DynamicDelegationPackage.Literals.CLASS0__TEST_BOOLEAN, true, true);
158
	}
159
160
	/**
161
	 * <!-- begin-user-doc -->
162
	 * <!-- end-user-doc -->
163
	 * @generated
164
	 */
165
	public void setTestBoolean(boolean newTestBoolean) {
166
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, DynamicDelegationPackage.Literals.CLASS0__TEST_BOOLEAN, newTestBoolean);
167
	}
168
169
	/**
170
	 * <!-- begin-user-doc -->
171
	 * <!-- end-user-doc -->
172
	 * @generated
173
	 */
174
	public byte getTestByte() {
175
		return (Byte)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_BYTE, DynamicDelegationPackage.Literals.CLASS0__TEST_BYTE, true, true);
176
	}
177
178
	/**
179
	 * <!-- begin-user-doc -->
180
	 * <!-- end-user-doc -->
181
	 * @generated
182
	 */
183
	public void setTestByte(byte newTestByte) {
184
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_BYTE, DynamicDelegationPackage.Literals.CLASS0__TEST_BYTE, newTestByte);
185
	}
186
187
	/**
188
	 * <!-- begin-user-doc -->
189
	 * <!-- end-user-doc -->
190
	 * @generated
191
	 */
192
	public char getTestChar() {
193
		return (Character)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_CHAR, DynamicDelegationPackage.Literals.CLASS0__TEST_CHAR, true, true);
194
	}
195
196
	/**
197
	 * <!-- begin-user-doc -->
198
	 * <!-- end-user-doc -->
199
	 * @generated
200
	 */
201
	public void setTestChar(char newTestChar) {
202
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_CHAR, DynamicDelegationPackage.Literals.CLASS0__TEST_CHAR, newTestChar);
203
	}
204
205
	/**
206
	 * <!-- begin-user-doc -->
207
	 * <!-- end-user-doc -->
208
	 * @generated
209
	 */
210
	public double getTestDouble() {
211
		return (Double)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_DOUBLE, DynamicDelegationPackage.Literals.CLASS0__TEST_DOUBLE, true, true);
212
	}
213
214
	/**
215
	 * <!-- begin-user-doc -->
216
	 * <!-- end-user-doc -->
217
	 * @generated
218
	 */
219
	public void setTestDouble(double newTestDouble) {
220
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_DOUBLE, DynamicDelegationPackage.Literals.CLASS0__TEST_DOUBLE, newTestDouble);
221
	}
222
223
	/**
224
	 * <!-- begin-user-doc -->
225
	 * <!-- end-user-doc -->
226
	 * @generated
227
	 */
228
	public float getTestFloat() {
229
		return (Float)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_FLOAT, DynamicDelegationPackage.Literals.CLASS0__TEST_FLOAT, true, true);
230
	}
231
232
	/**
233
	 * <!-- begin-user-doc -->
234
	 * <!-- end-user-doc -->
235
	 * @generated
236
	 */
237
	public void setTestFloat(float newTestFloat) {
238
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_FLOAT, DynamicDelegationPackage.Literals.CLASS0__TEST_FLOAT, newTestFloat);
239
	}
240
241
	/**
242
	 * <!-- begin-user-doc -->
243
	 * <!-- end-user-doc -->
244
	 * @generated
245
	 */
246
	public int getTestInt() {
247
		return (Integer)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_INT, DynamicDelegationPackage.Literals.CLASS0__TEST_INT, true, true);
248
	}
249
250
	/**
251
	 * <!-- begin-user-doc -->
252
	 * <!-- end-user-doc -->
253
	 * @generated
254
	 */
255
	public void setTestInt(int newTestInt) {
256
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_INT, DynamicDelegationPackage.Literals.CLASS0__TEST_INT, newTestInt);
257
	}
258
259
	/**
260
	 * <!-- begin-user-doc -->
261
	 * <!-- end-user-doc -->
262
	 * @generated
263
	 */
264
	public long getTestLong() {
265
		return (Long)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_LONG, DynamicDelegationPackage.Literals.CLASS0__TEST_LONG, true, true);
266
	}
267
268
	/**
269
	 * <!-- begin-user-doc -->
270
	 * <!-- end-user-doc -->
271
	 * @generated
272
	 */
273
	public void setTestLong(long newTestLong) {
274
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_LONG, DynamicDelegationPackage.Literals.CLASS0__TEST_LONG, newTestLong);
275
	}
276
277
	/**
278
	 * <!-- begin-user-doc -->
279
	 * <!-- end-user-doc -->
280
	 * @generated
281
	 */
282
	public short getTestShort() {
283
		return (Short)eDynamicGet(DynamicDelegationPackage.CLASS0__TEST_SHORT, DynamicDelegationPackage.Literals.CLASS0__TEST_SHORT, true, true);
284
	}
285
286
	/**
287
	 * <!-- begin-user-doc -->
288
	 * <!-- end-user-doc -->
289
	 * @generated
290
	 */
291
	public void setTestShort(short newTestShort) {
292
		eDynamicSet(DynamicDelegationPackage.CLASS0__TEST_SHORT, DynamicDelegationPackage.Literals.CLASS0__TEST_SHORT, newTestShort);
293
	}
294
295
	/**
296
	 * <!-- begin-user-doc -->
297
	 * <!-- end-user-doc -->
298
	 * @generated
299
	 */
300
	public Class1 getClass1() {
301
		return (Class1)eDynamicGet(DynamicDelegationPackage.CLASS0__CLASS1, DynamicDelegationPackage.Literals.CLASS0__CLASS1, true, true);
302
	}
303
304
	/**
305
	 * <!-- begin-user-doc -->
306
	 * <!-- end-user-doc -->
307
	 * @generated
308
	 */
309
	public NotificationChain basicSetClass1(Class1 newClass1, NotificationChain msgs) {
310
		msgs = eDynamicInverseAdd((InternalEObject)newClass1, DynamicDelegationPackage.CLASS0__CLASS1, msgs);
311
		return msgs;
312
	}
313
314
	/**
315
	 * <!-- begin-user-doc -->
316
	 * <!-- end-user-doc -->
317
	 * @generated
318
	 */
319
	public void setClass1(Class1 newClass1) {
320
		eDynamicSet(DynamicDelegationPackage.CLASS0__CLASS1, DynamicDelegationPackage.Literals.CLASS0__CLASS1, newClass1);
321
	}
322
323
	/**
324
	 * <!-- begin-user-doc -->
325
	 * <!-- end-user-doc -->
326
	 * @generated
327
	 */
328
	@Override
329
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
330
		switch (featureID) {
331
			case DynamicDelegationPackage.CLASS0__CLASS1:
332
				return basicSetClass1(null, msgs);
333
		}
334
		return super.eInverseRemove(otherEnd, featureID, msgs);
335
	}
336
337
	/**
338
	 * <!-- begin-user-doc -->
339
	 * <!-- end-user-doc -->
340
	 * @generated
341
	 */
342
	@Override
343
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
344
		switch (featureID) {
345
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
346
				return isTestBoolean();
347
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
348
				return getTestByte();
349
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
350
				return getTestChar();
351
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
352
				return getTestDouble();
353
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
354
				return getTestFloat();
355
			case DynamicDelegationPackage.CLASS0__TEST_INT:
356
				return getTestInt();
357
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
358
				return getTestLong();
359
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
360
				return getTestShort();
361
			case DynamicDelegationPackage.CLASS0__CLASS1:
362
				return getClass1();
363
		}
364
		return super.eGet(featureID, resolve, coreType);
365
	}
366
367
	/**
368
	 * <!-- begin-user-doc -->
369
	 * <!-- end-user-doc -->
370
	 * @generated
371
	 */
372
	@Override
373
	public void eSet(int featureID, Object newValue) {
374
		switch (featureID) {
375
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
376
				setTestBoolean((Boolean)newValue);
377
				return;
378
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
379
				setTestByte((Byte)newValue);
380
				return;
381
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
382
				setTestChar((Character)newValue);
383
				return;
384
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
385
				setTestDouble((Double)newValue);
386
				return;
387
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
388
				setTestFloat((Float)newValue);
389
				return;
390
			case DynamicDelegationPackage.CLASS0__TEST_INT:
391
				setTestInt((Integer)newValue);
392
				return;
393
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
394
				setTestLong((Long)newValue);
395
				return;
396
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
397
				setTestShort((Short)newValue);
398
				return;
399
			case DynamicDelegationPackage.CLASS0__CLASS1:
400
				setClass1((Class1)newValue);
401
				return;
402
		}
403
		super.eSet(featureID, newValue);
404
	}
405
406
	/**
407
	 * <!-- begin-user-doc -->
408
	 * <!-- end-user-doc -->
409
	 * @generated
410
	 */
411
	@Override
412
	public void eUnset(int featureID) {
413
		switch (featureID) {
414
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
415
				setTestBoolean(TEST_BOOLEAN_EDEFAULT);
416
				return;
417
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
418
				setTestByte(TEST_BYTE_EDEFAULT);
419
				return;
420
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
421
				setTestChar(TEST_CHAR_EDEFAULT);
422
				return;
423
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
424
				setTestDouble(TEST_DOUBLE_EDEFAULT);
425
				return;
426
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
427
				setTestFloat(TEST_FLOAT_EDEFAULT);
428
				return;
429
			case DynamicDelegationPackage.CLASS0__TEST_INT:
430
				setTestInt(TEST_INT_EDEFAULT);
431
				return;
432
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
433
				setTestLong(TEST_LONG_EDEFAULT);
434
				return;
435
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
436
				setTestShort(TEST_SHORT_EDEFAULT);
437
				return;
438
			case DynamicDelegationPackage.CLASS0__CLASS1:
439
				setClass1((Class1)null);
440
				return;
441
		}
442
		super.eUnset(featureID);
443
	}
444
445
	/**
446
	 * <!-- begin-user-doc -->
447
	 * <!-- end-user-doc -->
448
	 * @generated
449
	 */
450
	@Override
451
	public boolean eIsSet(int featureID) {
452
		switch (featureID) {
453
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
454
				return isTestBoolean() != TEST_BOOLEAN_EDEFAULT;
455
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
456
				return getTestByte() != TEST_BYTE_EDEFAULT;
457
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
458
				return getTestChar() != TEST_CHAR_EDEFAULT;
459
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
460
				return getTestDouble() != TEST_DOUBLE_EDEFAULT;
461
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
462
				return getTestFloat() != TEST_FLOAT_EDEFAULT;
463
			case DynamicDelegationPackage.CLASS0__TEST_INT:
464
				return getTestInt() != TEST_INT_EDEFAULT;
465
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
466
				return getTestLong() != TEST_LONG_EDEFAULT;
467
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
468
				return getTestShort() != TEST_SHORT_EDEFAULT;
469
			case DynamicDelegationPackage.CLASS0__CLASS1:
470
				return getClass1() != null;
471
		}
472
		return super.eIsSet(featureID);
473
	}
474
475
} //Class0Impl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/Class1Impl.java (+55 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl;
8
9
import org.eclipse.emf.ecore.EClass;
10
11
import org.eclipse.emf.ecore.impl.EObjectImpl;
12
13
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
14
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
15
16
/**
17
 * <!-- begin-user-doc -->
18
 * An implementation of the model object '<em><b>Class1</b></em>'.
19
 * <!-- end-user-doc -->
20
 * <p>
21
 * </p>
22
 *
23
 * @generated
24
 */
25
public class Class1Impl extends EObjectImpl implements Class1 {
26
	/**
27
	 * <!-- begin-user-doc -->
28
	 * <!-- end-user-doc -->
29
	 * @generated
30
	 */
31
	protected Class1Impl() {
32
		super();
33
	}
34
35
	/**
36
	 * <!-- begin-user-doc -->
37
	 * <!-- end-user-doc -->
38
	 * @generated
39
	 */
40
	@Override
41
	protected EClass eStaticClass() {
42
		return DynamicDelegationPackage.Literals.CLASS1;
43
	}
44
45
	/**
46
	 * <!-- begin-user-doc -->
47
	 * <!-- end-user-doc -->
48
	 * @generated
49
	 */
50
	@Override
51
	protected int eStaticFeatureCount() {
52
		return 0;
53
	}
54
55
} //Class1Impl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationFactoryImpl.java (+110 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl;
8
9
import org.eclipse.emf.ecore.EClass;
10
import org.eclipse.emf.ecore.EObject;
11
import org.eclipse.emf.ecore.EPackage;
12
13
import org.eclipse.emf.ecore.impl.EFactoryImpl;
14
15
import org.eclipse.emf.ecore.plugin.EcorePlugin;
16
17
import org.eclipse.emf.test.models.dynamicDelegation.*;
18
19
/**
20
 * <!-- begin-user-doc -->
21
 * An implementation of the model <b>Factory</b>.
22
 * <!-- end-user-doc -->
23
 * @generated
24
 */
25
public class DynamicDelegationFactoryImpl extends EFactoryImpl implements DynamicDelegationFactory {
26
	/**
27
	 * Creates the default factory implementation.
28
	 * <!-- begin-user-doc -->
29
	 * <!-- end-user-doc -->
30
	 * @generated
31
	 */
32
	public static DynamicDelegationFactory init() {
33
		try {
34
			DynamicDelegationFactory theDynamicDelegationFactory = (DynamicDelegationFactory)EPackage.Registry.INSTANCE.getEFactory("http:///org.eclipse.emf.test.models/DynamicDelegation"); 
35
			if (theDynamicDelegationFactory != null) {
36
				return theDynamicDelegationFactory;
37
			}
38
		}
39
		catch (Exception exception) {
40
			EcorePlugin.INSTANCE.log(exception);
41
		}
42
		return new DynamicDelegationFactoryImpl();
43
	}
44
45
	/**
46
	 * Creates an instance of the factory.
47
	 * <!-- begin-user-doc -->
48
	 * <!-- end-user-doc -->
49
	 * @generated
50
	 */
51
	public DynamicDelegationFactoryImpl() {
52
		super();
53
	}
54
55
	/**
56
	 * <!-- begin-user-doc -->
57
	 * <!-- end-user-doc -->
58
	 * @generated
59
	 */
60
	@Override
61
	public EObject create(EClass eClass) {
62
		switch (eClass.getClassifierID()) {
63
			case DynamicDelegationPackage.CLASS0: return createClass0();
64
			case DynamicDelegationPackage.CLASS1: return createClass1();
65
			default:
66
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
67
		}
68
	}
69
70
	/**
71
	 * <!-- begin-user-doc -->
72
	 * <!-- end-user-doc -->
73
	 * @generated
74
	 */
75
	public Class0 createClass0() {
76
		Class0Impl class0 = new Class0Impl();
77
		return class0;
78
	}
79
80
	/**
81
	 * <!-- begin-user-doc -->
82
	 * <!-- end-user-doc -->
83
	 * @generated
84
	 */
85
	public Class1 createClass1() {
86
		Class1Impl class1 = new Class1Impl();
87
		return class1;
88
	}
89
90
	/**
91
	 * <!-- begin-user-doc -->
92
	 * <!-- end-user-doc -->
93
	 * @generated
94
	 */
95
	public DynamicDelegationPackage getDynamicDelegationPackage() {
96
		return (DynamicDelegationPackage)getEPackage();
97
	}
98
99
	/**
100
	 * <!-- begin-user-doc -->
101
	 * <!-- end-user-doc -->
102
	 * @deprecated
103
	 * @generated
104
	 */
105
	@Deprecated
106
	public static DynamicDelegationPackage getPackage() {
107
		return DynamicDelegationPackage.eINSTANCE;
108
	}
109
110
} //DynamicDelegationFactoryImpl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/DynamicDelegationPackageImpl.java (+291 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl;
8
9
import org.eclipse.emf.ecore.EAttribute;
10
import org.eclipse.emf.ecore.EClass;
11
import org.eclipse.emf.ecore.EPackage;
12
import org.eclipse.emf.ecore.EReference;
13
14
import org.eclipse.emf.ecore.impl.EPackageImpl;
15
16
import org.eclipse.emf.test.models.dynamicDelegation.Class0;
17
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
18
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory;
19
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
20
21
/**
22
 * <!-- begin-user-doc -->
23
 * An implementation of the model <b>Package</b>.
24
 * <!-- end-user-doc -->
25
 * @generated
26
 */
27
public class DynamicDelegationPackageImpl extends EPackageImpl implements DynamicDelegationPackage {
28
	/**
29
	 * <!-- begin-user-doc -->
30
	 * <!-- end-user-doc -->
31
	 * @generated
32
	 */
33
	private EClass class0EClass = null;
34
35
	/**
36
	 * <!-- begin-user-doc -->
37
	 * <!-- end-user-doc -->
38
	 * @generated
39
	 */
40
	private EClass class1EClass = null;
41
42
	/**
43
	 * Creates an instance of the model <b>Package</b>, registered with
44
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
45
	 * package URI value.
46
	 * <p>Note: the correct way to create the package is via the static
47
	 * factory method {@link #init init()}, which also performs
48
	 * initialization of the package, or returns the registered package,
49
	 * if one already exists.
50
	 * <!-- begin-user-doc -->
51
	 * <!-- end-user-doc -->
52
	 * @see org.eclipse.emf.ecore.EPackage.Registry
53
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#eNS_URI
54
	 * @see #init()
55
	 * @generated
56
	 */
57
	private DynamicDelegationPackageImpl() {
58
		super(eNS_URI, DynamicDelegationFactory.eINSTANCE);
59
	}
60
61
	/**
62
	 * <!-- begin-user-doc -->
63
	 * <!-- end-user-doc -->
64
	 * @generated
65
	 */
66
	private static boolean isInited = false;
67
68
	/**
69
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
70
	 * 
71
	 * <p>This method is used to initialize {@link DynamicDelegationPackage#eINSTANCE} when that field is accessed.
72
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
73
	 * <!-- begin-user-doc -->
74
	 * <!-- end-user-doc -->
75
	 * @see #eNS_URI
76
	 * @see #createPackageContents()
77
	 * @see #initializePackageContents()
78
	 * @generated
79
	 */
80
	public static DynamicDelegationPackage init() {
81
		if (isInited) return (DynamicDelegationPackage)EPackage.Registry.INSTANCE.getEPackage(DynamicDelegationPackage.eNS_URI);
82
83
		// Obtain or create and register package
84
		DynamicDelegationPackageImpl theDynamicDelegationPackage = (DynamicDelegationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DynamicDelegationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DynamicDelegationPackageImpl());
85
86
		isInited = true;
87
88
		// Create package meta-data objects
89
		theDynamicDelegationPackage.createPackageContents();
90
91
		// Initialize created meta-data
92
		theDynamicDelegationPackage.initializePackageContents();
93
94
		// Mark meta-data to indicate it can't be changed
95
		theDynamicDelegationPackage.freeze();
96
97
  
98
		// Update the registry and return the package
99
		EPackage.Registry.INSTANCE.put(DynamicDelegationPackage.eNS_URI, theDynamicDelegationPackage);
100
		return theDynamicDelegationPackage;
101
	}
102
103
	/**
104
	 * <!-- begin-user-doc -->
105
	 * <!-- end-user-doc -->
106
	 * @generated
107
	 */
108
	public EClass getClass0() {
109
		return class0EClass;
110
	}
111
112
	/**
113
	 * <!-- begin-user-doc -->
114
	 * <!-- end-user-doc -->
115
	 * @generated
116
	 */
117
	public EAttribute getClass0_TestBoolean() {
118
		return (EAttribute)class0EClass.getEStructuralFeatures().get(0);
119
	}
120
121
	/**
122
	 * <!-- begin-user-doc -->
123
	 * <!-- end-user-doc -->
124
	 * @generated
125
	 */
126
	public EAttribute getClass0_TestByte() {
127
		return (EAttribute)class0EClass.getEStructuralFeatures().get(1);
128
	}
129
130
	/**
131
	 * <!-- begin-user-doc -->
132
	 * <!-- end-user-doc -->
133
	 * @generated
134
	 */
135
	public EAttribute getClass0_TestChar() {
136
		return (EAttribute)class0EClass.getEStructuralFeatures().get(2);
137
	}
138
139
	/**
140
	 * <!-- begin-user-doc -->
141
	 * <!-- end-user-doc -->
142
	 * @generated
143
	 */
144
	public EAttribute getClass0_TestDouble() {
145
		return (EAttribute)class0EClass.getEStructuralFeatures().get(3);
146
	}
147
148
	/**
149
	 * <!-- begin-user-doc -->
150
	 * <!-- end-user-doc -->
151
	 * @generated
152
	 */
153
	public EAttribute getClass0_TestFloat() {
154
		return (EAttribute)class0EClass.getEStructuralFeatures().get(4);
155
	}
156
157
	/**
158
	 * <!-- begin-user-doc -->
159
	 * <!-- end-user-doc -->
160
	 * @generated
161
	 */
162
	public EAttribute getClass0_TestInt() {
163
		return (EAttribute)class0EClass.getEStructuralFeatures().get(5);
164
	}
165
166
	/**
167
	 * <!-- begin-user-doc -->
168
	 * <!-- end-user-doc -->
169
	 * @generated
170
	 */
171
	public EAttribute getClass0_TestLong() {
172
		return (EAttribute)class0EClass.getEStructuralFeatures().get(6);
173
	}
174
175
	/**
176
	 * <!-- begin-user-doc -->
177
	 * <!-- end-user-doc -->
178
	 * @generated
179
	 */
180
	public EAttribute getClass0_TestShort() {
181
		return (EAttribute)class0EClass.getEStructuralFeatures().get(7);
182
	}
183
184
	/**
185
	 * <!-- begin-user-doc -->
186
	 * <!-- end-user-doc -->
187
	 * @generated
188
	 */
189
	public EReference getClass0_Class1() {
190
		return (EReference)class0EClass.getEStructuralFeatures().get(8);
191
	}
192
193
	/**
194
	 * <!-- begin-user-doc -->
195
	 * <!-- end-user-doc -->
196
	 * @generated
197
	 */
198
	public EClass getClass1() {
199
		return class1EClass;
200
	}
201
202
	/**
203
	 * <!-- begin-user-doc -->
204
	 * <!-- end-user-doc -->
205
	 * @generated
206
	 */
207
	public DynamicDelegationFactory getDynamicDelegationFactory() {
208
		return (DynamicDelegationFactory)getEFactoryInstance();
209
	}
210
211
	/**
212
	 * <!-- begin-user-doc -->
213
	 * <!-- end-user-doc -->
214
	 * @generated
215
	 */
216
	private boolean isCreated = false;
217
218
	/**
219
	 * Creates the meta-model objects for the package.  This method is
220
	 * guarded to have no affect on any invocation but its first.
221
	 * <!-- begin-user-doc -->
222
	 * <!-- end-user-doc -->
223
	 * @generated
224
	 */
225
	public void createPackageContents() {
226
		if (isCreated) return;
227
		isCreated = true;
228
229
		// Create classes and their features
230
		class0EClass = createEClass(CLASS0);
231
		createEAttribute(class0EClass, CLASS0__TEST_BOOLEAN);
232
		createEAttribute(class0EClass, CLASS0__TEST_BYTE);
233
		createEAttribute(class0EClass, CLASS0__TEST_CHAR);
234
		createEAttribute(class0EClass, CLASS0__TEST_DOUBLE);
235
		createEAttribute(class0EClass, CLASS0__TEST_FLOAT);
236
		createEAttribute(class0EClass, CLASS0__TEST_INT);
237
		createEAttribute(class0EClass, CLASS0__TEST_LONG);
238
		createEAttribute(class0EClass, CLASS0__TEST_SHORT);
239
		createEReference(class0EClass, CLASS0__CLASS1);
240
241
		class1EClass = createEClass(CLASS1);
242
	}
243
244
	/**
245
	 * <!-- begin-user-doc -->
246
	 * <!-- end-user-doc -->
247
	 * @generated
248
	 */
249
	private boolean isInitialized = false;
250
251
	/**
252
	 * Complete the initialization of the package and its meta-model.  This
253
	 * method is guarded to have no affect on any invocation but its first.
254
	 * <!-- begin-user-doc -->
255
	 * <!-- end-user-doc -->
256
	 * @generated
257
	 */
258
	public void initializePackageContents() {
259
		if (isInitialized) return;
260
		isInitialized = true;
261
262
		// Initialize package
263
		setName(eNAME);
264
		setNsPrefix(eNS_PREFIX);
265
		setNsURI(eNS_URI);
266
267
		// Create type parameters
268
269
		// Set bounds for type parameters
270
271
		// Add supertypes to classes
272
273
		// Initialize classes and features; add operations and parameters
274
		initEClass(class0EClass, Class0.class, "Class0", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
275
		initEAttribute(getClass0_TestBoolean(), ecorePackage.getEBoolean(), "testBoolean", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
276
		initEAttribute(getClass0_TestByte(), ecorePackage.getEByte(), "testByte", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
277
		initEAttribute(getClass0_TestChar(), ecorePackage.getEChar(), "testChar", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
278
		initEAttribute(getClass0_TestDouble(), ecorePackage.getEDouble(), "testDouble", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
279
		initEAttribute(getClass0_TestFloat(), ecorePackage.getEFloat(), "testFloat", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
280
		initEAttribute(getClass0_TestInt(), ecorePackage.getEInt(), "testInt", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
281
		initEAttribute(getClass0_TestLong(), ecorePackage.getELong(), "testLong", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
282
		initEAttribute(getClass0_TestShort(), ecorePackage.getEShort(), "testShort", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
283
		initEReference(getClass0_Class1(), this.getClass1(), null, "class1", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
284
285
		initEClass(class1EClass, Class1.class, "Class1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
286
287
		// Create resource
288
		createResource(eNS_URI);
289
	}
290
291
} //DynamicDelegationPackageImpl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class0Impl.java (+609 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl.none;
8
9
import org.eclipse.emf.common.notify.Notification;
10
import org.eclipse.emf.common.notify.NotificationChain;
11
12
import org.eclipse.emf.ecore.EClass;
13
import org.eclipse.emf.ecore.InternalEObject;
14
15
import org.eclipse.emf.ecore.impl.ENotificationImpl;
16
import org.eclipse.emf.ecore.impl.EObjectImpl;
17
18
import org.eclipse.emf.test.models.dynamicDelegation.Class0;
19
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
20
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
21
22
/**
23
 * <!-- begin-user-doc -->
24
 * An implementation of the model object '<em><b>Class0</b></em>'.
25
 * <!-- end-user-doc -->
26
 * <p>
27
 * The following features are implemented:
28
 * <ul>
29
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#isTestBoolean <em>Test Boolean</em>}</li>
30
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestByte <em>Test Byte</em>}</li>
31
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestChar <em>Test Char</em>}</li>
32
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestDouble <em>Test Double</em>}</li>
33
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestFloat <em>Test Float</em>}</li>
34
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestInt <em>Test Int</em>}</li>
35
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestLong <em>Test Long</em>}</li>
36
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getTestShort <em>Test Short</em>}</li>
37
 *   <li>{@link org.eclipse.emf.test.models.dynamicDelegation.impl.none.Class0Impl#getClass1 <em>Class1</em>}</li>
38
 * </ul>
39
 * </p>
40
 *
41
 * @generated
42
 */
43
public class Class0Impl extends EObjectImpl implements Class0 {
44
	/**
45
	 * The default value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute.
46
	 * <!-- begin-user-doc -->
47
	 * <!-- end-user-doc -->
48
	 * @see #isTestBoolean()
49
	 * @generated
50
	 * @ordered
51
	 */
52
	protected static final boolean TEST_BOOLEAN_EDEFAULT = false;
53
	/**
54
	 * The cached value of the '{@link #isTestBoolean() <em>Test Boolean</em>}' attribute.
55
	 * <!-- begin-user-doc -->
56
	 * <!-- end-user-doc -->
57
	 * @see #isTestBoolean()
58
	 * @generated
59
	 * @ordered
60
	 */
61
	protected boolean testBoolean = TEST_BOOLEAN_EDEFAULT;
62
	/**
63
	 * The default value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute.
64
	 * <!-- begin-user-doc -->
65
	 * <!-- end-user-doc -->
66
	 * @see #getTestByte()
67
	 * @generated
68
	 * @ordered
69
	 */
70
	protected static final byte TEST_BYTE_EDEFAULT = 0x00;
71
	/**
72
	 * The cached value of the '{@link #getTestByte() <em>Test Byte</em>}' attribute.
73
	 * <!-- begin-user-doc -->
74
	 * <!-- end-user-doc -->
75
	 * @see #getTestByte()
76
	 * @generated
77
	 * @ordered
78
	 */
79
	protected byte testByte = TEST_BYTE_EDEFAULT;
80
	/**
81
	 * The default value of the '{@link #getTestChar() <em>Test Char</em>}' attribute.
82
	 * <!-- begin-user-doc -->
83
	 * <!-- end-user-doc -->
84
	 * @see #getTestChar()
85
	 * @generated
86
	 * @ordered
87
	 */
88
	protected static final char TEST_CHAR_EDEFAULT = '\u0000';
89
	/**
90
	 * The cached value of the '{@link #getTestChar() <em>Test Char</em>}' attribute.
91
	 * <!-- begin-user-doc -->
92
	 * <!-- end-user-doc -->
93
	 * @see #getTestChar()
94
	 * @generated
95
	 * @ordered
96
	 */
97
	protected char testChar = TEST_CHAR_EDEFAULT;
98
	/**
99
	 * The default value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute.
100
	 * <!-- begin-user-doc -->
101
	 * <!-- end-user-doc -->
102
	 * @see #getTestDouble()
103
	 * @generated
104
	 * @ordered
105
	 */
106
	protected static final double TEST_DOUBLE_EDEFAULT = 0.0;
107
	/**
108
	 * The cached value of the '{@link #getTestDouble() <em>Test Double</em>}' attribute.
109
	 * <!-- begin-user-doc -->
110
	 * <!-- end-user-doc -->
111
	 * @see #getTestDouble()
112
	 * @generated
113
	 * @ordered
114
	 */
115
	protected double testDouble = TEST_DOUBLE_EDEFAULT;
116
	/**
117
	 * The default value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute.
118
	 * <!-- begin-user-doc -->
119
	 * <!-- end-user-doc -->
120
	 * @see #getTestFloat()
121
	 * @generated
122
	 * @ordered
123
	 */
124
	protected static final float TEST_FLOAT_EDEFAULT = 0.0F;
125
	/**
126
	 * The cached value of the '{@link #getTestFloat() <em>Test Float</em>}' attribute.
127
	 * <!-- begin-user-doc -->
128
	 * <!-- end-user-doc -->
129
	 * @see #getTestFloat()
130
	 * @generated
131
	 * @ordered
132
	 */
133
	protected float testFloat = TEST_FLOAT_EDEFAULT;
134
	/**
135
	 * The default value of the '{@link #getTestInt() <em>Test Int</em>}' attribute.
136
	 * <!-- begin-user-doc -->
137
	 * <!-- end-user-doc -->
138
	 * @see #getTestInt()
139
	 * @generated
140
	 * @ordered
141
	 */
142
	protected static final int TEST_INT_EDEFAULT = 0;
143
	/**
144
	 * The cached value of the '{@link #getTestInt() <em>Test Int</em>}' attribute.
145
	 * <!-- begin-user-doc -->
146
	 * <!-- end-user-doc -->
147
	 * @see #getTestInt()
148
	 * @generated
149
	 * @ordered
150
	 */
151
	protected int testInt = TEST_INT_EDEFAULT;
152
	/**
153
	 * The default value of the '{@link #getTestLong() <em>Test Long</em>}' attribute.
154
	 * <!-- begin-user-doc -->
155
	 * <!-- end-user-doc -->
156
	 * @see #getTestLong()
157
	 * @generated
158
	 * @ordered
159
	 */
160
	protected static final long TEST_LONG_EDEFAULT = 0L;
161
	/**
162
	 * The cached value of the '{@link #getTestLong() <em>Test Long</em>}' attribute.
163
	 * <!-- begin-user-doc -->
164
	 * <!-- end-user-doc -->
165
	 * @see #getTestLong()
166
	 * @generated
167
	 * @ordered
168
	 */
169
	protected long testLong = TEST_LONG_EDEFAULT;
170
	/**
171
	 * The default value of the '{@link #getTestShort() <em>Test Short</em>}' attribute.
172
	 * <!-- begin-user-doc -->
173
	 * <!-- end-user-doc -->
174
	 * @see #getTestShort()
175
	 * @generated
176
	 * @ordered
177
	 */
178
	protected static final short TEST_SHORT_EDEFAULT = 0;
179
	/**
180
	 * The cached value of the '{@link #getTestShort() <em>Test Short</em>}' attribute.
181
	 * <!-- begin-user-doc -->
182
	 * <!-- end-user-doc -->
183
	 * @see #getTestShort()
184
	 * @generated
185
	 * @ordered
186
	 */
187
	protected short testShort = TEST_SHORT_EDEFAULT;
188
	/**
189
	 * The cached value of the '{@link #getClass1() <em>Class1</em>}' containment reference.
190
	 * <!-- begin-user-doc -->
191
	 * <!-- end-user-doc -->
192
	 * @see #getClass1()
193
	 * @generated
194
	 * @ordered
195
	 */
196
	protected Class1 class1;
197
	/**
198
	 * <!-- begin-user-doc -->
199
	 * <!-- end-user-doc -->
200
	 * @generated
201
	 */
202
	protected Class0Impl() {
203
		super();
204
	}
205
206
	/**
207
	 * <!-- begin-user-doc -->
208
	 * <!-- end-user-doc -->
209
	 * @generated
210
	 */
211
	@Override
212
	protected EClass eStaticClass() {
213
		return DynamicDelegationPackage.Literals.CLASS0;
214
	}
215
216
	/**
217
	 * <!-- begin-user-doc -->
218
	 * <!-- end-user-doc -->
219
	 * @generated
220
	 */
221
	public boolean isTestBoolean() {
222
		return testBoolean;
223
	}
224
225
	/**
226
	 * <!-- begin-user-doc -->
227
	 * <!-- end-user-doc -->
228
	 * @generated
229
	 */
230
	public void setTestBoolean(boolean newTestBoolean) {
231
		boolean oldTestBoolean = testBoolean;
232
		testBoolean = newTestBoolean;
233
		if (eNotificationRequired())
234
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_BOOLEAN, oldTestBoolean, testBoolean));
235
	}
236
237
	/**
238
	 * <!-- begin-user-doc -->
239
	 * <!-- end-user-doc -->
240
	 * @generated
241
	 */
242
	public byte getTestByte() {
243
		return testByte;
244
	}
245
246
	/**
247
	 * <!-- begin-user-doc -->
248
	 * <!-- end-user-doc -->
249
	 * @generated
250
	 */
251
	public void setTestByte(byte newTestByte) {
252
		byte oldTestByte = testByte;
253
		testByte = newTestByte;
254
		if (eNotificationRequired())
255
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_BYTE, oldTestByte, testByte));
256
	}
257
258
	/**
259
	 * <!-- begin-user-doc -->
260
	 * <!-- end-user-doc -->
261
	 * @generated
262
	 */
263
	public char getTestChar() {
264
		return testChar;
265
	}
266
267
	/**
268
	 * <!-- begin-user-doc -->
269
	 * <!-- end-user-doc -->
270
	 * @generated
271
	 */
272
	public void setTestChar(char newTestChar) {
273
		char oldTestChar = testChar;
274
		testChar = newTestChar;
275
		if (eNotificationRequired())
276
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_CHAR, oldTestChar, testChar));
277
	}
278
279
	/**
280
	 * <!-- begin-user-doc -->
281
	 * <!-- end-user-doc -->
282
	 * @generated
283
	 */
284
	public double getTestDouble() {
285
		return testDouble;
286
	}
287
288
	/**
289
	 * <!-- begin-user-doc -->
290
	 * <!-- end-user-doc -->
291
	 * @generated
292
	 */
293
	public void setTestDouble(double newTestDouble) {
294
		double oldTestDouble = testDouble;
295
		testDouble = newTestDouble;
296
		if (eNotificationRequired())
297
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_DOUBLE, oldTestDouble, testDouble));
298
	}
299
300
	/**
301
	 * <!-- begin-user-doc -->
302
	 * <!-- end-user-doc -->
303
	 * @generated
304
	 */
305
	public float getTestFloat() {
306
		return testFloat;
307
	}
308
309
	/**
310
	 * <!-- begin-user-doc -->
311
	 * <!-- end-user-doc -->
312
	 * @generated
313
	 */
314
	public void setTestFloat(float newTestFloat) {
315
		float oldTestFloat = testFloat;
316
		testFloat = newTestFloat;
317
		if (eNotificationRequired())
318
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_FLOAT, oldTestFloat, testFloat));
319
	}
320
321
	/**
322
	 * <!-- begin-user-doc -->
323
	 * <!-- end-user-doc -->
324
	 * @generated
325
	 */
326
	public int getTestInt() {
327
		return testInt;
328
	}
329
330
	/**
331
	 * <!-- begin-user-doc -->
332
	 * <!-- end-user-doc -->
333
	 * @generated
334
	 */
335
	public void setTestInt(int newTestInt) {
336
		int oldTestInt = testInt;
337
		testInt = newTestInt;
338
		if (eNotificationRequired())
339
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_INT, oldTestInt, testInt));
340
	}
341
342
	/**
343
	 * <!-- begin-user-doc -->
344
	 * <!-- end-user-doc -->
345
	 * @generated
346
	 */
347
	public long getTestLong() {
348
		return testLong;
349
	}
350
351
	/**
352
	 * <!-- begin-user-doc -->
353
	 * <!-- end-user-doc -->
354
	 * @generated
355
	 */
356
	public void setTestLong(long newTestLong) {
357
		long oldTestLong = testLong;
358
		testLong = newTestLong;
359
		if (eNotificationRequired())
360
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_LONG, oldTestLong, testLong));
361
	}
362
363
	/**
364
	 * <!-- begin-user-doc -->
365
	 * <!-- end-user-doc -->
366
	 * @generated
367
	 */
368
	public short getTestShort() {
369
		return testShort;
370
	}
371
372
	/**
373
	 * <!-- begin-user-doc -->
374
	 * <!-- end-user-doc -->
375
	 * @generated
376
	 */
377
	public void setTestShort(short newTestShort) {
378
		short oldTestShort = testShort;
379
		testShort = newTestShort;
380
		if (eNotificationRequired())
381
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__TEST_SHORT, oldTestShort, testShort));
382
	}
383
384
	/**
385
	 * <!-- begin-user-doc -->
386
	 * <!-- end-user-doc -->
387
	 * @generated
388
	 */
389
	public Class1 getClass1() {
390
		return class1;
391
	}
392
393
	/**
394
	 * <!-- begin-user-doc -->
395
	 * <!-- end-user-doc -->
396
	 * @generated
397
	 */
398
	public NotificationChain basicSetClass1(Class1 newClass1, NotificationChain msgs) {
399
		Class1 oldClass1 = class1;
400
		class1 = newClass1;
401
		if (eNotificationRequired()) {
402
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__CLASS1, oldClass1, newClass1);
403
			if (msgs == null) msgs = notification; else msgs.add(notification);
404
		}
405
		return msgs;
406
	}
407
408
	/**
409
	 * <!-- begin-user-doc -->
410
	 * <!-- end-user-doc -->
411
	 * @generated
412
	 */
413
	public void setClass1(Class1 newClass1) {
414
		if (newClass1 != class1) {
415
			NotificationChain msgs = null;
416
			if (class1 != null)
417
				msgs = ((InternalEObject)class1).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DynamicDelegationPackage.CLASS0__CLASS1, null, msgs);
418
			if (newClass1 != null)
419
				msgs = ((InternalEObject)newClass1).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DynamicDelegationPackage.CLASS0__CLASS1, null, msgs);
420
			msgs = basicSetClass1(newClass1, msgs);
421
			if (msgs != null) msgs.dispatch();
422
		}
423
		else if (eNotificationRequired())
424
			eNotify(new ENotificationImpl(this, Notification.SET, DynamicDelegationPackage.CLASS0__CLASS1, newClass1, newClass1));
425
	}
426
427
	/**
428
	 * <!-- begin-user-doc -->
429
	 * <!-- end-user-doc -->
430
	 * @generated
431
	 */
432
	@Override
433
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
434
		switch (featureID) {
435
			case DynamicDelegationPackage.CLASS0__CLASS1:
436
				return basicSetClass1(null, msgs);
437
		}
438
		return super.eInverseRemove(otherEnd, featureID, msgs);
439
	}
440
441
	/**
442
	 * <!-- begin-user-doc -->
443
	 * <!-- end-user-doc -->
444
	 * @generated
445
	 */
446
	@Override
447
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
448
		switch (featureID) {
449
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
450
				return isTestBoolean();
451
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
452
				return getTestByte();
453
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
454
				return getTestChar();
455
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
456
				return getTestDouble();
457
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
458
				return getTestFloat();
459
			case DynamicDelegationPackage.CLASS0__TEST_INT:
460
				return getTestInt();
461
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
462
				return getTestLong();
463
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
464
				return getTestShort();
465
			case DynamicDelegationPackage.CLASS0__CLASS1:
466
				return getClass1();
467
		}
468
		return super.eGet(featureID, resolve, coreType);
469
	}
470
471
	/**
472
	 * <!-- begin-user-doc -->
473
	 * <!-- end-user-doc -->
474
	 * @generated
475
	 */
476
	@Override
477
	public void eSet(int featureID, Object newValue) {
478
		switch (featureID) {
479
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
480
				setTestBoolean((Boolean)newValue);
481
				return;
482
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
483
				setTestByte((Byte)newValue);
484
				return;
485
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
486
				setTestChar((Character)newValue);
487
				return;
488
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
489
				setTestDouble((Double)newValue);
490
				return;
491
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
492
				setTestFloat((Float)newValue);
493
				return;
494
			case DynamicDelegationPackage.CLASS0__TEST_INT:
495
				setTestInt((Integer)newValue);
496
				return;
497
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
498
				setTestLong((Long)newValue);
499
				return;
500
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
501
				setTestShort((Short)newValue);
502
				return;
503
			case DynamicDelegationPackage.CLASS0__CLASS1:
504
				setClass1((Class1)newValue);
505
				return;
506
		}
507
		super.eSet(featureID, newValue);
508
	}
509
510
	/**
511
	 * <!-- begin-user-doc -->
512
	 * <!-- end-user-doc -->
513
	 * @generated
514
	 */
515
	@Override
516
	public void eUnset(int featureID) {
517
		switch (featureID) {
518
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
519
				setTestBoolean(TEST_BOOLEAN_EDEFAULT);
520
				return;
521
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
522
				setTestByte(TEST_BYTE_EDEFAULT);
523
				return;
524
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
525
				setTestChar(TEST_CHAR_EDEFAULT);
526
				return;
527
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
528
				setTestDouble(TEST_DOUBLE_EDEFAULT);
529
				return;
530
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
531
				setTestFloat(TEST_FLOAT_EDEFAULT);
532
				return;
533
			case DynamicDelegationPackage.CLASS0__TEST_INT:
534
				setTestInt(TEST_INT_EDEFAULT);
535
				return;
536
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
537
				setTestLong(TEST_LONG_EDEFAULT);
538
				return;
539
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
540
				setTestShort(TEST_SHORT_EDEFAULT);
541
				return;
542
			case DynamicDelegationPackage.CLASS0__CLASS1:
543
				setClass1((Class1)null);
544
				return;
545
		}
546
		super.eUnset(featureID);
547
	}
548
549
	/**
550
	 * <!-- begin-user-doc -->
551
	 * <!-- end-user-doc -->
552
	 * @generated
553
	 */
554
	@Override
555
	public boolean eIsSet(int featureID) {
556
		switch (featureID) {
557
			case DynamicDelegationPackage.CLASS0__TEST_BOOLEAN:
558
				return testBoolean != TEST_BOOLEAN_EDEFAULT;
559
			case DynamicDelegationPackage.CLASS0__TEST_BYTE:
560
				return testByte != TEST_BYTE_EDEFAULT;
561
			case DynamicDelegationPackage.CLASS0__TEST_CHAR:
562
				return testChar != TEST_CHAR_EDEFAULT;
563
			case DynamicDelegationPackage.CLASS0__TEST_DOUBLE:
564
				return testDouble != TEST_DOUBLE_EDEFAULT;
565
			case DynamicDelegationPackage.CLASS0__TEST_FLOAT:
566
				return testFloat != TEST_FLOAT_EDEFAULT;
567
			case DynamicDelegationPackage.CLASS0__TEST_INT:
568
				return testInt != TEST_INT_EDEFAULT;
569
			case DynamicDelegationPackage.CLASS0__TEST_LONG:
570
				return testLong != TEST_LONG_EDEFAULT;
571
			case DynamicDelegationPackage.CLASS0__TEST_SHORT:
572
				return testShort != TEST_SHORT_EDEFAULT;
573
			case DynamicDelegationPackage.CLASS0__CLASS1:
574
				return class1 != null;
575
		}
576
		return super.eIsSet(featureID);
577
	}
578
579
	/**
580
	 * <!-- begin-user-doc -->
581
	 * <!-- end-user-doc -->
582
	 * @generated
583
	 */
584
	@Override
585
	public String toString() {
586
		if (eIsProxy()) return super.toString();
587
588
		StringBuffer result = new StringBuffer(super.toString());
589
		result.append(" (testBoolean: ");
590
		result.append(testBoolean);
591
		result.append(", testByte: ");
592
		result.append(testByte);
593
		result.append(", testChar: ");
594
		result.append(testChar);
595
		result.append(", testDouble: ");
596
		result.append(testDouble);
597
		result.append(", testFloat: ");
598
		result.append(testFloat);
599
		result.append(", testInt: ");
600
		result.append(testInt);
601
		result.append(", testLong: ");
602
		result.append(testLong);
603
		result.append(", testShort: ");
604
		result.append(testShort);
605
		result.append(')');
606
		return result.toString();
607
	}
608
609
} //Class0Impl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/Class1Impl.java (+45 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl.none;
8
9
import org.eclipse.emf.ecore.EClass;
10
11
import org.eclipse.emf.ecore.impl.EObjectImpl;
12
13
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
14
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
15
16
/**
17
 * <!-- begin-user-doc -->
18
 * An implementation of the model object '<em><b>Class1</b></em>'.
19
 * <!-- end-user-doc -->
20
 * <p>
21
 * </p>
22
 *
23
 * @generated
24
 */
25
public class Class1Impl extends EObjectImpl implements Class1 {
26
	/**
27
	 * <!-- begin-user-doc -->
28
	 * <!-- end-user-doc -->
29
	 * @generated
30
	 */
31
	protected Class1Impl() {
32
		super();
33
	}
34
35
	/**
36
	 * <!-- begin-user-doc -->
37
	 * <!-- end-user-doc -->
38
	 * @generated
39
	 */
40
	@Override
41
	protected EClass eStaticClass() {
42
		return DynamicDelegationPackage.Literals.CLASS1;
43
	}
44
45
} //Class1Impl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationFactoryImpl.java (+110 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl.none;
8
9
import org.eclipse.emf.ecore.EClass;
10
import org.eclipse.emf.ecore.EObject;
11
import org.eclipse.emf.ecore.EPackage;
12
13
import org.eclipse.emf.ecore.impl.EFactoryImpl;
14
15
import org.eclipse.emf.ecore.plugin.EcorePlugin;
16
17
import org.eclipse.emf.test.models.dynamicDelegation.*;
18
19
/**
20
 * <!-- begin-user-doc -->
21
 * An implementation of the model <b>Factory</b>.
22
 * <!-- end-user-doc -->
23
 * @generated
24
 */
25
public class DynamicDelegationFactoryImpl extends EFactoryImpl implements DynamicDelegationFactory {
26
	/**
27
	 * Creates the default factory implementation.
28
	 * <!-- begin-user-doc -->
29
	 * <!-- end-user-doc -->
30
	 * @generated
31
	 */
32
	public static DynamicDelegationFactory init() {
33
		try {
34
			DynamicDelegationFactory theDynamicDelegationFactory = (DynamicDelegationFactory)EPackage.Registry.INSTANCE.getEFactory("http:///org.eclipse.emf.test.models/DynamicDelegation"); 
35
			if (theDynamicDelegationFactory != null) {
36
				return theDynamicDelegationFactory;
37
			}
38
		}
39
		catch (Exception exception) {
40
			EcorePlugin.INSTANCE.log(exception);
41
		}
42
		return new DynamicDelegationFactoryImpl();
43
	}
44
45
	/**
46
	 * Creates an instance of the factory.
47
	 * <!-- begin-user-doc -->
48
	 * <!-- end-user-doc -->
49
	 * @generated
50
	 */
51
	public DynamicDelegationFactoryImpl() {
52
		super();
53
	}
54
55
	/**
56
	 * <!-- begin-user-doc -->
57
	 * <!-- end-user-doc -->
58
	 * @generated
59
	 */
60
	@Override
61
	public EObject create(EClass eClass) {
62
		switch (eClass.getClassifierID()) {
63
			case DynamicDelegationPackage.CLASS0: return createClass0();
64
			case DynamicDelegationPackage.CLASS1: return createClass1();
65
			default:
66
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
67
		}
68
	}
69
70
	/**
71
	 * <!-- begin-user-doc -->
72
	 * <!-- end-user-doc -->
73
	 * @generated
74
	 */
75
	public Class0 createClass0() {
76
		Class0Impl class0 = new Class0Impl();
77
		return class0;
78
	}
79
80
	/**
81
	 * <!-- begin-user-doc -->
82
	 * <!-- end-user-doc -->
83
	 * @generated
84
	 */
85
	public Class1 createClass1() {
86
		Class1Impl class1 = new Class1Impl();
87
		return class1;
88
	}
89
90
	/**
91
	 * <!-- begin-user-doc -->
92
	 * <!-- end-user-doc -->
93
	 * @generated
94
	 */
95
	public DynamicDelegationPackage getDynamicDelegationPackage() {
96
		return (DynamicDelegationPackage)getEPackage();
97
	}
98
99
	/**
100
	 * <!-- begin-user-doc -->
101
	 * <!-- end-user-doc -->
102
	 * @deprecated
103
	 * @generated
104
	 */
105
	@Deprecated
106
	public static DynamicDelegationPackage getPackage() {
107
		return DynamicDelegationPackage.eINSTANCE;
108
	}
109
110
} //DynamicDelegationFactoryImpl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/impl/none/DynamicDelegationPackageImpl.java (+291 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.impl.none;
8
9
import org.eclipse.emf.ecore.EAttribute;
10
import org.eclipse.emf.ecore.EClass;
11
import org.eclipse.emf.ecore.EPackage;
12
import org.eclipse.emf.ecore.EReference;
13
14
import org.eclipse.emf.ecore.impl.EPackageImpl;
15
16
import org.eclipse.emf.test.models.dynamicDelegation.Class0;
17
import org.eclipse.emf.test.models.dynamicDelegation.Class1;
18
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationFactory;
19
import org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage;
20
21
/**
22
 * <!-- begin-user-doc -->
23
 * An implementation of the model <b>Package</b>.
24
 * <!-- end-user-doc -->
25
 * @generated
26
 */
27
public class DynamicDelegationPackageImpl extends EPackageImpl implements DynamicDelegationPackage {
28
	/**
29
	 * <!-- begin-user-doc -->
30
	 * <!-- end-user-doc -->
31
	 * @generated
32
	 */
33
	private EClass class0EClass = null;
34
35
	/**
36
	 * <!-- begin-user-doc -->
37
	 * <!-- end-user-doc -->
38
	 * @generated
39
	 */
40
	private EClass class1EClass = null;
41
42
	/**
43
	 * Creates an instance of the model <b>Package</b>, registered with
44
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
45
	 * package URI value.
46
	 * <p>Note: the correct way to create the package is via the static
47
	 * factory method {@link #init init()}, which also performs
48
	 * initialization of the package, or returns the registered package,
49
	 * if one already exists.
50
	 * <!-- begin-user-doc -->
51
	 * <!-- end-user-doc -->
52
	 * @see org.eclipse.emf.ecore.EPackage.Registry
53
	 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage#eNS_URI
54
	 * @see #init()
55
	 * @generated
56
	 */
57
	private DynamicDelegationPackageImpl() {
58
		super(eNS_URI, DynamicDelegationFactory.eINSTANCE);
59
	}
60
61
	/**
62
	 * <!-- begin-user-doc -->
63
	 * <!-- end-user-doc -->
64
	 * @generated
65
	 */
66
	private static boolean isInited = false;
67
68
	/**
69
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
70
	 * 
71
	 * <p>This method is used to initialize {@link DynamicDelegationPackage#eINSTANCE} when that field is accessed.
72
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
73
	 * <!-- begin-user-doc -->
74
	 * <!-- end-user-doc -->
75
	 * @see #eNS_URI
76
	 * @see #createPackageContents()
77
	 * @see #initializePackageContents()
78
	 * @generated
79
	 */
80
	public static DynamicDelegationPackage init() {
81
		if (isInited) return (DynamicDelegationPackage)EPackage.Registry.INSTANCE.getEPackage(DynamicDelegationPackage.eNS_URI);
82
83
		// Obtain or create and register package
84
		DynamicDelegationPackageImpl theDynamicDelegationPackage = (DynamicDelegationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DynamicDelegationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DynamicDelegationPackageImpl());
85
86
		isInited = true;
87
88
		// Create package meta-data objects
89
		theDynamicDelegationPackage.createPackageContents();
90
91
		// Initialize created meta-data
92
		theDynamicDelegationPackage.initializePackageContents();
93
94
		// Mark meta-data to indicate it can't be changed
95
		theDynamicDelegationPackage.freeze();
96
97
  
98
		// Update the registry and return the package
99
		EPackage.Registry.INSTANCE.put(DynamicDelegationPackage.eNS_URI, theDynamicDelegationPackage);
100
		return theDynamicDelegationPackage;
101
	}
102
103
	/**
104
	 * <!-- begin-user-doc -->
105
	 * <!-- end-user-doc -->
106
	 * @generated
107
	 */
108
	public EClass getClass0() {
109
		return class0EClass;
110
	}
111
112
	/**
113
	 * <!-- begin-user-doc -->
114
	 * <!-- end-user-doc -->
115
	 * @generated
116
	 */
117
	public EAttribute getClass0_TestBoolean() {
118
		return (EAttribute)class0EClass.getEStructuralFeatures().get(0);
119
	}
120
121
	/**
122
	 * <!-- begin-user-doc -->
123
	 * <!-- end-user-doc -->
124
	 * @generated
125
	 */
126
	public EAttribute getClass0_TestByte() {
127
		return (EAttribute)class0EClass.getEStructuralFeatures().get(1);
128
	}
129
130
	/**
131
	 * <!-- begin-user-doc -->
132
	 * <!-- end-user-doc -->
133
	 * @generated
134
	 */
135
	public EAttribute getClass0_TestChar() {
136
		return (EAttribute)class0EClass.getEStructuralFeatures().get(2);
137
	}
138
139
	/**
140
	 * <!-- begin-user-doc -->
141
	 * <!-- end-user-doc -->
142
	 * @generated
143
	 */
144
	public EAttribute getClass0_TestDouble() {
145
		return (EAttribute)class0EClass.getEStructuralFeatures().get(3);
146
	}
147
148
	/**
149
	 * <!-- begin-user-doc -->
150
	 * <!-- end-user-doc -->
151
	 * @generated
152
	 */
153
	public EAttribute getClass0_TestFloat() {
154
		return (EAttribute)class0EClass.getEStructuralFeatures().get(4);
155
	}
156
157
	/**
158
	 * <!-- begin-user-doc -->
159
	 * <!-- end-user-doc -->
160
	 * @generated
161
	 */
162
	public EAttribute getClass0_TestInt() {
163
		return (EAttribute)class0EClass.getEStructuralFeatures().get(5);
164
	}
165
166
	/**
167
	 * <!-- begin-user-doc -->
168
	 * <!-- end-user-doc -->
169
	 * @generated
170
	 */
171
	public EAttribute getClass0_TestLong() {
172
		return (EAttribute)class0EClass.getEStructuralFeatures().get(6);
173
	}
174
175
	/**
176
	 * <!-- begin-user-doc -->
177
	 * <!-- end-user-doc -->
178
	 * @generated
179
	 */
180
	public EAttribute getClass0_TestShort() {
181
		return (EAttribute)class0EClass.getEStructuralFeatures().get(7);
182
	}
183
184
	/**
185
	 * <!-- begin-user-doc -->
186
	 * <!-- end-user-doc -->
187
	 * @generated
188
	 */
189
	public EReference getClass0_Class1() {
190
		return (EReference)class0EClass.getEStructuralFeatures().get(8);
191
	}
192
193
	/**
194
	 * <!-- begin-user-doc -->
195
	 * <!-- end-user-doc -->
196
	 * @generated
197
	 */
198
	public EClass getClass1() {
199
		return class1EClass;
200
	}
201
202
	/**
203
	 * <!-- begin-user-doc -->
204
	 * <!-- end-user-doc -->
205
	 * @generated
206
	 */
207
	public DynamicDelegationFactory getDynamicDelegationFactory() {
208
		return (DynamicDelegationFactory)getEFactoryInstance();
209
	}
210
211
	/**
212
	 * <!-- begin-user-doc -->
213
	 * <!-- end-user-doc -->
214
	 * @generated
215
	 */
216
	private boolean isCreated = false;
217
218
	/**
219
	 * Creates the meta-model objects for the package.  This method is
220
	 * guarded to have no affect on any invocation but its first.
221
	 * <!-- begin-user-doc -->
222
	 * <!-- end-user-doc -->
223
	 * @generated
224
	 */
225
	public void createPackageContents() {
226
		if (isCreated) return;
227
		isCreated = true;
228
229
		// Create classes and their features
230
		class0EClass = createEClass(CLASS0);
231
		createEAttribute(class0EClass, CLASS0__TEST_BOOLEAN);
232
		createEAttribute(class0EClass, CLASS0__TEST_BYTE);
233
		createEAttribute(class0EClass, CLASS0__TEST_CHAR);
234
		createEAttribute(class0EClass, CLASS0__TEST_DOUBLE);
235
		createEAttribute(class0EClass, CLASS0__TEST_FLOAT);
236
		createEAttribute(class0EClass, CLASS0__TEST_INT);
237
		createEAttribute(class0EClass, CLASS0__TEST_LONG);
238
		createEAttribute(class0EClass, CLASS0__TEST_SHORT);
239
		createEReference(class0EClass, CLASS0__CLASS1);
240
241
		class1EClass = createEClass(CLASS1);
242
	}
243
244
	/**
245
	 * <!-- begin-user-doc -->
246
	 * <!-- end-user-doc -->
247
	 * @generated
248
	 */
249
	private boolean isInitialized = false;
250
251
	/**
252
	 * Complete the initialization of the package and its meta-model.  This
253
	 * method is guarded to have no affect on any invocation but its first.
254
	 * <!-- begin-user-doc -->
255
	 * <!-- end-user-doc -->
256
	 * @generated
257
	 */
258
	public void initializePackageContents() {
259
		if (isInitialized) return;
260
		isInitialized = true;
261
262
		// Initialize package
263
		setName(eNAME);
264
		setNsPrefix(eNS_PREFIX);
265
		setNsURI(eNS_URI);
266
267
		// Create type parameters
268
269
		// Set bounds for type parameters
270
271
		// Add supertypes to classes
272
273
		// Initialize classes and features; add operations and parameters
274
		initEClass(class0EClass, Class0.class, "Class0", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
275
		initEAttribute(getClass0_TestBoolean(), ecorePackage.getEBoolean(), "testBoolean", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
276
		initEAttribute(getClass0_TestByte(), ecorePackage.getEByte(), "testByte", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
277
		initEAttribute(getClass0_TestChar(), ecorePackage.getEChar(), "testChar", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
278
		initEAttribute(getClass0_TestDouble(), ecorePackage.getEDouble(), "testDouble", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
279
		initEAttribute(getClass0_TestFloat(), ecorePackage.getEFloat(), "testFloat", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
280
		initEAttribute(getClass0_TestInt(), ecorePackage.getEInt(), "testInt", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
281
		initEAttribute(getClass0_TestLong(), ecorePackage.getELong(), "testLong", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
282
		initEAttribute(getClass0_TestShort(), ecorePackage.getEShort(), "testShort", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
283
		initEReference(getClass0_Class1(), this.getClass1(), null, "class1", null, 0, 1, Class0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
284
285
		initEClass(class1EClass, Class1.class, "Class1", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
286
287
		// Create resource
288
		createResource(eNS_URI);
289
	}
290
291
} //DynamicDelegationPackageImpl
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationAdapterFactory.java (+145 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.util;
8
9
import org.eclipse.core.runtime.Assert;
10
import org.eclipse.emf.common.notify.Adapter;
11
import org.eclipse.emf.common.notify.Notification;
12
import org.eclipse.emf.common.notify.Notifier;
13
14
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
15
import org.eclipse.emf.common.notify.impl.AdapterImpl;
16
17
import org.eclipse.emf.ecore.EObject;
18
19
import org.eclipse.emf.test.models.dynamicDelegation.*;
20
21
/**
22
 * <!-- begin-user-doc -->
23
 * The <b>Adapter Factory</b> for the model.
24
 * It provides an adapter <code>createXXX</code> method for each class of the model.
25
 * <!-- end-user-doc -->
26
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage
27
 * @generated
28
 */
29
public class DynamicDelegationAdapterFactory extends AdapterFactoryImpl {
30
	/**
31
	 * The cached model package.
32
	 * <!-- begin-user-doc -->
33
	 * <!-- end-user-doc -->
34
	 * @generated
35
	 */
36
	protected static DynamicDelegationPackage modelPackage;
37
38
	/**
39
	 * Creates an instance of the adapter factory.
40
	 * <!-- begin-user-doc -->
41
	 * <!-- end-user-doc -->
42
	 * @generated
43
	 */
44
	public DynamicDelegationAdapterFactory() {
45
		if (modelPackage == null) {
46
			modelPackage = DynamicDelegationPackage.eINSTANCE;
47
		}
48
	}
49
50
	/**
51
	 * Returns whether this factory is applicable for the type of the object.
52
	 * <!-- begin-user-doc -->
53
	 * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
54
	 * <!-- end-user-doc -->
55
	 * @return whether this factory is applicable for the type of the object.
56
	 * @generated
57
	 */
58
	@Override
59
	public boolean isFactoryForType(Object object) {
60
		if (object == modelPackage) {
61
			return true;
62
		}
63
		if (object instanceof EObject) {
64
			return ((EObject)object).eClass().getEPackage() == modelPackage;
65
		}
66
		return false;
67
	}
68
69
	/**
70
	 * The switch that delegates to the <code>createXXX</code> methods.
71
	 * <!-- begin-user-doc -->
72
	 * <!-- end-user-doc -->
73
	 * @generated
74
	 */
75
	protected DynamicDelegationSwitch<Adapter> modelSwitch =
76
		new DynamicDelegationSwitch<Adapter>() {
77
			@Override
78
			public Adapter caseClass0(Class0 object) {
79
				return createClass0Adapter();
80
			}
81
			@Override
82
			public Adapter caseClass1(Class1 object) {
83
				return createClass1Adapter();
84
			}
85
			@Override
86
			public Adapter defaultCase(EObject object) {
87
				return createEObjectAdapter();
88
			}
89
		};
90
91
	/**
92
	 * Creates an adapter for the <code>target</code>.
93
	 * <!-- begin-user-doc -->
94
	 * <!-- end-user-doc -->
95
	 * @param target the object to adapt.
96
	 * @return the adapter for the <code>target</code>.
97
	 * @generated
98
	 */
99
	@Override
100
	public Adapter createAdapter(Notifier target) {
101
		return modelSwitch.doSwitch((EObject)target);
102
	}
103
104
105
	/**
106
	 * Creates a new adapter for an object of class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class0 <em>Class0</em>}'.
107
	 * <!-- begin-user-doc -->
108
	 * This default implementation returns null so that we can easily ignore cases;
109
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
110
	 * <!-- end-user-doc -->
111
	 * @return the new adapter.
112
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class0
113
	 * @generated
114
	 */
115
	public Adapter createClass0Adapter() {
116
		return null;
117
	}
118
119
	/**
120
	 * Creates a new adapter for an object of class '{@link org.eclipse.emf.test.models.dynamicDelegation.Class1 <em>Class1</em>}'.
121
	 * <!-- begin-user-doc -->
122
	 * This default implementation returns null so that we can easily ignore cases;
123
	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
124
	 * <!-- end-user-doc -->
125
	 * @return the new adapter.
126
	 * @see org.eclipse.emf.test.models.dynamicDelegation.Class1
127
	 * @generated
128
	 */
129
	public Adapter createClass1Adapter() {
130
		return null;
131
	}
132
133
	/**
134
	 * Creates a new adapter for the default case.
135
	 * <!-- begin-user-doc -->
136
	 * This default implementation returns null.
137
	 * <!-- end-user-doc -->
138
	 * @return the new adapter.
139
	 * @generated
140
	 */
141
	public Adapter createEObjectAdapter() {
142
		return null;
143
	}
144
145
} //DynamicDelegationAdapterFactory
(-)tests/org.eclipse.emf.test.common/src/org/eclipse/emf/test/models/dynamicDelegation/util/DynamicDelegationSwitch.java (+135 lines)
Added Link Here
1
/**
2
 * <copyright>
3
 * </copyright>
4
 *
5
 * $Id$
6
 */
7
package org.eclipse.emf.test.models.dynamicDelegation.util;
8
9
import org.eclipse.emf.ecore.EObject;
10
import org.eclipse.emf.ecore.EPackage;
11
12
import org.eclipse.emf.ecore.util.Switch;
13
14
import org.eclipse.emf.test.models.dynamicDelegation.*;
15
16
/**
17
 * <!-- begin-user-doc -->
18
 * The <b>Switch</b> for the model's inheritance hierarchy.
19
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
20
 * to invoke the <code>caseXXX</code> method for each class of the model,
21
 * starting with the actual class of the object
22
 * and proceeding up the inheritance hierarchy
23
 * until a non-null result is returned,
24
 * which is the result of the switch.
25
 * <!-- end-user-doc -->
26
 * @see org.eclipse.emf.test.models.dynamicDelegation.DynamicDelegationPackage
27
 * @generated
28
 */
29
public class DynamicDelegationSwitch<T> extends Switch<T> {
30
	/**
31
	 * The cached model package
32
	 * <!-- begin-user-doc -->
33
	 * <!-- end-user-doc -->
34
	 * @generated
35
	 */
36
	protected static DynamicDelegationPackage modelPackage;
37
38
	/**
39
	 * Creates an instance of the switch.
40
	 * <!-- begin-user-doc -->
41
	 * <!-- end-user-doc -->
42
	 * @generated
43
	 */
44
	public DynamicDelegationSwitch() {
45
		if (modelPackage == null) {
46
			modelPackage = DynamicDelegationPackage.eINSTANCE;
47
		}
48
	}
49
50
	/**
51
	 * Checks whether this is a switch for the given package.
52
	 * <!-- begin-user-doc -->
53
	 * <!-- end-user-doc -->
54
	 * @parameter ePackage the package in question.
55
	 * @return whether this is a switch for the given package.
56
	 * @generated
57
	 */
58
	@Override
59
	protected boolean isSwitchFor(EPackage ePackage) {
60
		return ePackage == modelPackage;
61
	}
62
63
	/**
64
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
65
	 * <!-- begin-user-doc -->
66
	 * <!-- end-user-doc -->
67
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
68
	 * @generated
69
	 */
70
	@Override
71
	protected T doSwitch(int classifierID, EObject theEObject) {
72
		switch (classifierID) {
73
			case DynamicDelegationPackage.CLASS0: {
74
				Class0 class0 = (Class0)theEObject;
75
				T result = caseClass0(class0);
76
				if (result == null) result = defaultCase(theEObject);
77
				return result;
78
			}
79
			case DynamicDelegationPackage.CLASS1: {
80
				Class1 class1 = (Class1)theEObject;
81
				T result = caseClass1(class1);
82
				if (result == null) result = defaultCase(theEObject);
83
				return result;
84
			}
85
			default: return defaultCase(theEObject);
86
		}
87
	}
88
89
	/**
90
	 * Returns the result of interpreting the object as an instance of '<em>Class0</em>'.
91
	 * <!-- begin-user-doc -->
92
	 * This implementation returns null;
93
	 * returning a non-null result will terminate the switch.
94
	 * <!-- end-user-doc -->
95
	 * @param object the target of the switch.
96
	 * @return the result of interpreting the object as an instance of '<em>Class0</em>'.
97
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
98
	 * @generated
99
	 */
100
	public T caseClass0(Class0 object) {
101
		return null;
102
	}
103
104
	/**
105
	 * Returns the result of interpreting the object as an instance of '<em>Class1</em>'.
106
	 * <!-- begin-user-doc -->
107
	 * This implementation returns null;
108
	 * returning a non-null result will terminate the switch.
109
	 * <!-- end-user-doc -->
110
	 * @param object the target of the switch.
111
	 * @return the result of interpreting the object as an instance of '<em>Class1</em>'.
112
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
113
	 * @generated
114
	 */
115
	public T caseClass1(Class1 object) {
116
		return null;
117
	}
118
119
	/**
120
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
121
	 * <!-- begin-user-doc -->
122
	 * This implementation returns null;
123
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
124
	 * <!-- end-user-doc -->
125
	 * @param object the target of the switch.
126
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
127
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
128
	 * @generated
129
	 */
130
	@Override
131
	public T defaultCase(EObject object) {
132
		return null;
133
	}
134
135
} //DynamicDelegationSwitch
(-)tests/org.eclipse.emf.test.core/src/org/eclipse/emf/test/core/dynamicDelegation/bug387689.java (+129 lines)
Added Link Here
1
package org.eclipse.emf.test.core.dynamicDelegation;
2
3
import junit.framework.TestCase;
4
5
import org.eclipse.emf.common.notify.Notification;
6
import org.eclipse.emf.common.notify.impl.AdapterImpl;
7
import org.eclipse.emf.test.models.dynamicDelegation.Class0;
8
9
public class bug387689 extends TestCase {
10
	public void testReflectionNone() {
11
		org.eclipse.emf.test.models.dynamicDelegation.impl.none.DynamicDelegationFactoryImpl dynamicDelegationFactoryImpl = new org.eclipse.emf.test.models.dynamicDelegation.impl.none.DynamicDelegationFactoryImpl();
12
		doTestBoolean(dynamicDelegationFactoryImpl.createClass0());
13
		doTestByte(dynamicDelegationFactoryImpl.createClass0());
14
		doTestChar(dynamicDelegationFactoryImpl.createClass0());
15
		doTestDouble(dynamicDelegationFactoryImpl.createClass0());
16
		doTestFloat(dynamicDelegationFactoryImpl.createClass0());
17
		doTestInt(dynamicDelegationFactoryImpl.createClass0());
18
		doTestLong(dynamicDelegationFactoryImpl.createClass0());
19
		doTestShort(dynamicDelegationFactoryImpl.createClass0());
20
	}
21
22
	public void testReflectionDynamic() {
23
		org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl dynamicDelegationFactoryImpl = new org.eclipse.emf.test.models.dynamicDelegation.impl.DynamicDelegationFactoryImpl();
24
		doTestBoolean(dynamicDelegationFactoryImpl.createClass0());
25
		doTestByte(dynamicDelegationFactoryImpl.createClass0());
26
		doTestChar(dynamicDelegationFactoryImpl.createClass0());
27
		doTestDouble(dynamicDelegationFactoryImpl.createClass0());
28
		doTestFloat(dynamicDelegationFactoryImpl.createClass0());
29
		doTestInt(dynamicDelegationFactoryImpl.createClass0());
30
		doTestLong(dynamicDelegationFactoryImpl.createClass0());
31
		doTestShort(dynamicDelegationFactoryImpl.createClass0());
32
	}
33
34
	private void doTestBoolean(Class0 class0) {
35
		AdapterImpl adapterImpl = new AdapterImpl() {
36
			public void notifyChanged(Notification msg) {
37
				assertTrue(msg.getNewBooleanValue() != msg.getOldBooleanValue());
38
			};
39
		};
40
		
41
		class0.eAdapters().add(adapterImpl);
42
		class0.setTestBoolean(Boolean.TRUE);
43
		class0.setTestBoolean(Boolean.FALSE);
44
	}
45
46
	private void doTestByte(Class0 class0) {
47
		AdapterImpl adapterImpl = new AdapterImpl() {
48
			public void notifyChanged(Notification msg) {
49
				assertTrue(msg.getNewByteValue() != msg.getOldByteValue());
50
			};
51
		};
52
		
53
		class0.eAdapters().add(adapterImpl);
54
		class0.setTestByte((byte) 2);
55
		class0.setTestByte((byte) 1);
56
	}
57
58
	private void doTestChar(Class0 class0) {
59
		AdapterImpl adapterImpl = new AdapterImpl() {
60
			public void notifyChanged(Notification msg) {
61
				assertTrue(msg.getNewCharValue() != msg.getOldCharValue());
62
			};
63
		};
64
		
65
		class0.eAdapters().add(adapterImpl);
66
		class0.setTestChar('b');
67
		class0.setTestChar('a');
68
	}
69
70
	private void doTestDouble(Class0 class0) {
71
		AdapterImpl adapterImpl = new AdapterImpl() {
72
			public void notifyChanged(Notification msg) {
73
				assertTrue(msg.getNewDoubleValue() != msg.getOldDoubleValue());
74
			};
75
		};
76
		
77
		class0.eAdapters().add(adapterImpl);
78
		class0.setTestDouble(2);
79
		class0.setTestDouble(1);
80
	}
81
82
	private void doTestFloat(Class0 class0) {
83
		AdapterImpl adapterImpl = new AdapterImpl() {
84
			public void notifyChanged(Notification msg) {
85
				assertTrue(msg.getNewFloatValue() != msg.getOldFloatValue());
86
			};
87
		};
88
		
89
		class0.eAdapters().add(adapterImpl);
90
		class0.setTestFloat(2);
91
		class0.setTestFloat(1);
92
	}
93
94
	private void doTestInt(Class0 class0) {
95
		AdapterImpl adapterImpl = new AdapterImpl() {
96
			public void notifyChanged(Notification msg) {
97
				assertTrue(msg.getNewIntValue() != msg.getOldIntValue());
98
			};
99
		};
100
		
101
		class0.eAdapters().add(adapterImpl);
102
		class0.setTestInt(2);
103
		class0.setTestInt(1);
104
	}
105
106
	private void doTestLong(Class0 class0) {
107
		AdapterImpl adapterImpl = new AdapterImpl() {
108
			public void notifyChanged(Notification msg) {
109
				assertTrue(msg.getNewLongValue() != msg.getOldLongValue());
110
			};
111
		};
112
		
113
		class0.eAdapters().add(adapterImpl);
114
		class0.setTestLong(2);
115
		class0.setTestLong(1);
116
	}
117
118
	private void doTestShort(Class0 class0) {
119
		AdapterImpl adapterImpl = new AdapterImpl() {
120
			public void notifyChanged(Notification msg) {
121
				assertTrue(msg.getNewShortValue() != msg.getOldShortValue());
122
			};
123
		};
124
		
125
		class0.eAdapters().add(adapterImpl);
126
		class0.setTestShort((short) 2);
127
		class0.setTestShort((short) 1);
128
	}
129
}

Return to bug 387689