Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以动态设置expando的类?
设置好
jr = new Expando()
有没有办法
def end = 'name'
以便
jr.end
实际上会给我存储的价值
jr.name
修好了,需要同时赋值。嗬!
def value = 'some value' jr."$end" = value
我不确定我是否理解您的问题,也许这会有所帮助
jr = new Expando() jr.end = 'name' jr.name = jr.end assert jr.end == jr.name assert jr.end == 'name'