eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[pivot] Support stereotype reflection. #1416

Open eclipse-ocl-bot opened 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 452972 | | Status | NEW | | Importance | P3 normal | | Reported | Nov 24, 2014 04:06 EDT | | Modified | Nov 24, 2014 06:44 EDT | | Reporter | Ed Willink |

Description

From the Papyrus newsgroup "Generic type for applied stereotypes" thread:

The need is to be able to deal with any stereotype definition on a generic way. For instance, assume you want to generate a document for virtually any UML model listing, for each model element, what are the stereotypes applied and what are the values assigned to their "tag values", if any.

The closest I can get is:

let tags = self.getAppliedStereotypes()->closure(superClass).ownedAttribute in\ tags->collect(tag | self.getValue(tag.owner.oclAsType(Stereotype), tag.name))

(which fails in the debugger - Bug 452970).


Seem to need at least an oclGet() that can be used with a UML::Property.

Maybe we need oclSlots()?

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Nov 24, 2014 05:50

Support for shadow objects may make an

OclElement::oclSlots() : Map(Property, OclAny)

helpful. The problem could then be solved by:

let slots = self.oclExtensions().oclSlots() in\ slots.keys->iterate(key; acc : String = ''\ | acc + ' ' + key.name + ' = ' + slots.get(key).toString())

.

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Nov 24, 2014 06:44

Bug 452683 has been marked as a duplicate of this bug.