Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » getAllAppliedProfile
getAllAppliedProfile [message #624650] Wed, 22 July 2009 06:59
guenin is currently offline gueninFriend
Messages: 42
Registered: July 2009
Member
Hi,

I want to get the profile applied to my model with the function
"getAllAppliedProfiles" I obtain the list here under but when I use the
function "getOwnedStereotypes()" on these profiles I obtain an empty
list.I work with papyrus and my code to load my model is also here under.

getAllAppliedProfiles :

[org.eclipse.uml2.uml.internal.impl.ProfileImpl@2f0d54 (eProxyURI:
pathmap://UML_PROFILES/Standard.profile.uml#_0),
org.eclipse.uml2.uml.internal.impl.ProfileImpl@1961581 (eProxyURI:
resources/MARTE.profile.uml#_EIfnABJeEdy3Td9UhuLFPg),
org.eclipse.uml2.uml.internal.impl.ProfileImpl@113beb5 (eProxyURI:
resources/MARTE.profile.uml#_5ZCOIAPMEdyuUt-4qHuVvQ),
org.eclipse.uml2.uml.internal.impl.ProfileImpl@193f6e2 (eProxyURI:
resources/MARTE.profile.uml#_yNSZIAPMEdyuUt-4qHuVvQ),
org.eclipse.uml2.uml.internal.impl.ProfileImpl@1e13e07 (eProxyURI:
resources/MARTE.profile.uml#_A_vtYBJeEdy3Td9UhuLFPg)]


my code:

public static void main(String[] args) {
URI uri = URI.createURI("essai2/essai2.uml");


try {
ResourceSetImpl resourceSet = new ResourceSetImpl();
// Plug in UML model loader (package and file extension recognition)
resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
UMLResource resource = (UMLResource) resourceSet.getResource(uri, true);
Model mod=(Model)EcoreUtil.getObjectByType(((Resource)
resource).getContents(), UMLPackage.eINSTANCE.getModel());
System.out.println(mod.getAllAppliedProfiles());
System.out.println(mod.getAllAppliedProfiles().get(1).getOwn edStereotypes());
} catch (WrappedException we) {
we.printStackTrace();
System.exit(1);
}


}

Aurélie
Previous Topic:UML2 Timing Diagram
Next Topic:UML2Tools has many bugs and poor, really there is nothing i can work
Goto Forum:
  


Current Time: Sat Dec 20 08:08:14 GMT 2014

Powered by FUDForum. Page generated in 0.11741 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software