本文介绍了Scala中嵌套的注释列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助

我怎么做的东西像斯卡拉以下?

 进口org.hibernate.validator.constraints.ScriptAssert@ ScriptAssert.List({
    @ScriptAssert(脚本=...,LANG =JavaScript的),
    @ScriptAssert(脚本=...,LANG =JavaScript的)})


解决方案

正确的语法如下(阵列(...)数组,新的嵌套(..)嵌套注释):

 进口org.hibernate.validator.constraints.ScriptAssert@ ScriptAssert.List(阵列(
  新ScriptAssert(脚本=...,LANG =JavaScript的),
  新ScriptAssert(脚本=...,LANG =JavaScript的)))
类测试

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")})
解决方案

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

这篇关于Scala中嵌套的注释列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 13:34