The intention is that oclType() should be rather like getClass() in Java
but with a stronger type return.
On 29/04/2014 13:01, Felix Dorner wrote:
> I was asked for examples that use reflection in OCL. Not being sure if
> possible at all, and with a lack of ideas, I hope for help from the list.
> class MyClass
> property x : Integer[0..*]
> Want to express this (semantic nonsense) example in OCL:
> If MyClass.x.isUnique = true, then all elements in x should be < 0.
> Is this possible? The key question is if/how can I access the
> 'isUnique' property on an instance of MyClass.
> I would also be grateful for any example that is a little more
> meaningful. I ordered the book by Warner/Klepekke, and hope to find
> something there, but I'm pessimistic.