1 contributor(context()) {
3 def memb = enclosingMember()
5 def clazz = enclosingClass()
7 def newifyName = "groovy.lang.Newify"
8 for (a in memb?.getAnnotations(newifyName) + clazz?.getAnnotations(newifyName)) {
9 def refs = a?.findAttributeValue("value")
10 def auto = a?.findAttributeValue("auto")
11 //For Python-like style
12 if (refs && !place.qualifier) {
13 for (c in refs.asList()) {
14 def targetClass = c.bind()
15 for (cons in (targetClass?.constructors ?: [])) {
16 method name: targetClass.name, params: cons.paramStringVector, type: targetClass.qualName
21 // For Ruby-like style
22 if (!auto || auto.eval()) {
23 for (cons in classType?.getConstructors()) {
24 method name: 'new', isStatic: true, params: cons.paramStringVector, type: classType?.qualName ?: "java.lang.Object"