利用Groovy的动态特性删除属性 2015/12/14 18341 class A { String attToRemove int otherAtt } def a = new A() a.attToRemove = 1 println a.attToRemove A.metaClass.properties.remove(A.metaClass.properties.attToRemove) println a.attToRemove // 这里抛异常了