|
Re: Generating a UML-Component: How to add a requiered/provided Interface to a Port ? [message #1007484 is a reply to message #1007454] |
Wed, 06 February 2013 06:54 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
HI
From UML 2.5
/required : Interface [0..*]{} (opposite A_required_port::port) The
Interfaces specifying the set of Operations and Receptions that the
EncapsulatedCassifier expects its environment to handle via this port.
This association is derived according to the value of isConjugated. If
isConjugated is false, required is derived as the union of the sets of
Interfaces used by the type of the Port and its supertypes. If
isConjugated is true, it is derived as the union of the sets of
Interfaces realized by the type of the Port and its supertypes, or
directly from the type of the Port if the Port is typed by an Interface.
"/" means derived and so read-only. You need to modify what it is
derived from.
Regards
Ed Willink
On 06/02/2013 01:11, Rudolf Weber wrote:
> in http://www.eclipse.org/forums/index.php/m/471902/ is described how
> to generate a Component with a Port and required/provided interface.
> But a Port may have the provided/required Interface too:
>
> String componame = "mycompo";
> String portname = "myPort";
> String ifname = "myinterface";
> org.eclipse.uml2.uml.Package pkg = ...;
> org.eclipse.uml2.uml.Component mycompo =
> (Component)pkg.createOwnedType(componame,
> UMLPackage.eINSTANCE.getComponent());
>
> org.eclipse.uml2.uml.Port port = mycompo.createOwnedPort(portname, null);
> org.eclipse.uml2.uml.Interface myif = pkg.createOwnedInterface(ifname);
>
> How can I add a Required or an Required Interface to the port ?
> I found a port.getRequired(ifname) in , but I miss a
> port.setRequired(ifname,myif).
>
> (EList<Interface> el = port.getRequireds();
> el.add(interfo);
> compiles, but it throws a "UnimplementedExcpetion", because it is a
> readonly list :lol: )
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03478 seconds