How to massage annotations of constructor arguments?

I have a problem when I want to make many classes in our project, de-serializable via jackson. The problem is that most classes look like this:

public class FinalFieds{

    private final String field;
    private final String secondField;

    public FinalFieds(String field, String secondField)
    {
        this.field = field;
        this.secondField = secondField;
    }

    public String getField()
    {
        return field;
    }

    public String getSecondField()
    {
        return secondField;
    }
}

So, I found that in jackson you can do something like this:

public FinalFieds(@JsonProperty("field") String field, @JsonProperty("secondField") String secondField)

And it works well. The problem is that I cannot make a structural replacement in intellij work for me. When I try: enter image description here

All my matches are in the Unclassified Matches section. Also, when I try to replace, Intellij just removes the constructor from the class.

Any idea on what I'm doing wrong, or is this a known bug in intellij?

, ( , , ).

+4
1

, . https://youtrack.jetbrains.com/issue/IDEA-141143

. , :

class $Class$ implements OurCommonInterface {
  $Class$($Type$ $parameter$);
}

$parameter$ min: 1 max: unlimited, This variable is target of the search .

Previous Search Results:

$Type$ $parameter$

:

@JsonProperty("$parameter$") $Type$ $parameter$
+1

Source: https://habr.com/ru/post/1610998/


All Articles