|
|
|
Re: JvmOperation and JvmField in dsl [message #714848 is a reply to message #714654] |
Thu, 11 August 2011 15:25 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Markus,
looks good to me.
Some minor remarks:
There is EObjectDescription.create(String, EObject) which takes care of
converting the simple string to a qualified name. There is
JvmDeclaredType#getDeclaredOperations which renders your cast and the
instanceof check obsolete.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
On 11.08.11 09:05, Markus Schindler wrote:
>
> Hi Sebastian,
>
> thanks for the quick response. Works like a charme!
> Here is my scoping method. Could you please take a look on it, if that's
> the way to go, or could this be simpler with same Helper classes (Which
> I don't know).
>
> public IScope scope_Method_name(WebService ws, EReference ref) {
> JvmType wsType = ws.getClazz().getName();
> List<IEObjectDescription> descriptions = new
> ArrayList<IEObjectDescription>();;
> if (wsType instanceof JvmGenericType) {
> JvmGenericType gt = (JvmGenericType) wsType;
> for (JvmMember member : gt.getMembers()) {
> if (member instanceof JvmOperation) {
> descriptions.add(EObjectDescription.create(QualifiedName.create(((JvmOperation)
> member).getSimpleName()), member));
> }
> }
> }
> return new SimpleScope(descriptions);
> }
>
>
> Regards,
> Markus
>
|
|
|
Powered by
FUDForum. Page generated in 0.04016 seconds