use of org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrAccessorMethodImpl in project intellij-community by JetBrains.
the class DefaultTransformationSupport method applyTransformation.
@Override
public void applyTransformation(@NotNull TransformationContext context) {
for (GrField field : context.getFields()) {
if (!field.isProperty())
continue;
final String fieldName = field.getName();
String nameNonBoolean = getGetterNameNonBoolean(fieldName);
if (!hasContradictingMethods(context, nameNonBoolean, false)) {
context.addMethod(new GrAccessorMethodImpl(field, false, nameNonBoolean));
if (PsiType.BOOLEAN.equals(field.getDeclaredType())) {
String nameBoolean = getGetterNameBoolean(fieldName);
if (!hasContradictingMethods(context, nameBoolean, false)) {
context.addMethod(new GrAccessorMethodImpl(field, false, nameBoolean));
}
}
}
if (!field.hasModifierProperty(PsiModifier.FINAL)) {
String setterName = getSetterName(fieldName);
if (!hasContradictingMethods(context, setterName, true)) {
context.addMethod(new GrAccessorMethodImpl(field, true, setterName));
}
}
}
}
Aggregations