Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-01-27 13:02:02 +0000
committerEike Stepper2018-01-27 13:02:02 +0000
commit32af52d838d15b1946e6215ac04c6d7c34e84a40 (patch)
tree1f6b898979e14cc439c7fac231a61743573b4f36 /plugins/org.eclipse.emf.cdo.transfer/src
parent9b578e3f825393a1266d76caa058842a24e6c236 (diff)
downloadcdo-32af52d838d15b1946e6215ac04c6d7c34e84a40.tar.gz
cdo-32af52d838d15b1946e6215ac04c6d7c34e84a40.tar.xz
cdo-32af52d838d15b1946e6215ac04c6d7c34e84a40.zip
[530216] Cannot override CDOTransferElement name because it is final
https://bugs.eclipse.org/bugs/show_bug.cgi?id=530216
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.transfer/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java2
2 files changed, 38 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
index bfa00fe9db..2ddc315ba9 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransfer.java
@@ -78,6 +78,8 @@ public class CDOTransfer implements INotifier
private ModelTransferContext modelTransferContext = createModelTransferContext();
+ private PathProvider pathProvider = PathProvider.DEFAULT;
+
public CDOTransfer(CDOTransferSystem sourceSystem, CDOTransferSystem targetSystem)
{
this.sourceSystem = sourceSystem;
@@ -114,6 +116,22 @@ public class CDOTransfer implements INotifier
return targetSystem;
}
+ /**
+ * @since 4.3
+ */
+ public final PathProvider getPathProvider()
+ {
+ return pathProvider;
+ }
+
+ /**
+ * @since 4.3
+ */
+ public final void setPathProvider(PathProvider pathProvider)
+ {
+ this.pathProvider = pathProvider;
+ }
+
public ModelTransferContext getModelTransferContext()
{
return modelTransferContext;
@@ -416,6 +434,25 @@ public class CDOTransfer implements INotifier
}
/**
+ * Provides the path of a transfer element relative to its parent.
+ *
+ * @author Eike Stepper
+ * @since 4.3
+ */
+ public interface PathProvider
+ {
+ public static final PathProvider DEFAULT = new PathProvider()
+ {
+ public IPath getPath(CDOTransferElement element)
+ {
+ return new Path(element.getName());
+ }
+ };
+
+ public IPath getPath(CDOTransferElement element);
+ }
+
+ /**
* An abstract base implementation of a {@link CDOTransferMapping mapping} {@link ILifecycleEvent event}.
*
* @author Eike Stepper
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
index e077e41b54..1a625d41a7 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
@@ -46,7 +46,7 @@ class CDOTransferMappingImpl implements CDOTransferMapping
this.transfer = transfer;
this.source = source;
this.parent = (CDOTransferMappingImpl)parent;
- relativePath = new Path(source.getName());
+ relativePath = transfer.getPathProvider().getPath(source);
CDOTransferType transferType = transfer.getTransferType(source);
this.transferType = transferType;

Back to the top