|
Re: Nested annotations using XbaseWithAnnotations [message #1090629 is a reply to message #1089802] |
Tue, 20 August 2013 12:22 |
Jan Koehnlein Messages: 760 Registered: July 2009 Location: Hamburg |
Senior Member |
|
|
Did you try
@AssertFalse.List(#[ @AssertFalse, @AssertFalse])
Am 19.08.13 16:14, schrieb Michel de Blok:
> Hi all,
>
> I am using a grammar that extends XbaseWithAnnotations and several
> parser rules contain the folowing definition:
>
> annotations+=XAnnotation*
>
> Which allows me to use Java Bean Validation annotations on my entities,
> e.g:
>
> @javax.validation.constraints.AssertFalse
>
> This works fine, but how can I specify multiple nested annotations
> within an annotation using XbaseWithAnnotations?
>
> e.g. I can do this:
>
> @AssertFalse.List(@AssertFalse)
>
> which is accepted by the DSL editor and translates to Java perfectly.
> But if I try to specify multiple nested annotations, similar to the
> following:
>
>
> @AssertFalse.List(@AssertFalse, @AssertFalse)
> @AssertFalse.List({ @AssertFalse, @AssertFalse })
> @AssertFalse.List(#{ @AssertFalse, @AssertFalse })
>
>
> then the DSL editor always complains about mismatched input.
>
> What is the correct syntax to specify multiple nested annotations with
> Xbase?
> Or is it not (yet) possible to define such constructs?
>
>
> NOTE: I know my example isn't functionally very usable, but I used it
> for simplicity. A more common use case is e.g. the @JoinColumns
> annotation in JPA.
>
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
---
Get professional support from the Xtext committers at www.typefox.io
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03332 seconds