Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-02-13 08:17:16 +0000
committerEike Stepper2013-02-13 19:58:23 +0000
commitae4976ae6e18c5871d1838b927d95d905da84296 (patch)
tree8c36f9b3999ad57feb0da59ba18de979e86a562c /plugins/org.eclipse.emf.cdo.ecore.retrofit
parentef70e75984ccdd2c0eb2cec0da13ac7e1319d4ea (diff)
downloadcdo-ae4976ae6e18c5871d1838b927d95d905da84296.tar.gz
cdo-ae4976ae6e18c5871d1838b927d95d905da84296.tar.xz
cdo-ae4976ae6e18c5871d1838b927d95d905da84296.zip
[400388] Integrate the new MinimalEStoreEObjectImpl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=400388
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ecore.retrofit')
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath7
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.project39
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs90
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs32
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html28
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini15
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings6
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties31
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties26
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt8
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties11
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java334
14 files changed, 637 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project
new file mode 100644
index 0000000000..7ad32da298
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.cdo.ecore.retrofit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.emf.cdo.releng.version.VersionBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>release.path</key>
+ <value>/org.eclipse.emf.cdo.releng.release/release.xml</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ <nature>org.eclipse.emf.cdo.releng.version.VersionNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..77dea87f7a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,90 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..d4dc66acb2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=2
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=2
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..6ce6f64b35
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.cdo.ecore.retrofit;singleton:=true
+Bundle-Version: 4.2.0.qualifier
+Fragment-Host: org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Bundle-Localization: fragment
+Export-Package: org.eclipse.emf.ecore.impl
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html
new file mode 100644
index 0000000000..d35d5aed64
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini
new file mode 100644
index 0000000000..32006ae5d6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini
@@ -0,0 +1,15 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
+
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings
new file mode 100644
index 0000000000..bddaab4310
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@ \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties
new file mode 100644
index 0000000000..0967db9611
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties
@@ -0,0 +1,31 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+featureName = CDO Model Repository Client (Retrofit for EMF before 2.9)
+featureText = CDO Model Repository Client (Retrofit for EMF before 2.9)\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\
+\n\
+Visit http://www.eclipse.org/cdo
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties
new file mode 100644
index 0000000000..4c86a7c3db
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties
@@ -0,0 +1,26 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ copyright.txt,\
+ fragment.properties,\
+ modeling32.png
+src.includes = about.html,\
+ copyright.txt
+
+generateSourceReferences = true
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt b/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt
new file mode 100644
index 0000000000..cea141de92
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt
@@ -0,0 +1,8 @@
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+All rights reserved. This program and the accompanying materials
+are made available under the terms of the Eclipse Public License v1.0
+which accompanies this distribution, and is available at
+http://www.eclipse.org/legal/epl-v10.html
+
+Contributors:
+ Martin Fluegge - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties
new file mode 100644
index 0000000000..cfe209dd1e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties
@@ -0,0 +1,11 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Martin Fluegge - initial API and implementation
+
+pluginName = CDO Model Repository Client (Retrofit for EMF before 2.9)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png b/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png
new file mode 100644
index 0000000000..6b08de2ada
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java b/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java
new file mode 100644
index 0000000000..8795228d7d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java
@@ -0,0 +1,334 @@
+/**
+ * Copyright (c) 2002-2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ */
+package org.eclipse.emf.ecore.impl;
+
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreEMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+
+/**
+ * A minimal abstract implementation of '<em><b>EObject</b></em>' that delegates to a {@link org.eclipse.emf.ecore.InternalEObject.EStore store}.
+ * It's extends {@link MinimalEObjectImpl} and does <b>not</b> introduce any additional fields.
+ * Clients extending this class must specialize {@link #eStore()}.
+ * @since 2.9
+ */
+@SuppressWarnings("javadoc")
+public abstract class MinimalEStoreEObjectImpl extends MinimalEObjectImpl
+{
+ private static final EObservableAdapterList.Listener ADAPTERS_LISTENER = new EObservableAdapterList.Listener()
+ {
+ public void added(Notifier notifier, Adapter adapter)
+ {
+ MinimalEStoreEObjectImpl object = (MinimalEStoreEObjectImpl)notifier;
+ object.eAdapterAdded(adapter);
+ }
+
+ public void removed(Notifier notifier, Adapter adapter)
+ {
+ MinimalEStoreEObjectImpl object = (MinimalEStoreEObjectImpl)notifier;
+ object.eAdapterRemoved(adapter);
+ }
+ };
+
+ /**
+ * Creates a store-based EObject.
+ */
+ public MinimalEStoreEObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * Creates a store-based EObject.
+ */
+ public MinimalEStoreEObjectImpl(EClass eClass)
+ {
+ super();
+ eSetClass(eClass);
+ }
+
+ @Override
+ public abstract InternalEObject.EStore eStore();
+
+ protected boolean eIsCaching()
+ {
+ return true;
+ }
+
+ Object[] eDynamicSettings()
+ {
+ Object[] settings = eBasicSettings();
+ if (settings == null)
+ {
+ eSettings();
+ settings = eBasicSettings();
+ }
+ return settings;
+ }
+
+ @Override
+ public Object dynamicGet(int dynamicFeatureID)
+ {
+ Object[] eSettings = eDynamicSettings();
+ Object result = eSettings[dynamicFeatureID];
+ if (result == null)
+ {
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (!eStructuralFeature.isTransient())
+ {
+ if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ eSettings[dynamicFeatureID] = result = createFeatureMap(eStructuralFeature);
+ }
+ else if (eStructuralFeature.isMany())
+ {
+ eSettings[dynamicFeatureID] = result = createList(eStructuralFeature);
+ }
+ else
+ {
+ result = eStore().get(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = result;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public void dynamicSet(int dynamicFeatureID, Object value)
+ {
+ Object[] eSettings = eDynamicSettings();
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (eStructuralFeature.isTransient())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ else
+ {
+ eStore().set(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX, value);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ }
+ }
+
+ @Override
+ public void dynamicUnset(int dynamicFeatureID)
+ {
+ Object[] eSettings = eDynamicSettings();
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (eStructuralFeature.isTransient())
+ {
+ eSettings[dynamicFeatureID] = null;
+ }
+ else
+ {
+ eStore().unset(this, eStructuralFeature);
+ eSettings[dynamicFeatureID] = null;
+ }
+ }
+
+ @Override
+ protected boolean eDynamicIsSet(int dynamicFeatureID, EStructuralFeature eFeature)
+ {
+ return
+ dynamicFeatureID < 0 ?
+ eOpenIsSet(eFeature) :
+ eFeature.isTransient() ?
+ eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), dynamicFeatureID) :
+ eStore().isSet(this, eFeature);
+ }
+
+ @SuppressWarnings("nls")
+ protected EList<?> createList(final EStructuralFeature eStructuralFeature)
+ {
+ final EClassifier eType = eStructuralFeature.getEType();
+ if (eType.getInstanceClassName() == "java.util.Map$Entry")
+ {
+ class EStoreEcoreEMap extends EcoreEMap<Object, Object>
+ {
+ private static final long serialVersionUID = 1L;
+
+ public EStoreEcoreEMap()
+ {
+ super
+ ((EClass)eType,
+ BasicEMap.Entry.class,
+ null);
+ delegateEList =
+ new EStoreEObjectImpl.BasicEStoreEList<BasicEMap.Entry<Object, Object>>(MinimalEStoreEObjectImpl.this, eStructuralFeature)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void didAdd(int index, BasicEMap.Entry<Object, Object> newObject)
+ {
+ EStoreEcoreEMap.this.doPut(newObject);
+ }
+
+ @Override
+ protected void didSet(int index, BasicEMap.Entry<Object, Object> newObject, BasicEMap.Entry<Object, Object> oldObject)
+ {
+ didRemove(index, oldObject);
+ didAdd(index, newObject);
+ }
+
+ @Override
+ protected void didRemove(int index, BasicEMap.Entry<Object, Object> oldObject)
+ {
+ EStoreEcoreEMap.this.doRemove(oldObject);
+ }
+
+ @Override
+ protected void didClear(int size, Object [] oldObjects)
+ {
+ EStoreEcoreEMap.this.doClear();
+ }
+
+ @Override
+ protected void didMove(int index, BasicEMap.Entry<Object, Object> movedObject, int oldIndex)
+ {
+ EStoreEcoreEMap.this.doMove(movedObject);
+ }
+ };
+ size = delegateEList.size();
+ }
+ }
+ return new EStoreEcoreEMap();
+ }
+ return new EStoreEObjectImpl.BasicEStoreEList<Object>(this, eStructuralFeature);
+ }
+
+ protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
+ {
+ return new EStoreEObjectImpl.EStoreFeatureMap(this, eStructuralFeature, eStore());
+ }
+
+ /**
+ * Returns the container as cached by {@link MinimalEObjectImpl#eInternalContainer()}.
+ */
+ protected InternalEObject eBasicInternalContainer()
+ {
+ return super.eInternalContainer();
+ }
+
+ /**
+ * Returns the container as {@link InternalEObject.EStore#getContainer(InternalEObject) provided} by the store.
+ */
+ @Override
+ public InternalEObject eInternalContainer()
+ {
+ return eStore().getContainer(this);
+ }
+
+ /**
+ * Returns the container feature ID as cached by {@link MinimalEObjectImpl#eContainerFeatureID()}.
+ */
+ protected int eBasicContainerFeatureID()
+ {
+ return super.eContainerFeatureID();
+ }
+
+ /**
+ * Returns the container feature ID as computed from the container feature {@link InternalEObject.EStore#getContainingFeature(InternalEObject) provided} by the store.
+ */
+ @Override
+ public int eContainerFeatureID()
+ {
+ EObject eContainer = eInternalContainer();
+ if (eContainer != null)
+ {
+ EStructuralFeature eContainingFeature = eStore().getContainingFeature(this);
+ if (eContainingFeature instanceof EReference)
+ {
+ EReference eContainingReference = (EReference)eContainingFeature;
+ EReference eOpposite = eContainingReference.getEOpposite();
+ if (eOpposite != null)
+ {
+ return eClass().getFeatureID(eOpposite);
+ }
+ }
+
+ return EOPPOSITE_FEATURE_BASE - eContainer.eClass().getFeatureID(eContainingFeature);
+ }
+
+ return 0;
+ }
+
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ @Override
+ public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature)
+ {
+ return eClass().getFeatureID(eStructuralFeature);
+ }
+
+ @Override
+ protected void eBasicSetAdapterArray(Adapter[] adapters)
+ {
+ Adapter[] oldAdapters = eBasicAdapterArray();
+ if (adapters == null || adapters.length == 0)
+ {
+ adapters = null;// Optimize possibly empty array
+ if (oldAdapters != null) // Can't be empty array because of the optimization above
+ {
+ ((EObservableAdapterList)eAdapters()).removeListener(ADAPTERS_LISTENER);
+ }
+ }
+ else
+ {
+ if (oldAdapters == null) // Can't be empty array because of the optimization above
+ {
+ ((EObservableAdapterList)eAdapters()).addListener(ADAPTERS_LISTENER);
+ }
+ }
+ super.eBasicSetAdapterArray(adapters);
+ }
+
+ protected EObservableAdapterList.Listener[] eBasicAdapterListeners()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected void eBasicSetAdapterListeners(EObservableAdapterList.Listener[] eAdapterListeners)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ protected void eAdapterAdded(Adapter adapter)
+ {
+ }
+
+ protected void eAdapterRemoved(Adapter adapter)
+ {
+ }
+} \ No newline at end of file

Back to the top