Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-08-31 17:10:28 +0000
committerEike Stepper2012-08-31 17:10:28 +0000
commit8b48ab2f138f0d36b5e3959c396a458877081a6a (patch)
tree831f4f36ee0315881c9c097c0fdb8d665811308c
parent72284afe64ac2bd333ab08708d999c9487ac46a9 (diff)
downloadcdo-8b48ab2f138f0d36b5e3959c396a458877081a6a.tar.gz
cdo-8b48ab2f138f0d36b5e3959c396a458877081a6a.tar.xz
cdo-8b48ab2f138f0d36b5e3959c396a458877081a6a.zip
[362982] Add CDOTextResource and CDOBinaryResource
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362982
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java66
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/etypes/util/EtypesSwitch.java18
4 files changed, 74 insertions, 32 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java
index 9592393bf8..5dc0de11a0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/CDOResourceFolder.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>CDO Resource Folder</b></em>'.
- *
+ *
* @apiviz.landmark
* @apiviz.composedOf {@link CDOResourceNode} - - nodes
* @noextend This interface is not intended to be extended by clients.
@@ -53,7 +53,7 @@ public interface CDOResourceFolder extends CDOResourceNode
/**
* <!-- begin-user-doc -->
- *
+ *
* @since 4.0 <!-- end-user-doc -->
* @model
* @generated
@@ -62,7 +62,7 @@ public interface CDOResourceFolder extends CDOResourceNode
/**
* <!-- begin-user-doc -->
- *
+ *
* @since 4.0 <!-- end-user-doc -->
* @model
* @generated
@@ -71,6 +71,7 @@ public interface CDOResourceFolder extends CDOResourceNode
/**
* <!-- begin-user-doc -->
+ * @since 4.2
* <!-- end-user-doc -->
* @model
* @generated
@@ -79,6 +80,7 @@ public interface CDOResourceFolder extends CDOResourceNode
/**
* <!-- begin-user-doc -->
+ * @since 4.2
* <!-- end-user-doc -->
* @model
* @generated
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java
index e759375f2c..48fa51d9a4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceAdapterFactory.java
@@ -107,7 +107,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
}
@Override
- public Adapter caseCDOFileResource(CDOFileResource object)
+ public Adapter caseCDOFileResource(CDOFileResource<?> object)
{
return createCDOFileResourceAdapter();
}
@@ -148,7 +148,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceNode <em>CDO Resource Node</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 2.0<!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOResourceNode
@@ -163,7 +163,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceFolder <em>CDO Resource Folder</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 2.0<!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOResourceFolder
@@ -191,7 +191,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOResourceLeaf <em>CDO Resource Leaf</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOResourceLeaf
@@ -206,7 +206,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOFileResource <em>CDO File Resource</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOFileResource
@@ -221,7 +221,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOBinaryResource <em>CDO Binary Resource</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOBinaryResource
@@ -236,7 +236,7 @@ public class EresourceAdapterFactory extends AdapterFactoryImpl
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.eresource.CDOTextResource <em>CDO Text Resource</em>}'.
* <!-- begin-user-doc --> This default implementation returns null so that we can
* easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @return the new adapter.
* @see org.eclipse.emf.cdo.eresource.CDOTextResource
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java
index 7ce8978b56..047ba22567 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/eresource/util/EresourceSwitch.java
@@ -69,7 +69,7 @@ public class EresourceSwitch<T>
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
+ * @generated NOT
*/
protected T doSwitch(EClass theEClass, EObject theEObject)
{
@@ -77,11 +77,9 @@ public class EresourceSwitch<T>
{
return doSwitch(theEClass.getClassifierID(), theEObject);
}
- else
- {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
- }
+
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
}
/**
@@ -99,7 +97,9 @@ public class EresourceSwitch<T>
CDOResourceNode cdoResourceNode = (CDOResourceNode)theEObject;
T result = caseCDOResourceNode(cdoResourceNode);
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_RESOURCE_FOLDER:
@@ -107,9 +107,13 @@ public class EresourceSwitch<T>
CDOResourceFolder cdoResourceFolder = (CDOResourceFolder)theEObject;
T result = caseCDOResourceFolder(cdoResourceFolder);
if (result == null)
+ {
result = caseCDOResourceNode(cdoResourceFolder);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_RESOURCE:
@@ -117,11 +121,17 @@ public class EresourceSwitch<T>
CDOResource cdoResource = (CDOResource)theEObject;
T result = caseCDOResource(cdoResource);
if (result == null)
+ {
result = caseCDOResourceLeaf(cdoResource);
+ }
if (result == null)
+ {
result = caseCDOResourceNode(cdoResource);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_RESOURCE_LEAF:
@@ -129,21 +139,31 @@ public class EresourceSwitch<T>
CDOResourceLeaf cdoResourceLeaf = (CDOResourceLeaf)theEObject;
T result = caseCDOResourceLeaf(cdoResourceLeaf);
if (result == null)
+ {
result = caseCDOResourceNode(cdoResourceLeaf);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_FILE_RESOURCE:
{
- CDOFileResource cdoFileResource = (CDOFileResource)theEObject;
+ CDOFileResource<?> cdoFileResource = (CDOFileResource<?>)theEObject;
T result = caseCDOFileResource(cdoFileResource);
if (result == null)
+ {
result = caseCDOResourceLeaf(cdoFileResource);
+ }
if (result == null)
+ {
result = caseCDOResourceNode(cdoFileResource);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_BINARY_RESOURCE:
@@ -151,13 +171,21 @@ public class EresourceSwitch<T>
CDOBinaryResource cdoBinaryResource = (CDOBinaryResource)theEObject;
T result = caseCDOBinaryResource(cdoBinaryResource);
if (result == null)
+ {
result = caseCDOFileResource(cdoBinaryResource);
+ }
if (result == null)
+ {
result = caseCDOResourceLeaf(cdoBinaryResource);
+ }
if (result == null)
+ {
result = caseCDOResourceNode(cdoBinaryResource);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EresourcePackage.CDO_TEXT_RESOURCE:
@@ -165,13 +193,21 @@ public class EresourceSwitch<T>
CDOTextResource cdoTextResource = (CDOTextResource)theEObject;
T result = caseCDOTextResource(cdoTextResource);
if (result == null)
+ {
result = caseCDOFileResource(cdoTextResource);
+ }
if (result == null)
+ {
result = caseCDOResourceLeaf(cdoTextResource);
+ }
if (result == null)
+ {
result = caseCDOResourceNode(cdoTextResource);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
default:
@@ -183,7 +219,7 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO Resource Node</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 2.0<!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO Resource Node</em>'.
@@ -199,7 +235,7 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO Resource Folder</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 2.0 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO Resource Folder</em>'.
@@ -229,7 +265,7 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO Resource Leaf</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO Resource Leaf</em>'.
@@ -245,14 +281,14 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO File Resource</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO File Resource</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
+ * @generated NOT
*/
- public T caseCDOFileResource(CDOFileResource object)
+ public T caseCDOFileResource(CDOFileResource<?> object)
{
return null;
}
@@ -261,7 +297,7 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO Binary Resource</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO Binary Resource</em>'.
@@ -277,7 +313,7 @@ public class EresourceSwitch<T>
* Returns the result of interpreting the object as an instance of '<em>CDO Text Resource</em>'.
* <!-- begin-user-doc
* --> This implementation returns null; returning a non-null result will terminate the switch.
- *
+ *
* @since 4.1 <!-- end-user-doc -->
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>CDO Text Resource</em>'.
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/etypes/util/EtypesSwitch.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/etypes/util/EtypesSwitch.java
index 613524d9a1..2ebb0423fe 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/etypes/util/EtypesSwitch.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/etypes/util/EtypesSwitch.java
@@ -24,7 +24,7 @@ import java.util.List;
* {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for each class of the model,
* starting with the actual class of the object and proceeding up the inheritance hierarchy until a non-null result is
* returned, which is the result of the switch.
- *
+ *
* @since 4.0 <!-- end-user-doc -->
* @see org.eclipse.emf.cdo.etypes.EtypesPackage
* @generated
@@ -66,7 +66,7 @@ public class EtypesSwitch<T>
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
+ * @generated NOT
*/
protected T doSwitch(EClass theEClass, EObject theEObject)
{
@@ -74,11 +74,9 @@ public class EtypesSwitch<T>
{
return doSwitch(theEClass.getClassifierID(), theEObject);
}
- else
- {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
- }
+
+ List<EClass> eSuperTypes = theEClass.getESuperTypes();
+ return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
}
/**
@@ -96,7 +94,9 @@ public class EtypesSwitch<T>
ModelElement modelElement = (ModelElement)theEObject;
T result = caseModelElement(modelElement);
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
case EtypesPackage.ANNOTATION:
@@ -104,9 +104,13 @@ public class EtypesSwitch<T>
Annotation annotation = (Annotation)theEObject;
T result = caseAnnotation(annotation);
if (result == null)
+ {
result = caseModelElement(annotation);
+ }
if (result == null)
+ {
result = defaultCase(theEObject);
+ }
return result;
}
default:

Back to the top