GrAssignmentExpression (PsiClass targetClass, PsiParameter myParameter, String fieldName, boolean methodStatic, GroovyPsiElementFactory factory) { StringBuilder builder = new StringBuilder(); if (methodStatic) { builder.append(targetClass.getQualifiedName()); builder.append('.'); } else { builder.append("this."); } builder.append(fieldName); builder.append("=").append(myParameter.getName()); return (GrAssignmentExpression)factory.createStatementFromText(builder.toString()); }