[Solved] Problem to retrieve Papyrus Java profile's stereotypes [message #1770246] |
Wed, 09 August 2017 10:42 |
|
Hi !
Papyrus introduces the stereotype <<External>>. My UML model built from Reverse Java had such a stereotype, applied but getAppliedStereotypes() can't see it in my eclipse plugin. It returns something like null.
Nevertheless, I have written this snippet in my plugin :
String papyrusJavaProfileResourcePath = PapyrusJavaPackage.class.getProtectionDomain().getCodeSource().getLocation().getPath();
try
{
papyrusJavaProfileResourcePath = URLDecoder.decode(papyrusJavaProfileResourcePath, "UTF-8");
}
catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
URI papyrusJavaProfileResourcePluginURI = URI.createURI("jar:file:" + papyrusJavaProfileResourcePath + "!/");
URI papyrusJavaProfileURI = papyrusJavaProfileResourcePluginURI.appendSegment("profiles").appendSegment("PapyrusJava.profile.uml");
resourceSet.getURIConverter().getURIMap().put(URI.createURI("pathmap://PapyrusJava_PROFILES/PapyrusJava.profile.uml"), papyrusJavaProfileURI);
thanks a lot for your help. (Several days I investiigate)
[Updated on: Thu, 10 August 2017 16:18] Report message to a moderator
|
|
|
Re: Problem to retrieve Papyrus Java profile's stereotypes [message #1770393 is a reply to message #1770246] |
Thu, 10 August 2017 16:17 |
|
Adding the following lines, inspired by UMLResourcesUtil.initLocalRegistries() :
resourceSet.getPackageRegistry().put(PapyrusJavaPackage.eNS_URI , PapyrusJavaPackage.eINSTANCE);
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(PapyrusJavaPackage.eNS_URI,
URI.createURI("pathmap://PapyrusJava_PROFILES/PapyrusJava.profile.uml#_j9REUByGEduN1bTiWJ0lyw"));
It works well.
Nevertheless, I don't know about #_j9REUByGEduN1bTiWJ0lyw.
[Updated on: Thu, 10 August 2017 16:19] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02675 seconds