Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nested Annotation List in Scala

Help,

how do i do stuff like the following in Scala?

import org.hibernate.validator.constraints.ScriptAssert

@ScriptAssert.List({
    @ScriptAssert(script = "...", lang = "javascript"),
    @ScriptAssert(script = "...", lang = "javascript")})
like image 646
amsayk Avatar asked Sep 30 '10 01:09

amsayk


1 Answers

The correct syntax is as follows (Array(...) for arrays, new Nested(..) for nested annotations):

import org.hibernate.validator.constraints.ScriptAssert

@ScriptAssert.List(Array(
  new ScriptAssert(script = "...", lang = "javascript"),
  new ScriptAssert(script = "...", lang = "javascript")))
class Test
like image 192
Lukas Rytz Avatar answered Nov 17 '22 10:11

Lukas Rytz