コード例 #1
0
  public static void collectMethodsFromBody(
      @NotNull GrTypeDefinition definition, List<PsiMethod> result) {
    for (GrMethod method : definition.getCodeMethods()) {
      addExpandingReflectedMethods(result, method);
    }

    for (GrField field : definition.getFields()) {
      if (!field.isProperty()) continue;
      ContainerUtil.addAll(result, field.getGetters());
      ContainerUtil.addIfNotNull(result, field.getSetter());
    }
  }
コード例 #2
0
    public void putNewElements(@NotNull GrField field) {
      myNewElements.put(field.getName(), field);

      if (field.isProperty()) {
        for (GrAccessorMethod newGetter : field.getGetters()) {
          myNewElements.put(newGetter.getName(), newGetter);
        }

        final GrAccessorMethod newSetter = field.getSetter();
        if (newSetter != null) {
          myNewElements.put(newSetter.getName(), newSetter);
        }
      }
    }
コード例 #3
0
    public NameProvider(GrField field, String newName) {
      myNameMap.put(field, newName);

      if (field.isProperty()) {
        for (GrAccessorMethod getter : field.getGetters()) {
          myNameMap.put(
              getter, RenamePropertyUtil.getGetterNameByOldName(newName, getter.getName()));
        }
        final GrAccessorMethod setter = field.getSetter();
        if (setter != null) {
          myNameMap.put(setter, GroovyPropertyUtils.getSetterName(newName));
        }
      }
    }