Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'eclipselink/org.eclipse.emf.teneo.eclipselink.elistfactory/Based_on_GenClassImpl.getListConstructor_2.2.1.v200609210005.txt')
-rwxr-xr-xeclipselink/org.eclipse.emf.teneo.eclipselink.elistfactory/Based_on_GenClassImpl.getListConstructor_2.2.1.v200609210005.txt139
1 files changed, 139 insertions, 0 deletions
diff --git a/eclipselink/org.eclipse.emf.teneo.eclipselink.elistfactory/Based_on_GenClassImpl.getListConstructor_2.2.1.v200609210005.txt b/eclipselink/org.eclipse.emf.teneo.eclipselink.elistfactory/Based_on_GenClassImpl.getListConstructor_2.2.1.v200609210005.txt
new file mode 100755
index 000000000..3409e151e
--- /dev/null
+++ b/eclipselink/org.eclipse.emf.teneo.eclipselink.elistfactory/Based_on_GenClassImpl.getListConstructor_2.2.1.v200609210005.txt
@@ -0,0 +1,139 @@
+ public String getListConstructor(GenFeature genFeature)
+ {
+ StringBuffer sb = new StringBuffer();
+
+ String unsettable = genFeature.isUnsettable() ? ".Unsettable" : "";
+
+ if (genFeature.isMapType())
+ {
+ GenClass mapGenClass = genFeature.getMapEntryTypeGenClass();
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EcoreEMap"));
+ sb.append(unsettable);
+ sb.append("(");
+ sb.append(mapGenClass.getQualifiedClassifierAccessor());
+ sb.append(", ");
+ sb.append(genFeature.getImportedMapEntryType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(")");
+ }
+ else if (genFeature.isFeatureMapType())
+ {
+ if (genFeature.isWrappedFeatureMapType())
+ {
+ sb.append(genFeature.getImportedEffectiveFeatureMapWrapperClass());
+ sb.append("(new ");
+ }
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.BasicFeatureMap"));
+ sb.append("(this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(")");
+ if (genFeature.isWrappedFeatureMapType())
+ {
+ sb.append(")");
+ }
+ }
+ else if (getGenModel().isSuppressNotification())
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.BasicInternalEList"));
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class)");
+ }
+ else if (genFeature.isEffectiveContains())
+ {
+ if (genFeature.isBidirectional())
+ {
+ GenFeature reverseFeature = genFeature.getReverse();
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList"));
+ sb.append(unsettable);
+ if (genFeature.isResolveProxies())
+ {
+ sb.append(".Resolving");
+ }
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(", ");
+ sb.append(reverseFeature.getGenClass().getQualifiedFeatureID(reverseFeature));
+ sb.append(")");
+ }
+ else
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectContainmentEList"));
+ sb.append(unsettable);
+ if (genFeature.isResolveProxies())
+ {
+ sb.append(".Resolving");
+ }
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(")");
+ }
+ }
+ else if (genFeature.isReferenceType())
+ {
+ if (genFeature.isBidirectional())
+ {
+ GenFeature reverseFeature = genFeature.getReverse();
+ if (genFeature.isResolveProxies())
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList"));
+ }
+ else
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectWithInverseEList"));
+ }
+ sb.append(unsettable);
+ if (reverseFeature.isListType())
+ {
+ sb.append(".ManyInverse");
+ }
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(", ");
+ sb.append(reverseFeature.getGenClass().getQualifiedFeatureID(reverseFeature));
+ sb.append(")");
+ }
+ else
+ {
+ if (genFeature.isResolveProxies())
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectResolvingEList"));
+ }
+ else
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EObjectEList"));
+ }
+ sb.append(unsettable);
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(")");
+ }
+ }
+ else
+ { //datatype
+ if (genFeature.isUnique())
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EDataTypeUniqueEList"));
+ }
+ else
+ {
+ sb.append(getGenModel().getImportedName("org.eclipse.emf.ecore.util.EDataTypeEList"));
+ }
+ sb.append(unsettable);
+ sb.append("(");
+ sb.append(genFeature.getListItemType());
+ sb.append(".class, this, ");
+ sb.append(getQualifiedFeatureID(genFeature));
+ sb.append(")");
+ }
+ return sb.toString();
+ }

Back to the top