-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1334] Net emf objects transfer should rely on domain resource factory
Signed-off-by: eparovyshnaya <[email protected]>
- Loading branch information
1 parent
847a034
commit 49a06a3
Showing
38 changed files
with
230 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ output.. = bin/ | |
bin.includes = META-INF/,\ | ||
OSGI-INF/,\ | ||
model/,\ | ||
about.html | ||
about.html,\ | ||
. | ||
src.includes = model/ |
9 changes: 9 additions & 0 deletions
9
...clipse.passage.lic.emf/src/org/eclipse/passage/lic/emf/resource/BlindResourceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.eclipse.passage.lic.emf.resource; | ||
|
||
import org.eclipse.emf.ecore.resource.Resource; | ||
|
||
public interface BlindResourceFactory { | ||
|
||
Resource createResource(); | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...s/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package org.eclipse.passage.lic.internal.emf; | ||
|
||
import java.util.Objects; | ||
import java.util.function.Supplier; | ||
|
||
import org.eclipse.emf.ecore.EClass; | ||
import org.eclipse.emf.ecore.EObject; | ||
import org.eclipse.emf.ecore.resource.Resource; | ||
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; | ||
import org.eclipse.passage.lic.emf.resource.BlindResourceFactory; | ||
|
||
public final class BlindResource implements Supplier<Resource> { | ||
|
||
private final EClass type; | ||
|
||
public BlindResource(EClass type) { | ||
this.type = Objects.requireNonNull(type); | ||
} | ||
|
||
public BlindResource(EObject source) { | ||
this(Objects.requireNonNull(source).eClass()); | ||
} | ||
|
||
@Override | ||
public Resource get() { | ||
String domain = type.getEPackage().getName(); | ||
Object factory = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().get(domain); | ||
if (factory instanceof BlindResourceFactory) { | ||
return ((BlindResourceFactory) factory).createResource(); | ||
|
||
Check warning on line 30 in bundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java Codecov / codecov/patchbundles/org.eclipse.passage.lic.emf/src/org/eclipse/passage/lic/internal/emf/BlindResource.java#L29-L30
|
||
} | ||
return new XMIResourceImpl(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.