| What is best way to get reference of JvmAnnotationType in inference? [message #904208] |
Mon, 27 August 2012 22:19  |
|
JvmTypesBuilder seems not to support JvmAnnotationType.
So I created it myself:
val annoType = createJvmAnnotationType =>[
it.packageName = "java.lang"
it.simpleName = "SuppressWarnings"
]
var annoTypeRef = createJvmAnnotationReference => [
annotation = annoType
values += createJvmStringAnnotationValue => [
values += "all"
]
]
It causes dangle problem, because this reference is not contained by resource.
I tried to inspect, but it seems to I am wandering so deep and internal mechanism.
Can anyone suggest best approach?
|
|
|
| Re: What is best way to get reference of JvmAnnotationType in inference? [message #904286 is a reply to message #904208] |
Tue, 28 August 2012 03:05   |
Sven Efftinge Messages: 1667 Registered: July 2009 |
Senior Member |
|
|
Did you try a clean build?
Am 8/28/12 4:19 AM, schrieb Jeeeyul Lee:
> JvmTypesBuilder seems not to support JvmAnnotationType.
>
> So I created it myself:
>
> val annoType = createJvmAnnotationType =>[
> it.packageName = "java.lang"
> it.simpleName = "SuppressWarnings"
> ]
>
> var annoTypeRef = createJvmAnnotationReference => [
> annotation = annoType
> values += createJvmStringAnnotationValue => [
> values += "all"
> ]
> ]
>
>
> It causes dangle problem, because this reference is not contained by
> resource.
>
> I tried to inspect, but it seems to I am wandering so deep and internal
> mechanism.
>
> Can anyone suggest best approach?
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
| Re: What is best way to get reference of JvmAnnotationType in inference? [message #904295 is a reply to message #904286] |
Tue, 28 August 2012 03:28   |
|
I think I did not explain my problem correctly.
I'm writing a JVM model inferrer,
I want to add an annotation(@SuppressWarning("all")) to my inferred type.
JvmTypesBuilder xtend extensions provides newTypeRef() method to create or reuse JvmTypeReference easily.
But it supports only against of JVMGenericType, not JvmAnnotationType.
So I tried to create JvmAnnotationReferernce by myself.
val annoType = createJvmAnnotationType =>[
it.packageName = "java.lang"
it.simpleName = "SuppressWarnings"
]
var annoTypeRef = createJvmAnnotationReference => [
annotation = annoType
values += createJvmStringAnnotationValue => [
values += "all"
]
]
in above code, annoTypeRef is not contained by any resource, because I didn't. (because I don't know which resource is appropriate)
So inferring causes an error log which reports isolated model from resourceset problem.
I tried to inspect JVMTypesBuilder and TypeReferences,
It's to complex to me,
So I think that I may going wrong way or too deep.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02330 seconds