void (@NotNull TransformationContext context) { GrTypeDefinition typeDefinition = context.getCodeClass(); if (typeDefinition.getName() == null) return; PsiModifierList modifierList = typeDefinition.getModifierList(); if (modifierList == null) return; final PsiAnnotation tupleConstructor = context.getAnnotation(GroovyCommonClassNames.GROOVY_TRANSFORM_TUPLE_CONSTRUCTOR); final PsiAnnotation mapConstructorAnno = context.getAnnotation(GroovyCommonClassNames.GROOVY_TRANSFORM_MAP_CONSTRUCTOR); final boolean immutable = GrImmutableUtils.hasImmutableAnnotation(typeDefinition); final boolean canonical = context.getAnnotation(GroovyCommonClassNames.GROOVY_TRANSFORM_CANONICAL) != null; if (!immutable && !canonical && tupleConstructor == null && mapConstructorAnno == null) { return; } if (tupleConstructor != null && typeDefinition.getCodeConstructors().length > 0 && !PsiUtil.getAnnoAttributeValue(tupleConstructor, TupleConstructorAttributes.FORCE, false)) { return; } String originInfo; if (immutable) { originInfo = "created by @Immutable"; } else if (canonical) { originInfo = "created by @Canonical"; } else if (tupleConstructor != null) { originInfo = "created by @TupleConstructor"; } else { originInfo = "created by @MapConstructor"; } if (canonical || immutable || tupleConstructor != null) { final GrLightMethodBuilder fieldsConstructor = generateFieldConstructor(context, tupleConstructor, immutable, canonical, originInfo); context.addMethod(fieldsConstructor); } List<GrLightMethodBuilder> mapConstructors = generateMapConstructor(typeDefinition, originInfo, context); for (GrLightMethodBuilder mapConstructor : mapConstructors) { context.addMethod(mapConstructor); } }