开发者

nested Annotation List in Scala

开发者 https://www.devze.com 2023-01-17 23:37 出处:网络
Help, how do i do stuff like the following in Scala? import org.hibernate.validator.constraints.ScriptAssert

Help,

how do i do stuff like the following in Scala?

import org.hibernate.validator.constraints.ScriptAssert

@ScriptAssert.List({
    @ScriptAssert(scri开发者_C百科pt = "...", lang = "javascript"),
    @ScriptAssert(script = "...", lang = "javascript")})


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号