XbaseWithAnnotations - Error for parameters [message #900148] |
Sat, 04 August 2012 17:14 |
|
Hi,
for a while i am trying to integrate the XAnnotations into my entity model.
I would like to allow the definition of all available jvm annotations.
So i added following to my grammar:
LEntityJVMAnnotations:
{LEntityJVMAnnotations}
'annotations {'
(annotations+=XAnnotation*)?
'}'
And as a result, i can specify the annotation (even with content assist).
@javax.persistence.Column
But if i try to add parameter to the annotation, i am getting errors.
@javax.persistence.Column(nullable=true)
Error: Couldn't resolve reference to JvmOperation 'nullable'.
So i had a look at xtend, and it works there without any problems.
Then i have added the jars:
- org.eclipse.xtext.xbase.lib
- org.eclipse.xtend.lib
to the classpath, but did not solve the problem.
Still errors.
I think it might be some little setting or something that i missed.
Would be great if someone of you has a hint how to solve the problem.
BTW: The contentassist for annotation parameters shows up all methods that have been prepared by the JVMModelInferrer by me.
Thanks in advance,
any hints very welcome!
Best Florian
|
|
|
Re: XbaseWithAnnotations - Error for parameters [message #900524 is a reply to message #900148] |
Tue, 07 August 2012 11:46 |
|
I did further tests but could not find the problem. The project is setup properly, since xtend classes can resolve all required stuff.
Adding that annotation works really fine...
@javax.persistence.Entity()
cachable embeddable entity Library {
But if I am adding annotations with parameters, i am getting errors.
@javax.persistence.Access(value=javax::persistence::AccessType::FIELD)
cachable embeddable entity Library {
causes "The annotation must define the attribute 'value'."
In modelInferrer i am doing
jvmTypesBuilder#translateAnnotationsTo(xAnnotation, jvmType)
So i think everything seems to be fine.
Additionally i browsed the Xtend implementation but did not find anything that was written specially to support XAnnotations. So i guess there should be no additional code to enable them.
Any suggestions / ideas highly welcome...
Best,
Florian
|
|
|
|
Powered by
FUDForum. Page generated in 0.03194 seconds