9

帮助,

我如何在 Scala 中执行以下操作?

import org.hibernate.validator.constraints.ScriptAssert

@ScriptAssert.List({
    @ScriptAssert(script = "...", lang = "javascript"),
    @ScriptAssert(script = "...", lang = "javascript")})
4

1 回答 1

9

正确的语法如下(Array(...)对于数组,new Nested(..)对于嵌套注释):

import org.hibernate.validator.constraints.ScriptAssert

@ScriptAssert.List(Array(
  new ScriptAssert(script = "...", lang = "javascript"),
  new ScriptAssert(script = "...", lang = "javascript")))
class Test
于 2010-09-30T07:10:05.067 回答