| Type casting of query.evaluate() and ocl.evaluate() [message #1229066] |
Wed, 08 January 2014 11:34  |
Eclipse User |
|
|
|
Hi,
I'm trying to use OCL Standalone to parse OCL query in UML State Machine Model by following examples in eclipse OCL help. According to the help we have to type case the query evaluation result to be a set
@SuppressWarnings("unchecked")
Set<BookCategory> categories = (Set<BookCategory>) queryEval.evaluate(next);
I follow same idea
@SuppressWarnings("unchecked")
Set<Element> resultSet = (Set<Element>) oclQueryEval.evaluate(umlModel);
but I got the following error
java.lang.ClassCastException: org.eclipse.ocl.examples.domain.values.impl.SetValueImpl$Accumulator cannot be cast to java.util.Set
I ran resultType() method
System.out.println(oclQueryEval.resultType());
and I got Set(uml::Element)
how to type cast of the evaluate method of OCL or Query class with this result type?
any a advice please
thanks
[Updated on: Wed, 08 January 2014 11:37] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05098 seconds